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

📄 exec1-wu.asm

📁 51课程设计实验题目
💻 ASM
字号:
;===========================================================================
;                       Form of Mcs-51 Program
;                       Version x.x, For 89C51
;                            By:Some One
;                         02/07/2006-20..
;================================= Log =====================================
;June/07/2007, V1.0
;================================ Usage ====================================
;One Key Shift LED Patterns
;================================ Constant =================================
;================================ Hardware =================================
CharLED    Equ    P0
Key        Bit    P1.0
LEDPort    Equ    P2
;=============================== Bit Segment ===============================LEDPort   Equ      P2
;Sys_Bits:    7     6     5     4    |     3      2       1        0
; Meaning:    -     -     -     -    |     -   TimeChg KeyGet  KeyPressed
;---------------------------------------------------------------------------
CSave      Bit    F0
;---------------------------------------------------------------------------
SysBits0   Data   20h
;          Bit    00h           ;1:
;          Bit    01h           ;1:
;          Bit    02h           ;1:
;          Bit    03h           ;1:
;          Bit    04h           ;1:
;          Bit    05h           ;1:
;          Bit    06h           ;1:
;          Bit    07h           ;1:
;=============================== Byte Segment ==============================
;System RAM usage summary:
;00h..07h  for Main Working registors
;08h..0fh  for Int Second registors
;10h..1fh  for system stack, depth=16 bytes, 4 subroutines + 1 int + 5 Bytes
;20h..21h  for Bit-byte, Bit segment
;22h..2fh  for Bit Addresable Byte Units
;30h..35h  for Timer units
;37h..3fh  for Working byte units
;3fh..79h  for Print Buffer
;7ah..7fh  for system display buffer
;---------------------------------------------------------------------------
SysStack   Equ    07h           ;08h...1ch used as stack, 21 bytes
DisBuf     Data   30h           ;Display Buffer
LEDNum     Data   31h
LEDAdr     Equ    32h;33h
;========================== External RAM ===================================
;========================== Program Code ===================================
           Org    0000h
           AJmp   Main
;---------------------------------------------------------------------------
           Org    000bh         ;CTCINT0 for timer
           Clr    ET0
           Reti
;---------------------------------------------------------------------------
           Org    0013h         ;INT1
           Clr    EX1
           RetI
;---------------------------------------------------------------------------
           org    001bh         ;CTCINT1
           Clr    ET1
           RetI
;-------------------------- S232 Int Entry ---------------------------------
           Org    0023h         ;Serial Interrupt Entry
           Clr    ES
           Reti
;--------------------------------------
Delay:     Mov    r6,#80h
Delay1:    Mov    r7,#0
           Djnz   r7,$
           Djnz   r6,Delay1
           Ret
;--------------------------------------
InitSys:   Ret
;--------------------------------------
LEDPlay:   Ret
;--------------------------------------
InitPlay:  Mov    LEDNum,#0
           AJmp   NextPlay0
          
NextPlay:  Inc    LEDNum
NextPlay0: Mov    a,LEDNum
           Ret
;--------------------------------------
Main:      Mov    Sp,#07h  ;Initialize
           ACall  InitSys
           ACall  InitPlay
;--------------------------------------
MainLoop:  ACall   LEDPlay
           Jb      Key,MainLoop
           ACall   NextPlay
MainLoop1: ACall   LEDPlay
           Jnb     Key,MainLoop1
           AJmp    MainLoop
;--------------------------------------
LEDTab:    DW      LEDTab0,LEDTab1,LEDTab2,LEDTab3,0
;--------------------------------------
           Org     0100h
LEDTab0:   DB      7
           DB      01111110b
           DB      10111101b
           DB      11011011b
           DB      11100111b
           DB      11011011b
           DB      10111101b
           DB      01111110b
;--------------------------------------
LEDTab1:   DB      8
           DB      01111111b
           DB      10111111b
           DB      11011111b
           DB      11101111b
           DB      11110111b
           DB      11111011b
           DB      11111101b
           DB      11111110b
;--------------------------------------
LEDTab2:   DB      10
           DB      11111111b
           DB      11110111b
           DB      11100111b
           DB      11000011b
           DB      10000001b
           DB      00000000b
           DB      10000001b
           DB      11000011b
           DB      11100111b
           DB      11110111b
;--------------------------------------
LEDTab3:   DB      14
           db      11110111b
           db      11110011b
           db      11110001b
           db      11110000b
           db      11110001b
           db      11110011b
           db      11110111b
           db      11101111b
           db      11001111b
           db      10001111b
           db      00001111b
           db      10001111b
           db      11001111b
           db      11101111b
;--------------------------------------
           End










⌨️ 快捷键说明

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