Assembly: Constant jmp Statement (MASM/TASM)

Posted March 5, 2006 by William_Wilson in Computer programming

Last Updated on

The following tech recipe covers how to use jmp.

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


result_msg DB 'true inside if statement',0
test_msg DB 'no jmp',0

INCLUDE io.mac

main PROC

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

putStr test_msg
putStr test_msg

putStr test_msg

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 the target (in this case, the tag done) is skipped.

Questions/Comments: [email protected]
-William. ยง (marvin_gohan)

The Conversation

Follow the reactions below and share your own thoughts.

Leave a Reply