Assembly: constant jmp statment (MASM/TASM)

Contributor Icon Contributed by William_Wilson Date Icon March 5, 2006  
Tag Icon Tagged: Computer programming

How to use jmp


jmp used as a jump statement jumps from one place to another:

Example:

.MODEL SMALL
.STACK 100H
.DATA
result_msg DB 'true inside if statement',0
test_msg DB 'no jmp',0

.486
.CODE
INCLUDE io.mac

main PROC
.STARTUP

start_go:
putStr test_msg
jmp done
mov Ax,0
putStr test_msg
cmp Ax,0
jne done

putStr test_msg
putStr test_msg

done:
putStr test_msg
.EXIT

main ENDP
END main

all of the code in this program is passed over by this jmp command, try moving it to different places to prove that it is a static jump, and all code between the jump and target (in this case the tag done) is skipped.

Questions/Comments: william_a_wilson@hotmai.com
-William. ยง (marvin_gohan)

Previous recipe | Next recipe |
 
blog comments powered by Disqus