HomeComputer programmingAssembly: Constant jmp Statement (MASM/TASM)

Assembly: Constant jmp Statement (MASM/TASM)

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

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

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

LATEST REVIEWS

Recent Comments

error: Content is protected !!