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

📄 prog7.asm

📁 主要是8051源代码
💻 ASM
字号:
;  PROG7 - Accessing Bits
;
;  This Program Reads and Writes individual Bits in the Bit Addressable Area
;   of the Scractchpad RAM (Addresses 020 to 02F) and the I/O Ports.
;
;  This program will run in the UMPS simulator for a DS80C320.
;
;  Myke Predko
;  98.02.09
;
;  Hardware Notes:
;   This program is only meant to run on the Simulator
$define LED P1.0                ;  Virtual (real?) LED
$define Button P1.1             ;  Button which will be Used for LED

;  Variable Declarations
Bit1 EQU 7                      ;  Bit 7 of Address 020h
Bit2 EQU 9                      ;  Bit 1 of Address 021h

;  Mainline
 org 0                          ;  Execution Starts Here

  clr    Bit1                   ;  Reset/Set Bit 7 at Address 020h
  setb   Bit1

  clr    C                      ;  Clear the Carry Flag

  orl    C,Bit1                 ;  OR the Carry Flag With Bit1 and Save Result in Carry

  mov    Bit2,C                 ;  Save the
                                ;   To Initialize the Value for Later

Loop:                           ;  Loop Here Forever when Finished

  mov    C,P1.1                 ;  Read the Button Value
  mov    P1.0,C                 ;  If Pressed, Light the LED

  ajmp   Loop

⌨️ 快捷键说明

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