📄 prog13.asm
字号:
; PROG13 - Calling Subroutines
;
; This Application Increments a 16 bit value in a subroutine.
;
; This program will run in the UMPS simulator for a DS80C320.
;
; Myke Predko
; 98.02.12
;
; Hardware Notes:
; This program is only meant to run on the Simulator
; Variable Declarations
i EQU 0 ; Define the 16 Bit Value to Increment
j EQU 2 ; Eight bit Counter
; Mainline
org 0 ; Execution Starts Here
ajmp Mainline
Increment: ; Increment the 16 bit value starting at
; "i"
inc i ; Increment the Low Byte of "i"
cjne R0,#0,Inc_Skip ; Now, Check it to see if it is zero
inc i+1 ; The Low Byte is == 0, Increment High Byte
Inc_Skip:
ret ; Return to caller
Mainline: ; Mainline, Initialize "i" and then
; Increment it 32x
mov i,#0F0h ; Initialize it to 0x012F0
mov i+1,#012h
mov j,#32 ; Want to Increment the Number 32x
MLLoop:
acall Increment ; Now, Increment "i"
djnz j,MLLoop ; Do 32x
Loop: ; Loop Here Forever when Finished
ajmp Loop
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -