home *** CD-ROM | disk | FTP | other *** search
File List | 1978-03-06 | 1.4 KB | 43 lines |
- ===== Parallax PIC16C5x Assembler v2.3 =====
-
-
- 1 ;this is a simple source
- 2 ;
- 3 ;this little program toggles the PortA bit 3,
- 4 ;Port B counts every change on bit RA.3
- 5 ;
- 6
- 7
- 8
- 9 000- DEVICE PIC16C54,RC_OSC,WDT_OFF,PROTECT_OFF
- 10
- 11 1FF- A00 RESET start
- 12
- 13 =000B count1 = 0Bh ;this defines the register
- 14
- 15
- 16
- 17
- 18
- 19 000- C07 005 start mov !RA,#00000111b ;bit 0 to bit 2 are inputs
- 20 002- C00 006 mov !RB,#0 ;portb is output
- 21 004- 066 clr RB ;clear PortB
- 22
- 23 005- C08 1A5 main xor RA,#000001000b ;toggle bit 3 from PortA
- 24 007- 2A6 inc RB ;increase PortB
- 25
- 26 008- 90A call delay
- 27
- 28 009- A05 jmp main ;do the main loop
- 29
- 30
- 31
- 32
- 33 00A- C14 02B delay mov count1,#20 ;mov 20 to count1
- 34 00C- 2EB A0C :loop djnz count1,:loop ;decrement count1 and jump to local symbol until
- 35 ;loop is > 0
- 36 00E- 800 ret
-
-
- ===== Errors: 0 =====