home *** CD-ROM | disk | FTP | other *** search
/ MACD 4 / MACD4.iso / Emulatory / PicSim / examples / SIMPLE.LST < prev    next >
Encoding:
File List  |  1978-03-06  |  1.4 KB  |  43 lines

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