question about call, ret, and the stack

Started by ninjarider, August 26, 2006, 11:11:47 PM

Previous topic - Next topic

ninjarider

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

ninjarider