⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 prog4.asm

📁 包括了各种常用的8051单片机的程序
💻 ASM
字号:
;  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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -