prog4.asm
来自「包括了各种常用的8051单片机的程序」· 汇编 代码 · 共 38 行
ASM
38 行
; PROG4 - Indirect Bank Register Addressing
;
; This Program shows how Bank Register R0 and R1 can be used as eight bit indirection
; registers. Note that for "true" 8051s, reads past 0x07F are invalid.
;
; This program will run in the UMPS simulator for a DS80C320 (which has indirect RAM
; from 0x080 to 0x0FF).
;
; Myke Predko
; 98.02.03
;
; Hardware Notes:
; This program is only meant to run on the Simulator
; Variable Declarations
; R0, R1 and R2 are used for Variable Storage
General equ 044h
; Just Bank Registers Used for Data Storage
; Mainline
org 0 ; Execution Starts Here
mov R0,#General ; Load Bank Register 0 with the address of "General"
mov R1,General ; Common Error, forgetting the "#"
mov @R0,#012h ; Load "General" with a Value
mov A,@R0 ; Get the Value Pointed to by R0
mov R1,#ACC ; Load R1 with the Offset of A
mov R2,A ; Store the Current Value of "A"
Loop: ; Loop Here Forever when Finished
ajmp Loop
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?