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

📄 prog11.asm

📁 主要是8051源代码
💻 ASM
字号:
;  PROG11 - Stack Operations
;
;  This Application uses Simulator to Demonstrate how the 8051's
;   Stack can be used and some pitfalls to watch out for.
;
;  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
;  R0 in Bank 0 is used as a Counter/GP Variable
TestVariable EQU 00Ah           ;  Value that can be overwritten by Stack

;  Mainline
 org 0                          ;  Execution Starts Here

  mov    TestVariable,#055h     ;  Load Test Variable with a Dummy Value

  clr    A                      ;  Start Saving Data from the Stack

  mov    R0,#8                  ;  Just Loop Around 3x to Make Sure "TestVariable"
				;   is Trashed
StackLoop:                      ;  Push the Contents of the Stack Pointer

  push   ACC                    ;  Save the Contents of the Accumulator

  inc    A                      ;  Change the Value of "A"

  djnz   R0,StackLoop           ;  Loop Around 3x

  mov    A,TestVariable		;  Note that TestVariable HAS Changed


Loop:                           ;  Loop Here Forever when Finished
  ajmp   Loop

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -