📄 prog5.asm
字号:
; PROG5 - Jumping Around
;
; This Program demonstrates how jumping is done in the 8051.
;
; This program will run in the UMPS simulator for a DS80C320.
;
; Myke Predko
; 98.02.03
;
; Hardware Notes:
; This program is only meant to run on the Simulator
; Variable Declarations
; No Registers of Variables are required
; Mainline
org 0 ; Execution Starts Here
sjmp Short_Label ; Jump to a Short Label
org 10
Back_Label:
ajmp Valid_Label ; Jump within the Page
org 20
Short_Label: ; Showing how to Jump to Different Locations - Short Jump
; Back a Bit
sjmp Back_Label
org 30
Valid_Label: ; "ajmp Valid_Label" will Come Here
; ajmp Invalid_Label ; Invalid Jump to Next Page
db 021h, 000h ; Make My own "ajmp" to 0900h
ljmp Invalid_Label ; Valid Jump to Next Page
org 0100h
; #### - End up here, wrong address for "ajmp", should have used "ljmp"
Bad_Loop: ; In the wrong Section of Code
ajmp Bad_Loop ; Have to Look at your "jmp" Statement Again
org 0900h ; In the Next Code Page (Over 2048)
Invalid_Label: ; This is only accessible via "ljmp"
Loop: ; Loop Here Forever when Finished
ljmp Loop
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -