?? bin4d.sdi
字號(hào):
,,,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
,,,;
,,,; Source File: BIN4D.ASM
,,,; Author: MPB
,,,; Date: 13-11-05
,,,;
,,,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
,,,;
,,,; Slow output binary count is stopped, started
,,,; and reset with push buttons.
,,,; Modified with extra directives
,,,;
,,,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
,,,
,,,; Declare processor, supress messages and warnings,
,,,; do not print symbol table, and configure (RC clock)
,,,
,,, LIST p=16f877a, w=2, st=off, mm=off
00002007,3733,, __CONFIG 0x3733
,,,
,,,; Declare GPR label and literal constant
,,,; Define input labels
,,,; Include standard SFR label file
,,,; Include PortB initialisation file
,,,
,,,Timer EQU 20
,,,DDCodeB SET b'00000000'
,,,CONSTANT Count=0FF
,,,#DEFINE RunBut PORTD,1
,,,#DEFINE ResBut PORTD,0
,,,#INCLUDE "P16F877A.INC"
,,,#INCLUDE <BOUT.INI>
00000000,1683 1303,, BANKSEL TRISB ; Select bank 1
00000002,3000,, MOVLW DDCodeB ; Port B Direction Code
00000003,0086,, MOVWF TRISB ; Load the DDR code into F86
00000004,1283 1303,, BANKSEL PORTB ; Select bank 0
,,,
,,,; Program code ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
,,,
,,,; 'delay' macro .............................................
,,,
,,,delay MACRO ; macro definition starts
,,, MOVWF Timer ; Copy W to timer register
,,,down DECF Timer ; Decrement timer register
,,, BNZ down ; and repeat until zero
,,, ENDM ; macro definition ends
,,,
,,,; Main loop .................................................
,,,
00000006,0186,reset,reset CLRF PORTB ; Clear Port B Data
,,,
00000007,1C08,start,start BTFSS ResBut ; Test reset button
00000008,2806,, GOTO reset ; and reset Port B if pressed
00000009,1888,, BTFSC RunBut ; Test run button
0000000A,2807,, GOTO start ; and repeat if n pressed
,,,
0000000B,0A86,, INCF PORTB ; Increment output at Port B
0000000C,30FF,, MOVLW Count ; Delay count literal
,,, delay ; Jump to subroutine 'delay'
0000000D,00A0,, - MOVWF Timer ; Copy W to timer register
0000000E,03A0,down,- down DECF Timer ; Decrement timer register
0000000F,1D03 280E,, - BNZ down ; and repeat until zero
00000011,2807,, GOTO start ; Repeat main loop always
,,,
,,, END ; Terminate source code......
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -