prog10.asm

来自「包括了各种常用的8051单片机的程序」· 汇编 代码 · 共 36 行

ASM
36
字号
;  PROG10 - Looping
;
;  This Program Uses the Simulator to Demonstrate how a set number
;   of Loops can be Simply Accomplished in the 8051.
;
;  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

;  Variable Declarations
;  R0 in Bank 0 is used as a Counter

;  Mainline
 org 0                          ;  Execution Starts Here

  clr    P1.0                   ;  Turn on the LED for the Loop

  mov    R0,#17                 ;  Want to Loop 17x

Dlay:                           ;  Loop Here 17x while LED is On

;  #### - Inside Loop Code Can go Here

  djnz   R0,Dlay                ;  Decrement the Loop Counter and
                                ;   If Not Zero, Loop Around Again

  setb   P1.0                   ;  Turn Off the LED


Loop:                           ;  Loop Here Forever when Finished
  ajmp   Loop

⌨️ 快捷键说明

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