News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

code help

Started by xxxx, February 05, 2005, 02:11:34 PM

Previous topic - Next topic

xxxx

nothing happens when this code is executed.please help identify the problem.
thanks



.MODEL SMALL
.STACK 64
.DATA
ORG 10H
DATA_IN Db 'HELLO WORLD$'
CVMODE DB ?


ORG 20H
ANS     Dw  42H   


.CODE

MAIN PROC FAR

     MOV AX,@DATA
      MOV DS,AX
      
      MOV AH,0FH
      INT 10H
      
      MOV CVMODE,AL
      
      MOV AL,98
      MOV AH,00
      INT 10H
      
      
      MOV AX,0600H
      MOV BH,110101b
      MOV CX,0000
      MOV DX,184FH
      INT 10H
     
     
     
   
     
        MOV AH,09
        MOV DX,OFFSET DATA_IN
        int 21h
        MOV AL,CVMODE
      MOV AH,00
      INT 10H



MOV AH,4CH
INT 21H

     





     
     

MAIN ENDP
     END MAIN

MichaelW

You would be more likely to get a useful answer if you would comment your code so we could know what you are trying to do.

Assuming you are running your program from a prompt, the reason you are not seeing the output is that the final mode set is erasing the display memory. Learning to find problems in you code is part of learning to program. You could have discovered this problem by commenting out all of the BIOS calls and building and running the program. You would have discovered that everything except the colors worked, and you could then uncomment the BIOS calls, one at a time, and build and run the program after each change. Then, after a maximum of four tries you would have known what the problem was.

Also, your mode set is failing because 98 is not a standard VGA mode. I can only guess at what mode you are trying to set, but you should be aware that the DOS display functions are unlikely to work for the graphics modes.

Also, I have been neglecting to ask what the ORG statements in your data segment are for. MASM will allocate the correct amount of memory for your data without these statements. And because these statements override MASM's data allocation mechanism, if you get the offset addresses wrong you could overwrite one data item with another.
eschew obfuscation

xxxx

sorry for the lack of comment.anyway i've got everything solved.thanks for your hints.