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

📄 prog22.asm

📁 主要是8051源代码
💻 ASM
字号:
;  PROG22 - Reset
;
;  This Application checks to see if the 8051 had been reset by
;   checking the first four memory locations and if they are set
;   to R0 = 0AAh, R1 = 055h, R2 = 0F0h and R3 = 00Fh.  
;
;  Myke Predko
;  98.02.23
;
;  Hardware Notes:
;  80C520 Running at 4 MHz
;  P1.0-7 Connected to LEDs
;  P3.0-7 Connected to LEDs

;  Variable Declarations
;  R0, R1, R2, and R3 Used for Checking for the Initial Values  

;  Mainline
 org 0                          ;  Execution Starts Here

  cjne   R0,#0AAh,NotReset      ;  Check 1st Value, If Not Zero, then Not Reset
  cjne   R1,#055h,NotReset      ;   Repeat for the other three Values
  cjne   R2,#0F0h,NotReset
  cjne   R3,#00Fh,NotReset

  mov    P3,#0                  ;  Turn on the LEDs at P1

RstLoop:                        ;  Reset Loop
  ajmp   RstLoop


NotReset:                       ;  Set P3 On for Reset is On

  mov    R0,#0AAh               ;  Initialize the Reset Positions 
  mov    R1,#055h
  mov    R2,#0F0h
  mov    R3,#00Fh

  mov    P1,#0                  ;  Turn on the LEDs at P3

NRLoop:                         ;  Loop Forever
  ajmp   NRLoop

⌨️ 快捷键说明

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