The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => 16 bit DOS Programming => Topic started by: ninjarider on August 26, 2006, 11:11:47 PM

Title: question about call, ret, and the stack
Post by: ninjarider on August 26, 2006, 11:11:47 PM
would this be possible change this

GameLoop:
mov di, offset CommandLine
...
xor ax, ax
int16h
stosb

cmp al, 13
jmp TestString
jmp GameLoop

TestString:
mov si, offset CommandLine
Call StringLoop
jmp GameLoop

StringLoop
lodsb
...
ret

to this

GameLoop:
mov di, offset CommandLine
...
xor ax, ax
int16h
stosb

cmp al, 13
jmp TestString
jmp GameLoop

TestString:
push offset GameLoop
mov si, offset CommandLine
jmp StringLoop

StringLoop
lodsb
...
ret

none of the code i have ommited deals with the stack
Title: Re: question about call, ret, and the stack
Post by: ninjarider on August 27, 2006, 02:57:01 AM
nevermind. both of the above codes work