If I call a function, can I use a jmp command within that function to go back to part of a different function? That is to say, is this code valid:
testfunction PROC
jmp jumppoint
ret
testfunction ENDP
main PROC
jumppoint:
call testfunction
main ENDP
END
If this is valid, it should produce an infinite loop. Yes/no?
If by ‘valid’ you mean will the assembler let you do it, the answer is yes. It will introduce a sort of infinite loop; however, since the
callinstruction will place additional information on the stack (a return address) each time it’s executed, eventually the stack will overflow and the program will crash (maybe not if you’re running in real mode).