I agree the code should work. However, trying to display something on the screen while using debug is quite a problem because debug overwrites the screen with the new status before you can see what may have been written on it by your code.

The only way to see it while in debug would be to follow the screen output instructions by some other instructions to (i) clear the screen, and (ii) wait for some keyboard input before returning control to the program. You then instruct debug to run until that sequence is completed.

With those extra instructions, remember to move your string so that it does not interfere with your code.

Have fun.

Raymond
Posted on 2002-12-21 20:15:03 by Raymond
you can also do this u you like:



START: JMP INIT
STR1 DB "Hello 16Bit Asm!",0
STR2 DB 17 DUP(0)
INIT:
MOV DI, OFFSET STR1 ; get address
MOV CX, LENGTHOF STR1 ; get number length
JCXZ Finished ; is its 0, exit
MOV AL, 0 ; al = NULL
CLD ; DI/SI Going Up the ledder
REPNE SCASB ; Compare al,[ES:DI]
JNZ Finished ; NULL Not Found
SUB DI,OFFSET STR1 ; Get number of bytes
MOV CX, DI ; reset counter
SHR CX,1 ; cx/2
MOV SI, OFFSET STR1 ; prepare
MOV DI, OFFSET STR2 ; for copying
REP MOVSW ; copy
JNC Finished ; if cx originaly was even number jump
MOVSB ; coyp remained byte
Finished:
INT 20H
Posted on 2002-12-31 07:19:09 by wizzra