Home » Archimedes archive » Acorn User » AU 1998-13 (Christmas).adf » Regulars » RTR/LEDtst_L
RTR/LEDtst_L
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Archimedes archive » Acorn User » AU 1998-13 (Christmas).adf » Regulars |
Filename: | RTR/LEDtst_L |
Read OK: | ✔ |
File size: | 2CF8 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
PIC 16C84 Assembler V1.4 by Mike Cook File:- ADFS::Square.$.Develop.LargeLED.LEDtst Assembled on :- Fri,09 Oct 1998 at 17:40:30 ;Multiplexed LED matrix display test ;For an 10 MHz clock ;A0 - Serial out ;A1 - Serial in ;A2 - CTS allows serial input ;A3 - RTS output held until this is low ;Note for 16F84 invert the state of the PWRTE list P=16C84 C equ 0 PCL equ 2 Z equ 2 PORTB equ 6 PORTA equ 5 TRISB equ 86H TRISA equ 85H EECON1 equ 88H EEDATA equ 8 INTCON equ 0bH EEADR equ 9 STATUS equ 3 RP0 equ 5 INC equ 1 cts equ 2 rts equ 3 ;Output bits cdat equ 1 ;Coloum data cck equ 2 ;Coloum clock rclr equ 3 ;Row clear rck equ 4 ;Row clock rdat equ 5 ;Row data sBuf equ 0ch ;Serial send buffer Scount equ 0dh ;Tempory Counter Cdown equ 0eh ;Time delay countdown rBuf equ 0fh ;Recieve buffer ScanNo equ 10h ;Number of row we are on RowC equ 11h ;Row counter Sstore equ 12h ;Scrole store Com1 equ 13h ;Command 1 Com2 equ 14h ;Command 2 save_w equ 15h ;save w reg save_s equ 16H ;save status save_p equ 17h ;save port LEDs DisBuf equ 1Ah ;Display buffer ; org 0 0000 2846 goto Start org 4 0004 0095 movwf save_w ;save w and s regs 0005 0E03 swapf STATUS,w ;swapf doesn't affect Z like movf 0006 0096 movwf save_s 0007 0806 movf PORTB,w ;Save state of LEDs 0008 0097 movwf save_p 0009 0186 clrf PORTB ;Turn LEDs off 000A 2015 call Rx ;Recieve byte 000B 0A94 incf Com2,f ;Increment the data to put in 000C 2099 call sleft ;Scroll left command out: 000D 0817 movf save_p,w 000E 0086 movwf PORTB ;Turn LEDs back on 000F 0E16 swapf save_s,w 0010 0083 movwf STATUS ; restore registers 0011 0E95 swapf save_w,f 0012 0E15 swapf save_w,w 0013 108B bcf INTCON,1 ;Clear edge interrupt 0014 0009 retfie ;Recieve a serial byte Rx: 0015 3008 movlw 8 ;Number of data bits to get 0016 008D movwf Scount Sb: 0017 1885 btfsc PORTA,1 ;Hold until start bit 0018 2817 goto Sb 0019 203B call hDelay ;Half a baud delay Rnb: 001A 1003 bcf STATUS,C ;Clear the carry bit 001B 0C8F rrf rBuf,f ;Prepare for next bit 001C 203E call rDelay ;Full baud delay for recieve 001D 1885 btfsc PORTA,1 ;Test input 001E 178F bsf rBuf,7 ;Set if needed 001F 0B8D decfsz Scount,f ;See if finished 0020 281A goto Rnb ;Round again if not 0021 203E call rDelay ;Allow for stop bit to start 0022 080F movf rBuf,w ;Put recieved chractor into W 0023 0008 return ;Send a serial byte Send: 0024 1985 btfsc PORTA,rts ;Only proceed when rts is low 0025 2824 goto Send 0026 3009 movlw 9 ;Number of data bits to send 0027 008D movwf Scount 0028 1005 bcf PORTA,0 ;Start bit 0029 2038 call cDelay ;Extra delay compensation Sloop: 002A 2041 call Delay 002B 180C btfsc sBuf,0 ;Set the next bit 002C 1405 bsf PORTA,0 002D 1C0C btfss sBuf,0 002E 1005 bcf PORTA,0 002F 0C8C rrf sBuf,f ;Shift for next time 0030 0B8D decfsz Scount,f 0031 282A goto Sloop ;Round until finished 0032 1405 bsf PORTA,0 ;Stop bit 0033 2038 call cDelay ;Extra delay compensation 0034 2041 call Delay 0035 2041 call Delay 0036 2038 call cDelay ;For good measure 0037 0008 return cDelay: 0038 3002 movlw 2 ;Small delay at end of send 0039 008E movwf Cdown 003A 2843 goto Dloop hDelay: 003B 3015 movlw 21 ;half delay for serial recieve 10MHz clock 003C 008E movwf Cdown ; 19,200 Baud rate 003D 2843 goto Dloop rDelay: 003E 3026 movlw 38 ;Delay for serial recieve 10MHz clock 003F 008E movwf Cdown ; 19,200 Baud rate 0040 2843 goto Dloop Delay: 0041 3027 movlw 39 ;Delay for serial send 10MHz clock 0042 008E movwf Cdown ; 19,200 Baud rate Dloop: 0043 0B8E decfsz Cdown,f 0044 2843 goto Dloop 0045 0008 return Start: 0046 1683 bsf STATUS,RP0 ;SELECT REGISTER BANK 1 0047 301A movlw 1Ah ;Bits 4,3 & 2 inputs 0048 0085 movwf TRISA^80H 0049 3001 movlw 1 ;Bit 0 input rest outputs 004A 0086 movwf TRISB^80H 004B 3003 movlw 3 ;16 prescaler -ve edge interrupt 004C 0081 movwf 1 ;Option register 004D 3090 movlw 90H ;Enable bit 0 interrupt 004E 008B movwf INTCON 004F 1283 bcf STATUS,RP0 ;SELECT REGISTER BANK 0 0050 1405 bsf PORTA,0 ;Serial at Mark 0051 1105 bcf PORTA,cts ;CTS enabled 0052 0186 clrf PORTB 0053 0190 clrf ScanNo 0054 0194 clrf Com2 ;Just put some test data into some memory 0055 30AA movlw 0AAh 0056 009A movwf DisBuf 0057 009B movwf DisBuf!1 0058 009C movwf DisBuf!2 0059 00A0 movwf DisBuf!6 005A 00A1 movwf DisBuf!7 005B 00A2 movwf DisBuf!8 005C 00A6 movwf DisBuf!12 005D 00A7 movwf DisBuf!13 005E 00A8 movwf DisBuf!14 005F 00AC movwf DisBuf!18 0060 00AD movwf DisBuf!19 0061 00AE movwf DisBuf!20 0062 3055 movlw 055h 0063 009D movwf DisBuf!3 0064 009E movwf DisBuf!4 0065 009F movwf DisBuf!5 0066 00A3 movwf DisBuf!9 0067 00A4 movwf DisBuf!10 0068 00A5 movwf DisBuf!11 0069 00A9 movwf DisBuf!15 006A 00AA movwf DisBuf!16 006B 00AB movwf DisBuf!17 Main: 006C 1D0B btfss 0bh,2 ;Test timer 006D 286C goto Main ;Loop until time 006E 110B bcf 0bh,2 ;Clear it for next time 006F 0A90 incf ScanNo,f 0070 3007 movlw 7 ;See if it is at end 0071 0210 subwf ScanNo,w 0072 1903 btfsc STATUS,Z ;Wrap it round after 7 0073 0190 clrf ScanNo 0074 2076 call scan 0075 286C goto Main scan: 0076 0186 clrf PORTB ; Blank out row 0077 1003 bcf STATUS,C 0078 0D10 rlf ScanNo,w ;Scan No * 3 + DisBuf = reg address 0079 0710 addwf ScanNo,w 007A 3E1A addlw DisBuf 007B 0084 movwf 4 ;to indirect register 007C 208C call rbout ;Output first byte 007D 0A84 incf 4,f ;Next byte 007E 208C call rbout 007F 0A84 incf 4,f ;Last byte 0080 208A call hrout 0081 0810 movf ScanNo,w 0082 0091 movwf RowC ;Row Count 0083 0A91 incf RowC,f ;One more pulse 0084 1003 bcf STATUS,C 0085 0D91 rlf RowC,f 0086 0D91 rlf RowC,f 0087 0D11 rlf RowC,w 0088 0086 movwf PORTB 0089 0008 return hrout: 008A 3004 movlw 4 ;Only 4 bits out 008B 288D goto he rbout: 008C 3008 movlw 8 ;number of shifts to do he: 008D 0091 movwf RowC ;shift store 008E 0800 movf 0,w ;get byte to send 008F 0092 movwf Sstore ;store it rloop: 0090 0C92 rrf Sstore,f ;get next bit into carry 0091 1086 bcf PORTB,cdat ;Get data line right 0092 1803 btfsc STATUS,C 0093 1486 bsf PORTB,cdat 0094 1506 bsf PORTB,cck ;Toggle clock 0095 1106 bcf PORTB,cck 0096 0B91 decfsz RowC,f ;All bits done? 0097 2890 goto rloop 0098 0008 return ;Commands sleft: 0099 301A movlw DisBuf ;Scroll memory left 009A 0084 movwf 4 ;into indirect register 009B 3007 movlw 7 ;Number of rows to scroll 009C 008C movwf sBuf ;Temp storage 009D 1003 bcf STATUS,C slloop: 009E 0D80 rlf 0,f ;Move first byte 009F 0A84 incf 4,f 00A0 0D80 rlf 0,f ;Move second byte 00A1 0A84 incf 4,f 00A2 0D80 rlf 0,f ;Move last byte 00A3 1200 bcf 0,4 ;Blank bit fallen off the end 00A4 0A84 incf 4,f ;Move on for next time 00A5 0B8C decfsz sBuf,f ;Loop until all 7 rows are out 00A6 289E goto slloop 00A7 1814 btfsc Com2,0 ;Now put new data in 00A8 141A bsf DisBuf,0 00A9 1894 btfsc Com2,1 00AA 141D bsf DisBuf!3,0 00AB 1914 btfsc Com2,2 00AC 1420 bsf DisBuf!6,0 00AD 1994 btfsc Com2,3 00AE 1423 bsf DisBuf!9,0 00AF 1A14 btfsc Com2,4 00B0 1426 bsf DisBuf!12,0 00B1 1A94 btfsc Com2,5 00B2 1429 bsf DisBuf!15,0 00B3 1B14 btfsc Com2,6 00B4 142C bsf DisBuf!18,0 00B5 0008 return end Memory Usage Map ('X' = Used, '-' = Unused) 0000 : X---XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0040 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0080 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXX---------- 54 Lables & Constants:- Hex Name 0000 C 0002 PCL 0002 Z 0006 PORTB 0005 PORTA 0086 TRISB 0085 TRISA 0088 EECON1 0008 EEDATA 000B INTCON 0009 EEADR 0003 STATUS 0005 RP0 0001 INC 0002 cts 0003 rts 0001 cdat 0002 cck 0003 rclr 0004 rck 0005 rdat 000C sBuf 000D Scount 000E Cdown 000F rBuf 0010 ScanNo 0011 RowC 0012 Sstore 0013 Com1 0014 Com2 0015 save_w 0016 save_s 0017 save_p 001A DisBuf 000D out 0015 Rx 0017 Sb 001A Rnb 0024 Send 002A Sloop 0038 cDelay 003B hDelay 003E rDelay 0041 Delay 0043 Dloop 0046 Start 006C Main 0076 scan 008A hrout 008C rbout 008D he 0090 rloop 0099 sleft 009E slloop 0 Errors
00000000 50 49 43 20 31 36 43 38 34 20 41 73 73 65 6d 62 |PIC 16C84 Assemb| 00000010 6c 65 72 20 56 31 2e 34 20 62 79 20 4d 69 6b 65 |ler V1.4 by Mike| 00000020 20 43 6f 6f 6b 0a 46 69 6c 65 3a 2d 20 41 44 46 | Cook.File:- ADF| 00000030 53 3a 3a 53 71 75 61 72 65 2e 24 2e 44 65 76 65 |S::Square.$.Deve| 00000040 6c 6f 70 2e 4c 61 72 67 65 4c 45 44 2e 4c 45 44 |lop.LargeLED.LED| 00000050 74 73 74 0a 41 73 73 65 6d 62 6c 65 64 20 6f 6e |tst.Assembled on| 00000060 20 3a 2d 20 46 72 69 2c 30 39 20 4f 63 74 20 31 | :- Fri,09 Oct 1| 00000070 39 39 38 20 61 74 20 31 37 3a 34 30 3a 33 30 0a |998 at 17:40:30.| 00000080 0a 3b 4d 75 6c 74 69 70 6c 65 78 65 64 20 4c 45 |.;Multiplexed LE| 00000090 44 20 6d 61 74 72 69 78 20 64 69 73 70 6c 61 79 |D matrix display| 000000a0 20 74 65 73 74 0a 3b 46 6f 72 20 61 6e 20 31 30 | test.;For an 10| 000000b0 20 4d 48 7a 20 63 6c 6f 63 6b 0a 3b 41 30 20 2d | MHz clock.;A0 -| 000000c0 20 53 65 72 69 61 6c 20 6f 75 74 0a 3b 41 31 20 | Serial out.;A1 | 000000d0 2d 20 53 65 72 69 61 6c 20 69 6e 0a 3b 41 32 20 |- Serial in.;A2 | 000000e0 2d 20 43 54 53 20 61 6c 6c 6f 77 73 20 73 65 72 |- CTS allows ser| 000000f0 69 61 6c 20 69 6e 70 75 74 0a 3b 41 33 20 2d 20 |ial input.;A3 - | 00000100 52 54 53 20 6f 75 74 70 75 74 20 68 65 6c 64 20 |RTS output held | 00000110 75 6e 74 69 6c 20 74 68 69 73 20 69 73 20 6c 6f |until this is lo| 00000120 77 0a 0a 3b 4e 6f 74 65 20 66 6f 72 20 31 36 46 |w..;Note for 16F| 00000130 38 34 20 69 6e 76 65 72 74 20 74 68 65 20 73 74 |84 invert the st| 00000140 61 74 65 20 6f 66 20 74 68 65 20 50 57 52 54 45 |ate of the PWRTE| 00000150 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6c |. l| 00000160 69 73 74 20 20 20 50 3d 31 36 43 38 34 0a 0a 0a |ist P=16C84...| 00000170 20 20 20 20 20 20 20 43 20 20 20 20 20 20 20 20 | C | 00000180 20 20 20 20 20 65 71 75 20 30 20 20 20 20 20 20 | equ 0 | 00000190 20 20 20 20 0a 20 20 20 20 20 20 20 50 43 4c 20 | . PCL | 000001a0 20 20 20 20 20 20 20 20 20 20 65 71 75 20 32 20 | equ 2 | 000001b0 20 20 20 20 20 20 20 20 20 0a 20 20 20 20 20 20 | . | 000001c0 20 5a 20 20 20 20 20 20 20 20 20 20 20 20 20 65 | Z e| 000001d0 71 75 20 32 20 20 20 20 20 20 20 20 20 20 0a 20 |qu 2 . | 000001e0 20 20 20 20 20 20 50 4f 52 54 42 20 20 20 20 20 | PORTB | 000001f0 20 20 20 20 65 71 75 20 36 20 20 20 20 20 20 20 | equ 6 | 00000200 20 20 20 0a 20 20 20 20 20 20 20 50 4f 52 54 41 | . PORTA| 00000210 20 20 20 20 20 20 20 20 20 65 71 75 20 35 20 20 | equ 5 | 00000220 20 20 20 20 20 20 20 20 0a 20 20 20 20 20 20 20 | . | 00000230 54 52 49 53 42 20 20 20 20 20 20 20 20 20 65 71 |TRISB eq| 00000240 75 20 38 36 48 20 20 20 20 20 20 20 20 20 20 0a |u 86H .| 00000250 20 20 20 20 20 20 20 54 52 49 53 41 20 20 20 20 | TRISA | 00000260 20 20 20 20 20 65 71 75 20 38 35 48 20 20 20 20 | equ 85H | 00000270 20 20 20 20 20 20 0a 20 20 20 20 20 20 20 45 45 | . EE| 00000280 43 4f 4e 31 20 20 20 20 20 20 20 20 65 71 75 20 |CON1 equ | 00000290 38 38 48 20 20 20 20 20 20 20 20 20 20 0a 20 20 |88H . | 000002a0 20 20 20 20 20 45 45 44 41 54 41 20 20 20 20 20 | EEDATA | 000002b0 20 20 20 65 71 75 20 38 20 20 20 20 20 20 20 20 | equ 8 | 000002c0 20 20 0a 20 20 20 20 20 20 20 49 4e 54 43 4f 4e | . INTCON| 000002d0 20 20 20 20 20 20 20 20 65 71 75 20 30 62 48 20 | equ 0bH | 000002e0 20 20 20 20 20 20 20 20 20 0a 20 20 20 20 20 20 | . | 000002f0 20 45 45 41 44 52 20 20 20 20 20 20 20 20 20 65 | EEADR e| 00000300 71 75 20 39 20 20 20 20 20 20 20 20 20 20 0a 20 |qu 9 . | 00000310 20 20 20 20 20 20 53 54 41 54 55 53 20 20 20 20 | STATUS | 00000320 20 20 20 20 65 71 75 20 33 20 20 20 20 20 20 20 | equ 3 | 00000330 20 20 20 0a 20 20 20 20 20 20 20 52 50 30 20 20 | . RP0 | 00000340 20 20 20 20 20 20 20 20 20 65 71 75 20 35 20 20 | equ 5 | 00000350 20 20 20 20 20 20 20 20 0a 20 20 20 20 20 20 20 | . | 00000360 49 4e 43 20 20 20 20 20 20 20 20 20 20 20 65 71 |INC eq| 00000370 75 20 31 20 20 20 20 20 20 20 20 20 20 0a 20 20 |u 1 . | 00000380 20 20 20 20 20 63 74 73 20 20 20 20 20 20 20 20 | cts | 00000390 20 20 20 65 71 75 20 32 20 20 20 20 20 20 20 20 | equ 2 | 000003a0 20 20 0a 20 20 20 20 20 20 20 72 74 73 20 20 20 | . rts | 000003b0 20 20 20 20 20 20 20 20 65 71 75 20 33 20 20 20 | equ 3 | 000003c0 20 20 20 20 20 20 20 0a 3b 4f 75 74 70 75 74 20 | .;Output | 000003d0 62 69 74 73 0a 20 20 20 20 20 20 20 63 64 61 74 |bits. cdat| 000003e0 20 20 20 20 20 20 20 20 20 20 65 71 75 20 31 20 | equ 1 | 000003f0 20 20 20 20 20 20 20 20 20 3b 43 6f 6c 6f 75 6d | ;Coloum| 00000400 20 64 61 74 61 0a 20 20 20 20 20 20 20 63 63 6b | data. cck| 00000410 20 20 20 20 20 20 20 20 20 20 20 65 71 75 20 32 | equ 2| 00000420 20 20 20 20 20 20 20 20 20 20 3b 43 6f 6c 6f 75 | ;Colou| 00000430 6d 20 63 6c 6f 63 6b 0a 20 20 20 20 20 20 20 72 |m clock. r| 00000440 63 6c 72 20 20 20 20 20 20 20 20 20 20 65 71 75 |clr equ| 00000450 20 33 20 20 20 20 20 20 20 20 20 20 3b 52 6f 77 | 3 ;Row| 00000460 20 63 6c 65 61 72 0a 20 20 20 20 20 20 20 72 63 | clear. rc| 00000470 6b 20 20 20 20 20 20 20 20 20 20 20 65 71 75 20 |k equ | 00000480 34 20 20 20 20 20 20 20 20 20 20 3b 52 6f 77 20 |4 ;Row | 00000490 63 6c 6f 63 6b 0a 20 20 20 20 20 20 20 72 64 61 |clock. rda| 000004a0 74 20 20 20 20 20 20 20 20 20 20 65 71 75 20 35 |t equ 5| 000004b0 20 20 20 20 20 20 20 20 20 20 3b 52 6f 77 20 64 | ;Row d| 000004c0 61 74 61 0a 0a 20 20 20 20 20 20 20 73 42 75 66 |ata.. sBuf| 000004d0 20 20 20 20 20 20 20 20 20 20 65 71 75 20 30 63 | equ 0c| 000004e0 68 20 20 20 20 20 20 20 20 20 20 0a 3b 53 65 72 |h .;Ser| 000004f0 69 61 6c 20 73 65 6e 64 20 62 75 66 66 65 72 0a |ial send buffer.| 00000500 20 20 20 20 20 20 20 53 63 6f 75 6e 74 20 20 20 | Scount | 00000510 20 20 20 20 20 65 71 75 20 30 64 68 20 20 20 20 | equ 0dh | 00000520 20 20 20 20 20 20 3b 54 65 6d 70 6f 72 79 20 43 | ;Tempory C| 00000530 6f 75 6e 74 65 72 0a 20 20 20 20 20 20 20 43 64 |ounter. Cd| 00000540 6f 77 6e 20 20 20 20 20 20 20 20 20 65 71 75 20 |own equ | 00000550 30 65 68 20 20 20 20 20 20 20 20 20 20 3b 54 69 |0eh ;Ti| 00000560 6d 65 20 64 65 6c 61 79 20 63 6f 75 6e 74 64 6f |me delay countdo| 00000570 77 6e 0a 20 20 20 20 20 20 20 72 42 75 66 20 20 |wn. rBuf | 00000580 20 20 20 20 20 20 20 20 65 71 75 20 30 66 68 20 | equ 0fh | 00000590 20 20 20 20 20 20 20 20 20 3b 52 65 63 69 65 76 | ;Reciev| 000005a0 65 20 62 75 66 66 65 72 0a 20 20 20 20 20 20 20 |e buffer. | 000005b0 53 63 61 6e 4e 6f 20 20 20 20 20 20 20 20 65 71 |ScanNo eq| 000005c0 75 20 31 30 68 20 20 20 20 20 20 20 20 20 20 3b |u 10h ;| 000005d0 4e 75 6d 62 65 72 20 6f 66 20 72 6f 77 20 77 65 |Number of row we| 000005e0 20 61 72 65 20 6f 6e 0a 20 20 20 20 20 20 20 52 | are on. R| 000005f0 6f 77 43 20 20 20 20 20 20 20 20 20 20 65 71 75 |owC equ| 00000600 20 31 31 68 20 20 20 20 20 20 20 20 20 20 3b 52 | 11h ;R| 00000610 6f 77 20 63 6f 75 6e 74 65 72 0a 20 20 20 20 20 |ow counter. | 00000620 20 20 53 73 74 6f 72 65 20 20 20 20 20 20 20 20 | Sstore | 00000630 65 71 75 20 31 32 68 20 20 20 20 20 20 20 20 20 |equ 12h | 00000640 20 3b 53 63 72 6f 6c 65 20 73 74 6f 72 65 0a 20 | ;Scrole store. | 00000650 20 20 20 20 20 20 43 6f 6d 31 20 20 20 20 20 20 | Com1 | 00000660 20 20 20 20 65 71 75 20 31 33 68 20 20 20 20 20 | equ 13h | 00000670 20 20 20 20 20 3b 43 6f 6d 6d 61 6e 64 20 31 0a | ;Command 1.| 00000680 20 20 20 20 20 20 20 43 6f 6d 32 20 20 20 20 20 | Com2 | 00000690 20 20 20 20 20 65 71 75 20 31 34 68 20 20 20 20 | equ 14h | 000006a0 20 20 20 20 20 20 3b 43 6f 6d 6d 61 6e 64 20 32 | ;Command 2| 000006b0 0a 20 20 20 20 20 20 20 73 61 76 65 5f 77 20 20 |. save_w | 000006c0 20 20 20 20 20 20 65 71 75 20 31 35 68 20 20 20 | equ 15h | 000006d0 20 20 20 20 20 20 20 3b 73 61 76 65 20 77 20 72 | ;save w r| 000006e0 65 67 0a 20 20 20 20 20 20 20 73 61 76 65 5f 73 |eg. save_s| 000006f0 20 20 20 20 20 20 20 20 65 71 75 20 31 36 48 20 | equ 16H | 00000700 20 20 20 20 20 20 20 20 20 3b 73 61 76 65 20 73 | ;save s| 00000710 74 61 74 75 73 0a 20 20 20 20 20 20 20 73 61 76 |tatus. sav| 00000720 65 5f 70 20 20 20 20 20 20 20 20 65 71 75 20 31 |e_p equ 1| 00000730 37 68 20 20 20 20 20 20 20 20 20 20 3b 73 61 76 |7h ;sav| 00000740 65 20 70 6f 72 74 20 4c 45 44 73 0a 20 20 20 20 |e port LEDs. | 00000750 20 20 20 44 69 73 42 75 66 20 20 20 20 20 20 20 | DisBuf | 00000760 20 65 71 75 20 31 41 68 20 20 20 20 20 20 20 20 | equ 1Ah | 00000770 20 20 3b 44 69 73 70 6c 61 79 20 62 75 66 66 65 | ;Display buffe| 00000780 72 0a 0a 0a 3b 0a 20 20 20 20 20 20 20 20 20 20 |r...;. | 00000790 20 20 20 20 6f 72 67 20 20 20 20 30 0a 30 30 30 | org 0.000| 000007a0 30 20 20 20 32 38 34 36 20 20 20 67 6f 74 6f 20 |0 2846 goto | 000007b0 20 20 53 74 61 72 74 20 20 20 20 20 20 20 20 20 | Start | 000007c0 20 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | . | 000007d0 6f 72 67 20 20 20 20 34 0a 30 30 30 34 20 20 20 |org 4.0004 | 000007e0 30 30 39 35 20 20 20 6d 6f 76 77 66 20 20 73 61 |0095 movwf sa| 000007f0 76 65 5f 77 20 20 20 20 20 20 20 20 20 3b 73 61 |ve_w ;sa| 00000800 76 65 20 77 20 61 6e 64 20 73 20 72 65 67 73 0a |ve w and s regs.| 00000810 30 30 30 35 20 20 20 30 45 30 33 20 20 20 73 77 |0005 0E03 sw| 00000820 61 70 66 20 20 53 54 41 54 55 53 2c 77 20 20 20 |apf STATUS,w | 00000830 20 20 20 20 3b 73 77 61 70 66 20 64 6f 65 73 6e | ;swapf doesn| 00000840 27 74 20 61 66 66 65 63 74 20 5a 20 6c 69 6b 65 |'t affect Z like| 00000850 20 6d 6f 76 66 0a 30 30 30 36 20 20 20 30 30 39 | movf.0006 009| 00000860 36 20 20 20 6d 6f 76 77 66 20 20 73 61 76 65 5f |6 movwf save_| 00000870 73 20 20 20 20 20 20 20 20 20 0a 30 30 30 37 20 |s .0007 | 00000880 20 20 30 38 30 36 20 20 20 6d 6f 76 66 20 20 20 | 0806 movf | 00000890 50 4f 52 54 42 2c 77 20 20 20 20 20 20 20 20 3b |PORTB,w ;| 000008a0 53 61 76 65 20 73 74 61 74 65 20 6f 66 20 4c 45 |Save state of LE| 000008b0 44 73 0a 30 30 30 38 20 20 20 30 30 39 37 20 20 |Ds.0008 0097 | 000008c0 20 6d 6f 76 77 66 20 20 73 61 76 65 5f 70 20 20 | movwf save_p | 000008d0 20 20 20 20 20 20 20 0a 30 30 30 39 20 20 20 30 | .0009 0| 000008e0 31 38 36 20 20 20 63 6c 72 66 20 20 20 50 4f 52 |186 clrf POR| 000008f0 54 42 20 20 20 20 20 20 20 20 20 20 3b 54 75 72 |TB ;Tur| 00000900 6e 20 4c 45 44 73 20 6f 66 66 0a 0a 30 30 30 41 |n LEDs off..000A| 00000910 20 20 20 32 30 31 35 20 20 20 63 61 6c 6c 20 20 | 2015 call | 00000920 20 52 78 20 20 20 20 20 20 20 20 20 20 20 20 20 | Rx | 00000930 3b 52 65 63 69 65 76 65 20 62 79 74 65 0a 0a 30 |;Recieve byte..0| 00000940 30 30 42 20 20 20 30 41 39 34 20 20 20 69 6e 63 |00B 0A94 inc| 00000950 66 20 20 20 43 6f 6d 32 2c 66 20 20 20 20 20 20 |f Com2,f | 00000960 20 20 20 3b 49 6e 63 72 65 6d 65 6e 74 20 74 68 | ;Increment th| 00000970 65 20 64 61 74 61 20 74 6f 20 70 75 74 20 69 6e |e data to put in| 00000980 0a 30 30 30 43 20 20 20 32 30 39 39 20 20 20 63 |.000C 2099 c| 00000990 61 6c 6c 20 20 20 73 6c 65 66 74 20 20 20 20 20 |all sleft | 000009a0 20 20 20 20 20 3b 53 63 72 6f 6c 6c 20 6c 65 66 | ;Scroll lef| 000009b0 74 20 63 6f 6d 6d 61 6e 64 0a 0a 6f 75 74 3a 0a |t command..out:.| 000009c0 0a 30 30 30 44 20 20 20 30 38 31 37 20 20 20 6d |.000D 0817 m| 000009d0 6f 76 66 20 20 20 73 61 76 65 5f 70 2c 77 20 20 |ovf save_p,w | 000009e0 20 20 20 20 20 0a 30 30 30 45 20 20 20 30 30 38 | .000E 008| 000009f0 36 20 20 20 6d 6f 76 77 66 20 20 50 4f 52 54 42 |6 movwf PORTB| 00000a00 20 20 20 20 20 20 20 20 20 20 3b 54 75 72 6e 20 | ;Turn | 00000a10 4c 45 44 73 20 62 61 63 6b 20 6f 6e 20 20 20 20 |LEDs back on | 00000a20 20 20 20 20 0a 30 30 30 46 20 20 20 30 45 31 36 | .000F 0E16| 00000a30 20 20 20 73 77 61 70 66 20 20 73 61 76 65 5f 73 | swapf save_s| 00000a40 2c 77 20 20 20 20 20 20 20 0a 30 30 31 30 20 20 |,w .0010 | 00000a50 20 30 30 38 33 20 20 20 6d 6f 76 77 66 20 20 53 | 0083 movwf S| 00000a60 54 41 54 55 53 20 20 20 20 20 20 20 20 20 3b 20 |TATUS ; | 00000a70 72 65 73 74 6f 72 65 20 72 65 67 69 73 74 65 72 |restore register| 00000a80 73 0a 30 30 31 31 20 20 20 30 45 39 35 20 20 20 |s.0011 0E95 | 00000a90 73 77 61 70 66 20 20 73 61 76 65 5f 77 2c 66 20 |swapf save_w,f | 00000aa0 20 20 20 20 20 20 0a 30 30 31 32 20 20 20 30 45 | .0012 0E| 00000ab0 31 35 20 20 20 73 77 61 70 66 20 20 73 61 76 65 |15 swapf save| 00000ac0 5f 77 2c 77 20 20 20 20 20 20 20 0a 30 30 31 33 |_w,w .0013| 00000ad0 20 20 20 31 30 38 42 20 20 20 62 63 66 20 20 20 | 108B bcf | 00000ae0 20 49 4e 54 43 4f 4e 2c 31 20 20 20 20 20 20 20 | INTCON,1 | 00000af0 3b 43 6c 65 61 72 20 65 64 67 65 20 69 6e 74 65 |;Clear edge inte| 00000b00 72 72 75 70 74 0a 30 30 31 34 20 20 20 30 30 30 |rrupt.0014 000| 00000b10 39 20 20 20 72 65 74 66 69 65 20 20 20 20 20 20 |9 retfie | 00000b20 20 20 20 20 20 20 20 20 20 20 0a 0a 0a 3b 52 65 | ...;Re| 00000b30 63 69 65 76 65 20 61 20 73 65 72 69 61 6c 20 62 |cieve a serial b| 00000b40 79 74 65 0a 52 78 3a 0a 0a 30 30 31 35 20 20 20 |yte.Rx:..0015 | 00000b50 33 30 30 38 20 20 20 6d 6f 76 6c 77 20 20 38 20 |3008 movlw 8 | 00000b60 20 20 20 20 20 20 20 20 20 20 20 20 20 3b 4e 75 | ;Nu| 00000b70 6d 62 65 72 20 6f 66 20 64 61 74 61 20 62 69 74 |mber of data bit| 00000b80 73 20 74 6f 20 67 65 74 0a 30 30 31 36 20 20 20 |s to get.0016 | 00000b90 30 30 38 44 20 20 20 6d 6f 76 77 66 20 20 53 63 |008D movwf Sc| 00000ba0 6f 75 6e 74 20 20 20 20 20 20 20 20 20 0a 53 62 |ount .Sb| 00000bb0 3a 0a 30 30 31 37 20 20 20 31 38 38 35 20 20 20 |:.0017 1885 | 00000bc0 62 74 66 73 63 20 20 50 4f 52 54 41 2c 31 20 20 |btfsc PORTA,1 | 00000bd0 20 20 20 20 20 20 3b 48 6f 6c 64 20 75 6e 74 69 | ;Hold unti| 00000be0 6c 20 73 74 61 72 74 20 62 69 74 0a 30 30 31 38 |l start bit.0018| 00000bf0 20 20 20 32 38 31 37 20 20 20 67 6f 74 6f 20 20 | 2817 goto | 00000c00 20 53 62 20 20 20 20 20 20 20 20 20 20 20 20 20 | Sb | 00000c10 0a 30 30 31 39 20 20 20 32 30 33 42 20 20 20 63 |.0019 203B c| 00000c20 61 6c 6c 20 20 20 68 44 65 6c 61 79 20 20 20 20 |all hDelay | 00000c30 20 20 20 20 20 3b 48 61 6c 66 20 61 20 62 61 75 | ;Half a bau| 00000c40 64 20 64 65 6c 61 79 0a 52 6e 62 3a 0a 30 30 31 |d delay.Rnb:.001| 00000c50 41 20 20 20 31 30 30 33 20 20 20 62 63 66 20 20 |A 1003 bcf | 00000c60 20 20 53 54 41 54 55 53 2c 43 20 20 20 20 20 20 | STATUS,C | 00000c70 20 3b 43 6c 65 61 72 20 74 68 65 20 63 61 72 72 | ;Clear the carr| 00000c80 79 20 62 69 74 0a 30 30 31 42 20 20 20 30 43 38 |y bit.001B 0C8| 00000c90 46 20 20 20 72 72 66 20 20 20 20 72 42 75 66 2c |F rrf rBuf,| 00000ca0 66 20 20 20 20 20 20 20 20 20 3b 50 72 65 70 61 |f ;Prepa| 00000cb0 72 65 20 66 6f 72 20 6e 65 78 74 20 62 69 74 20 |re for next bit | 00000cc0 20 0a 30 30 31 43 20 20 20 32 30 33 45 20 20 20 | .001C 203E | 00000cd0 63 61 6c 6c 20 20 20 72 44 65 6c 61 79 20 20 20 |call rDelay | 00000ce0 20 20 20 20 20 20 3b 46 75 6c 6c 20 62 61 75 64 | ;Full baud| 00000cf0 20 64 65 6c 61 79 20 66 6f 72 20 72 65 63 69 65 | delay for recie| 00000d00 76 65 0a 30 30 31 44 20 20 20 31 38 38 35 20 20 |ve.001D 1885 | 00000d10 20 62 74 66 73 63 20 20 50 4f 52 54 41 2c 31 20 | btfsc PORTA,1 | 00000d20 20 20 20 20 20 20 20 3b 54 65 73 74 20 69 6e 70 | ;Test inp| 00000d30 75 74 0a 30 30 31 45 20 20 20 31 37 38 46 20 20 |ut.001E 178F | 00000d40 20 62 73 66 20 20 20 20 72 42 75 66 2c 37 20 20 | bsf rBuf,7 | 00000d50 20 20 20 20 20 20 20 3b 53 65 74 20 69 66 20 6e | ;Set if n| 00000d60 65 65 64 65 64 0a 30 30 31 46 20 20 20 30 42 38 |eeded.001F 0B8| 00000d70 44 20 20 20 64 65 63 66 73 7a 20 53 63 6f 75 6e |D decfsz Scoun| 00000d80 74 2c 66 20 20 20 20 20 20 20 3b 53 65 65 20 69 |t,f ;See i| 00000d90 66 20 66 69 6e 69 73 68 65 64 0a 30 30 32 30 20 |f finished.0020 | 00000da0 20 20 32 38 31 41 20 20 20 67 6f 74 6f 20 20 20 | 281A goto | 00000db0 52 6e 62 20 20 20 20 20 20 20 20 20 20 20 20 3b |Rnb ;| 00000dc0 52 6f 75 6e 64 20 61 67 61 69 6e 20 69 66 20 6e |Round again if n| 00000dd0 6f 74 0a 30 30 32 31 20 20 20 32 30 33 45 20 20 |ot.0021 203E | 00000de0 20 63 61 6c 6c 20 20 20 72 44 65 6c 61 79 20 20 | call rDelay | 00000df0 20 20 20 20 20 20 20 3b 41 6c 6c 6f 77 20 66 6f | ;Allow fo| 00000e00 72 20 73 74 6f 70 20 62 69 74 20 74 6f 20 73 74 |r stop bit to st| 00000e10 61 72 74 0a 30 30 32 32 20 20 20 30 38 30 46 20 |art.0022 080F | 00000e20 20 20 6d 6f 76 66 20 20 20 72 42 75 66 2c 77 20 | movf rBuf,w | 00000e30 20 20 20 20 20 20 20 20 3b 50 75 74 20 72 65 63 | ;Put rec| 00000e40 69 65 76 65 64 20 63 68 72 61 63 74 6f 72 20 69 |ieved chractor i| 00000e50 6e 74 6f 20 57 0a 30 30 32 33 20 20 20 30 30 30 |nto W.0023 000| 00000e60 38 20 20 20 72 65 74 75 72 6e 20 20 20 20 20 20 |8 return | 00000e70 20 20 20 20 20 20 20 20 20 20 0a 0a 0a 3b 53 65 | ...;Se| 00000e80 6e 64 20 61 20 73 65 72 69 61 6c 20 62 79 74 65 |nd a serial byte| 00000e90 0a 53 65 6e 64 3a 0a 0a 30 30 32 34 20 20 20 31 |.Send:..0024 1| 00000ea0 39 38 35 20 20 20 62 74 66 73 63 20 20 50 4f 52 |985 btfsc POR| 00000eb0 54 41 2c 72 74 73 20 20 20 20 20 20 3b 4f 6e 6c |TA,rts ;Onl| 00000ec0 79 20 70 72 6f 63 65 65 64 20 77 68 65 6e 20 72 |y proceed when r| 00000ed0 74 73 20 69 73 20 6c 6f 77 0a 30 30 32 35 20 20 |ts is low.0025 | 00000ee0 20 32 38 32 34 20 20 20 67 6f 74 6f 20 20 20 53 | 2824 goto S| 00000ef0 65 6e 64 20 20 20 20 20 20 20 20 20 20 20 0a 30 |end .0| 00000f00 30 32 36 20 20 20 33 30 30 39 20 20 20 6d 6f 76 |026 3009 mov| 00000f10 6c 77 20 20 39 20 20 20 20 20 20 20 20 20 20 20 |lw 9 | 00000f20 20 20 20 3b 4e 75 6d 62 65 72 20 6f 66 20 64 61 | ;Number of da| 00000f30 74 61 20 62 69 74 73 20 74 6f 20 73 65 6e 64 0a |ta bits to send.| 00000f40 30 30 32 37 20 20 20 30 30 38 44 20 20 20 6d 6f |0027 008D mo| 00000f50 76 77 66 20 20 53 63 6f 75 6e 74 20 20 20 20 20 |vwf Scount | 00000f60 20 20 20 20 0a 30 30 32 38 20 20 20 31 30 30 35 | .0028 1005| 00000f70 20 20 20 62 63 66 20 20 20 20 50 4f 52 54 41 2c | bcf PORTA,| 00000f80 30 20 20 20 20 20 20 20 20 3b 53 74 61 72 74 20 |0 ;Start | 00000f90 62 69 74 0a 30 30 32 39 20 20 20 32 30 33 38 20 |bit.0029 2038 | 00000fa0 20 20 63 61 6c 6c 20 20 20 63 44 65 6c 61 79 20 | call cDelay | 00000fb0 20 20 20 20 20 20 20 20 3b 45 78 74 72 61 20 64 | ;Extra d| 00000fc0 65 6c 61 79 20 63 6f 6d 70 65 6e 73 61 74 69 6f |elay compensatio| 00000fd0 6e 0a 53 6c 6f 6f 70 3a 0a 30 30 32 41 20 20 20 |n.Sloop:.002A | 00000fe0 32 30 34 31 20 20 20 63 61 6c 6c 20 20 20 44 65 |2041 call De| 00000ff0 6c 61 79 20 20 20 20 20 20 20 20 20 20 0a 30 30 |lay .00| 00001000 32 42 20 20 20 31 38 30 43 20 20 20 62 74 66 73 |2B 180C btfs| 00001010 63 20 20 73 42 75 66 2c 30 20 20 20 20 20 20 20 |c sBuf,0 | 00001020 20 20 3b 53 65 74 20 74 68 65 20 6e 65 78 74 20 | ;Set the next | 00001030 62 69 74 0a 30 30 32 43 20 20 20 31 34 30 35 20 |bit.002C 1405 | 00001040 20 20 62 73 66 20 20 20 20 50 4f 52 54 41 2c 30 | bsf PORTA,0| 00001050 20 20 20 20 20 20 20 20 0a 30 30 32 44 20 20 20 | .002D | 00001060 31 43 30 43 20 20 20 62 74 66 73 73 20 20 73 42 |1C0C btfss sB| 00001070 75 66 2c 30 20 20 20 20 20 20 20 20 20 0a 30 30 |uf,0 .00| 00001080 32 45 20 20 20 31 30 30 35 20 20 20 62 63 66 20 |2E 1005 bcf | 00001090 20 20 20 50 4f 52 54 41 2c 30 20 20 20 20 20 20 | PORTA,0 | 000010a0 20 20 0a 30 30 32 46 20 20 20 30 43 38 43 20 20 | .002F 0C8C | 000010b0 20 72 72 66 20 20 20 20 73 42 75 66 2c 66 20 20 | rrf sBuf,f | 000010c0 20 20 20 20 20 20 20 3b 53 68 69 66 74 20 66 6f | ;Shift fo| 000010d0 72 20 6e 65 78 74 20 74 69 6d 65 0a 30 30 33 30 |r next time.0030| 000010e0 20 20 20 30 42 38 44 20 20 20 64 65 63 66 73 7a | 0B8D decfsz| 000010f0 20 53 63 6f 75 6e 74 2c 66 20 20 20 20 20 20 20 | Scount,f | 00001100 0a 30 30 33 31 20 20 20 32 38 32 41 20 20 20 67 |.0031 282A g| 00001110 6f 74 6f 20 20 20 53 6c 6f 6f 70 20 20 20 20 20 |oto Sloop | 00001120 20 20 20 20 20 3b 52 6f 75 6e 64 20 75 6e 74 69 | ;Round unti| 00001130 6c 20 66 69 6e 69 73 68 65 64 0a 30 30 33 32 20 |l finished.0032 | 00001140 20 20 31 34 30 35 20 20 20 62 73 66 20 20 20 20 | 1405 bsf | 00001150 50 4f 52 54 41 2c 30 20 20 20 20 20 20 20 20 3b |PORTA,0 ;| 00001160 53 74 6f 70 20 62 69 74 0a 30 30 33 33 20 20 20 |Stop bit.0033 | 00001170 32 30 33 38 20 20 20 63 61 6c 6c 20 20 20 63 44 |2038 call cD| 00001180 65 6c 61 79 20 20 20 20 20 20 20 20 20 3b 45 78 |elay ;Ex| 00001190 74 72 61 20 64 65 6c 61 79 20 63 6f 6d 70 65 6e |tra delay compen| 000011a0 73 61 74 69 6f 6e 0a 30 30 33 34 20 20 20 32 30 |sation.0034 20| 000011b0 34 31 20 20 20 63 61 6c 6c 20 20 20 44 65 6c 61 |41 call Dela| 000011c0 79 20 20 20 20 20 20 20 20 20 20 0a 30 30 33 35 |y .0035| 000011d0 20 20 20 32 30 34 31 20 20 20 63 61 6c 6c 20 20 | 2041 call | 000011e0 20 44 65 6c 61 79 20 20 20 20 20 20 20 20 20 20 | Delay | 000011f0 0a 30 30 33 36 20 20 20 32 30 33 38 20 20 20 63 |.0036 2038 c| 00001200 61 6c 6c 20 20 20 63 44 65 6c 61 79 20 20 20 20 |all cDelay | 00001210 20 20 20 20 20 3b 46 6f 72 20 67 6f 6f 64 20 6d | ;For good m| 00001220 65 61 73 75 72 65 0a 30 30 33 37 20 20 20 30 30 |easure.0037 00| 00001230 30 38 20 20 20 72 65 74 75 72 6e 20 20 20 20 20 |08 return | 00001240 20 20 20 20 20 20 20 20 20 20 20 0a 0a 63 44 65 | ..cDe| 00001250 6c 61 79 3a 0a 0a 30 30 33 38 20 20 20 33 30 30 |lay:..0038 300| 00001260 32 20 20 20 6d 6f 76 6c 77 20 20 32 20 20 20 20 |2 movlw 2 | 00001270 20 20 20 20 20 20 20 20 20 20 3b 53 6d 61 6c 6c | ;Small| 00001280 20 64 65 6c 61 79 20 61 74 20 65 6e 64 20 6f 66 | delay at end of| 00001290 20 73 65 6e 64 0a 30 30 33 39 20 20 20 30 30 38 | send.0039 008| 000012a0 45 20 20 20 6d 6f 76 77 66 20 20 43 64 6f 77 6e |E movwf Cdown| 000012b0 20 20 20 20 20 20 20 20 20 20 0a 30 30 33 41 20 | .003A | 000012c0 20 20 32 38 34 33 20 20 20 67 6f 74 6f 20 20 20 | 2843 goto | 000012d0 44 6c 6f 6f 70 20 20 20 20 20 20 20 20 20 20 0a |Dloop .| 000012e0 0a 68 44 65 6c 61 79 3a 0a 0a 30 30 33 42 20 20 |.hDelay:..003B | 000012f0 20 33 30 31 35 20 20 20 6d 6f 76 6c 77 20 20 32 | 3015 movlw 2| 00001300 31 20 20 20 20 20 20 20 20 20 20 20 20 20 3b 68 |1 ;h| 00001310 61 6c 66 20 64 65 6c 61 79 20 66 6f 72 20 73 65 |alf delay for se| 00001320 72 69 61 6c 20 72 65 63 69 65 76 65 20 31 30 4d |rial recieve 10M| 00001330 48 7a 20 63 6c 6f 63 6b 0a 30 30 33 43 20 20 20 |Hz clock.003C | 00001340 30 30 38 45 20 20 20 6d 6f 76 77 66 20 20 43 64 |008E movwf Cd| 00001350 6f 77 6e 20 20 20 20 20 20 20 20 20 20 3b 20 31 |own ; 1| 00001360 39 2c 32 30 30 20 42 61 75 64 20 72 61 74 65 0a |9,200 Baud rate.| 00001370 30 30 33 44 20 20 20 32 38 34 33 20 20 20 67 6f |003D 2843 go| 00001380 74 6f 20 20 20 44 6c 6f 6f 70 20 20 20 20 20 20 |to Dloop | 00001390 20 20 20 20 0a 0a 72 44 65 6c 61 79 3a 0a 0a 30 | ..rDelay:..0| 000013a0 30 33 45 20 20 20 33 30 32 36 20 20 20 6d 6f 76 |03E 3026 mov| 000013b0 6c 77 20 20 33 38 20 20 20 20 20 20 20 20 20 20 |lw 38 | 000013c0 20 20 20 3b 44 65 6c 61 79 20 66 6f 72 20 73 65 | ;Delay for se| 000013d0 72 69 61 6c 20 72 65 63 69 65 76 65 20 31 30 4d |rial recieve 10M| 000013e0 48 7a 20 63 6c 6f 63 6b 0a 30 30 33 46 20 20 20 |Hz clock.003F | 000013f0 30 30 38 45 20 20 20 6d 6f 76 77 66 20 20 43 64 |008E movwf Cd| 00001400 6f 77 6e 20 20 20 20 20 20 20 20 20 20 3b 20 31 |own ; 1| 00001410 39 2c 32 30 30 20 42 61 75 64 20 72 61 74 65 0a |9,200 Baud rate.| 00001420 30 30 34 30 20 20 20 32 38 34 33 20 20 20 67 6f |0040 2843 go| 00001430 74 6f 20 20 20 44 6c 6f 6f 70 20 20 20 20 20 20 |to Dloop | 00001440 20 20 20 20 0a 0a 44 65 6c 61 79 3a 0a 0a 30 30 | ..Delay:..00| 00001450 34 31 20 20 20 33 30 32 37 20 20 20 6d 6f 76 6c |41 3027 movl| 00001460 77 20 20 33 39 20 20 20 20 20 20 20 20 20 20 20 |w 39 | 00001470 20 20 3b 44 65 6c 61 79 20 66 6f 72 20 73 65 72 | ;Delay for ser| 00001480 69 61 6c 20 73 65 6e 64 20 31 30 4d 48 7a 20 63 |ial send 10MHz c| 00001490 6c 6f 63 6b 0a 30 30 34 32 20 20 20 30 30 38 45 |lock.0042 008E| 000014a0 20 20 20 6d 6f 76 77 66 20 20 43 64 6f 77 6e 20 | movwf Cdown | 000014b0 20 20 20 20 20 20 20 20 20 3b 20 31 39 2c 32 30 | ; 19,20| 000014c0 30 20 42 61 75 64 20 72 61 74 65 0a 44 6c 6f 6f |0 Baud rate.Dloo| 000014d0 70 3a 0a 30 30 34 33 20 20 20 30 42 38 45 20 20 |p:.0043 0B8E | 000014e0 20 64 65 63 66 73 7a 20 43 64 6f 77 6e 2c 66 20 | decfsz Cdown,f | 000014f0 20 20 20 20 20 20 20 0a 30 30 34 34 20 20 20 32 | .0044 2| 00001500 38 34 33 20 20 20 67 6f 74 6f 20 20 20 44 6c 6f |843 goto Dlo| 00001510 6f 70 20 20 20 20 20 20 20 20 20 20 0a 30 30 34 |op .004| 00001520 35 20 20 20 30 30 30 38 20 20 20 72 65 74 75 72 |5 0008 retur| 00001530 6e 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |n | 00001540 20 0a 0a 0a 53 74 61 72 74 3a 0a 0a 30 30 34 36 | ...Start:..0046| 00001550 20 20 20 31 36 38 33 20 20 20 62 73 66 20 20 20 | 1683 bsf | 00001560 20 53 54 41 54 55 53 2c 52 50 30 20 20 20 20 20 | STATUS,RP0 | 00001570 3b 53 45 4c 45 43 54 20 52 45 47 49 53 54 45 52 |;SELECT REGISTER| 00001580 20 42 41 4e 4b 20 31 0a 30 30 34 37 20 20 20 33 | BANK 1.0047 3| 00001590 30 31 41 20 20 20 6d 6f 76 6c 77 20 20 31 41 68 |01A movlw 1Ah| 000015a0 20 20 20 20 20 20 20 20 20 20 20 20 3b 42 69 74 | ;Bit| 000015b0 73 20 34 2c 33 20 26 20 32 20 69 6e 70 75 74 73 |s 4,3 & 2 inputs| 000015c0 0a 30 30 34 38 20 20 20 30 30 38 35 20 20 20 6d |.0048 0085 m| 000015d0 6f 76 77 66 20 20 54 52 49 53 41 5e 38 30 48 20 |ovwf TRISA^80H | 000015e0 20 20 20 20 20 0a 30 30 34 39 20 20 20 33 30 30 | .0049 300| 000015f0 31 20 20 20 6d 6f 76 6c 77 20 20 31 20 20 20 20 |1 movlw 1 | 00001600 20 20 20 20 20 20 20 20 20 20 3b 42 69 74 20 30 | ;Bit 0| 00001610 20 69 6e 70 75 74 20 72 65 73 74 20 6f 75 74 70 | input rest outp| 00001620 75 74 73 0a 30 30 34 41 20 20 20 30 30 38 36 20 |uts.004A 0086 | 00001630 20 20 6d 6f 76 77 66 20 20 54 52 49 53 42 5e 38 | movwf TRISB^8| 00001640 30 48 20 20 20 20 20 20 0a 30 30 34 42 20 20 20 |0H .004B | 00001650 33 30 30 33 20 20 20 6d 6f 76 6c 77 20 20 33 20 |3003 movlw 3 | 00001660 20 20 20 20 20 20 20 20 20 20 20 20 20 3b 31 36 | ;16| 00001670 20 70 72 65 73 63 61 6c 65 72 20 2d 76 65 20 65 | prescaler -ve e| 00001680 64 67 65 20 69 6e 74 65 72 72 75 70 74 0a 30 30 |dge interrupt.00| 00001690 34 43 20 20 20 30 30 38 31 20 20 20 6d 6f 76 77 |4C 0081 movw| 000016a0 66 20 20 31 20 20 20 20 20 20 20 20 20 20 20 20 |f 1 | 000016b0 20 20 3b 4f 70 74 69 6f 6e 20 72 65 67 69 73 74 | ;Option regist| 000016c0 65 72 0a 30 30 34 44 20 20 20 33 30 39 30 20 20 |er.004D 3090 | 000016d0 20 6d 6f 76 6c 77 20 20 39 30 48 20 20 20 20 20 | movlw 90H | 000016e0 20 20 20 20 20 20 20 3b 45 6e 61 62 6c 65 20 62 | ;Enable b| 000016f0 69 74 20 30 20 69 6e 74 65 72 72 75 70 74 0a 30 |it 0 interrupt.0| 00001700 30 34 45 20 20 20 30 30 38 42 20 20 20 6d 6f 76 |04E 008B mov| 00001710 77 66 20 20 49 4e 54 43 4f 4e 20 20 20 20 20 20 |wf INTCON | 00001720 20 20 20 0a 0a 30 30 34 46 20 20 20 31 32 38 33 | ..004F 1283| 00001730 20 20 20 62 63 66 20 20 20 20 53 54 41 54 55 53 | bcf STATUS| 00001740 2c 52 50 30 20 20 20 20 20 3b 53 45 4c 45 43 54 |,RP0 ;SELECT| 00001750 20 52 45 47 49 53 54 45 52 20 42 41 4e 4b 20 30 | REGISTER BANK 0| 00001760 0a 0a 0a 30 30 35 30 20 20 20 31 34 30 35 20 20 |...0050 1405 | 00001770 20 62 73 66 20 20 20 20 50 4f 52 54 41 2c 30 20 | bsf PORTA,0 | 00001780 20 20 20 20 20 20 20 3b 53 65 72 69 61 6c 20 61 | ;Serial a| 00001790 74 20 4d 61 72 6b 0a 0a 30 30 35 31 20 20 20 31 |t Mark..0051 1| 000017a0 31 30 35 20 20 20 62 63 66 20 20 20 20 50 4f 52 |105 bcf POR| 000017b0 54 41 2c 63 74 73 20 20 20 20 20 20 3b 43 54 53 |TA,cts ;CTS| 000017c0 20 65 6e 61 62 6c 65 64 0a 30 30 35 32 20 20 20 | enabled.0052 | 000017d0 30 31 38 36 20 20 20 63 6c 72 66 20 20 20 50 4f |0186 clrf PO| 000017e0 52 54 42 20 20 20 20 20 20 20 20 20 20 0a 30 30 |RTB .00| 000017f0 35 33 20 20 20 30 31 39 30 20 20 20 63 6c 72 66 |53 0190 clrf| 00001800 20 20 20 53 63 61 6e 4e 6f 20 20 20 20 20 20 20 | ScanNo | 00001810 20 20 0a 30 30 35 34 20 20 20 30 31 39 34 20 20 | .0054 0194 | 00001820 20 63 6c 72 66 20 20 20 43 6f 6d 32 20 20 20 20 | clrf Com2 | 00001830 20 20 20 20 20 20 20 0a 0a 3b 4a 75 73 74 20 70 | ..;Just p| 00001840 75 74 20 73 6f 6d 65 20 74 65 73 74 20 64 61 74 |ut some test dat| 00001850 61 20 69 6e 74 6f 20 73 6f 6d 65 20 6d 65 6d 6f |a into some memo| 00001860 72 79 0a 30 30 35 35 20 20 20 33 30 41 41 20 20 |ry.0055 30AA | 00001870 20 6d 6f 76 6c 77 20 20 30 41 41 68 20 20 20 20 | movlw 0AAh | 00001880 20 20 20 20 20 20 20 0a 30 30 35 36 20 20 20 30 | .0056 0| 00001890 30 39 41 20 20 20 6d 6f 76 77 66 20 20 44 69 73 |09A movwf Dis| 000018a0 42 75 66 20 20 20 20 20 20 20 20 20 0a 30 30 35 |Buf .005| 000018b0 37 20 20 20 30 30 39 42 20 20 20 6d 6f 76 77 66 |7 009B movwf| 000018c0 20 20 44 69 73 42 75 66 21 31 20 20 20 20 20 20 | DisBuf!1 | 000018d0 20 0a 30 30 35 38 20 20 20 30 30 39 43 20 20 20 | .0058 009C | 000018e0 6d 6f 76 77 66 20 20 44 69 73 42 75 66 21 32 20 |movwf DisBuf!2 | 000018f0 20 20 20 20 20 20 0a 0a 30 30 35 39 20 20 20 30 | ..0059 0| 00001900 30 41 30 20 20 20 6d 6f 76 77 66 20 20 44 69 73 |0A0 movwf Dis| 00001910 42 75 66 21 36 20 20 20 20 20 20 20 0a 30 30 35 |Buf!6 .005| 00001920 41 20 20 20 30 30 41 31 20 20 20 6d 6f 76 77 66 |A 00A1 movwf| 00001930 20 20 44 69 73 42 75 66 21 37 20 20 20 20 20 20 | DisBuf!7 | 00001940 20 0a 30 30 35 42 20 20 20 30 30 41 32 20 20 20 | .005B 00A2 | 00001950 6d 6f 76 77 66 20 20 44 69 73 42 75 66 21 38 20 |movwf DisBuf!8 | 00001960 20 20 20 20 20 20 0a 0a 30 30 35 43 20 20 20 30 | ..005C 0| 00001970 30 41 36 20 20 20 6d 6f 76 77 66 20 20 44 69 73 |0A6 movwf Dis| 00001980 42 75 66 21 31 32 20 20 20 20 20 20 0a 30 30 35 |Buf!12 .005| 00001990 44 20 20 20 30 30 41 37 20 20 20 6d 6f 76 77 66 |D 00A7 movwf| 000019a0 20 20 44 69 73 42 75 66 21 31 33 20 20 20 20 20 | DisBuf!13 | 000019b0 20 0a 30 30 35 45 20 20 20 30 30 41 38 20 20 20 | .005E 00A8 | 000019c0 6d 6f 76 77 66 20 20 44 69 73 42 75 66 21 31 34 |movwf DisBuf!14| 000019d0 20 20 20 20 20 20 0a 0a 30 30 35 46 20 20 20 30 | ..005F 0| 000019e0 30 41 43 20 20 20 6d 6f 76 77 66 20 20 44 69 73 |0AC movwf Dis| 000019f0 42 75 66 21 31 38 20 20 20 20 20 20 0a 30 30 36 |Buf!18 .006| 00001a00 30 20 20 20 30 30 41 44 20 20 20 6d 6f 76 77 66 |0 00AD movwf| 00001a10 20 20 44 69 73 42 75 66 21 31 39 20 20 20 20 20 | DisBuf!19 | 00001a20 20 0a 30 30 36 31 20 20 20 30 30 41 45 20 20 20 | .0061 00AE | 00001a30 6d 6f 76 77 66 20 20 44 69 73 42 75 66 21 32 30 |movwf DisBuf!20| 00001a40 20 20 20 20 20 20 0a 0a 30 30 36 32 20 20 20 33 | ..0062 3| 00001a50 30 35 35 20 20 20 6d 6f 76 6c 77 20 20 30 35 35 |055 movlw 055| 00001a60 68 20 20 20 20 20 20 20 20 20 20 20 0a 30 30 36 |h .006| 00001a70 33 20 20 20 30 30 39 44 20 20 20 6d 6f 76 77 66 |3 009D movwf| 00001a80 20 20 44 69 73 42 75 66 21 33 20 20 20 20 20 20 | DisBuf!3 | 00001a90 20 0a 30 30 36 34 20 20 20 30 30 39 45 20 20 20 | .0064 009E | 00001aa0 6d 6f 76 77 66 20 20 44 69 73 42 75 66 21 34 20 |movwf DisBuf!4 | 00001ab0 20 20 20 20 20 20 0a 30 30 36 35 20 20 20 30 30 | .0065 00| 00001ac0 39 46 20 20 20 6d 6f 76 77 66 20 20 44 69 73 42 |9F movwf DisB| 00001ad0 75 66 21 35 20 20 20 20 20 20 20 0a 0a 30 30 36 |uf!5 ..006| 00001ae0 36 20 20 20 30 30 41 33 20 20 20 6d 6f 76 77 66 |6 00A3 movwf| 00001af0 20 20 44 69 73 42 75 66 21 39 20 20 20 20 20 20 | DisBuf!9 | 00001b00 20 0a 30 30 36 37 20 20 20 30 30 41 34 20 20 20 | .0067 00A4 | 00001b10 6d 6f 76 77 66 20 20 44 69 73 42 75 66 21 31 30 |movwf DisBuf!10| 00001b20 20 20 20 20 20 20 0a 30 30 36 38 20 20 20 30 30 | .0068 00| 00001b30 41 35 20 20 20 6d 6f 76 77 66 20 20 44 69 73 42 |A5 movwf DisB| 00001b40 75 66 21 31 31 20 20 20 20 20 20 0a 0a 30 30 36 |uf!11 ..006| 00001b50 39 20 20 20 30 30 41 39 20 20 20 6d 6f 76 77 66 |9 00A9 movwf| 00001b60 20 20 44 69 73 42 75 66 21 31 35 20 20 20 20 20 | DisBuf!15 | 00001b70 20 0a 30 30 36 41 20 20 20 30 30 41 41 20 20 20 | .006A 00AA | 00001b80 6d 6f 76 77 66 20 20 44 69 73 42 75 66 21 31 36 |movwf DisBuf!16| 00001b90 20 20 20 20 20 20 0a 30 30 36 42 20 20 20 30 30 | .006B 00| 00001ba0 41 42 20 20 20 6d 6f 76 77 66 20 20 44 69 73 42 |AB movwf DisB| 00001bb0 75 66 21 31 37 20 20 20 20 20 20 0a 0a 4d 61 69 |uf!17 ..Mai| 00001bc0 6e 3a 0a 0a 30 30 36 43 20 20 20 31 44 30 42 20 |n:..006C 1D0B | 00001bd0 20 20 62 74 66 73 73 20 20 30 62 68 2c 32 20 20 | btfss 0bh,2 | 00001be0 20 20 20 20 20 20 20 20 3b 54 65 73 74 20 74 69 | ;Test ti| 00001bf0 6d 65 72 0a 30 30 36 44 20 20 20 32 38 36 43 20 |mer.006D 286C | 00001c00 20 20 67 6f 74 6f 20 20 20 4d 61 69 6e 20 20 20 | goto Main | 00001c10 20 20 20 20 20 20 20 20 3b 4c 6f 6f 70 20 75 6e | ;Loop un| 00001c20 74 69 6c 20 74 69 6d 65 0a 30 30 36 45 20 20 20 |til time.006E | 00001c30 31 31 30 42 20 20 20 62 63 66 20 20 20 20 30 62 |110B bcf 0b| 00001c40 68 2c 32 20 20 20 20 20 20 20 20 20 20 3b 43 6c |h,2 ;Cl| 00001c50 65 61 72 20 69 74 20 66 6f 72 20 6e 65 78 74 20 |ear it for next | 00001c60 74 69 6d 65 0a 30 30 36 46 20 20 20 30 41 39 30 |time.006F 0A90| 00001c70 20 20 20 69 6e 63 66 20 20 20 53 63 61 6e 4e 6f | incf ScanNo| 00001c80 2c 66 20 20 20 20 20 20 20 0a 30 30 37 30 20 20 |,f .0070 | 00001c90 20 33 30 30 37 20 20 20 6d 6f 76 6c 77 20 20 37 | 3007 movlw 7| 00001ca0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3b 53 | ;S| 00001cb0 65 65 20 69 66 20 69 74 20 69 73 20 61 74 20 65 |ee if it is at e| 00001cc0 6e 64 0a 30 30 37 31 20 20 20 30 32 31 30 20 20 |nd.0071 0210 | 00001cd0 20 73 75 62 77 66 20 20 53 63 61 6e 4e 6f 2c 77 | subwf ScanNo,w| 00001ce0 20 20 20 20 20 20 20 0a 30 30 37 32 20 20 20 31 | .0072 1| 00001cf0 39 30 33 20 20 20 62 74 66 73 63 20 20 53 54 41 |903 btfsc STA| 00001d00 54 55 53 2c 5a 20 20 20 20 20 20 20 3b 57 72 61 |TUS,Z ;Wra| 00001d10 70 20 69 74 20 72 6f 75 6e 64 20 61 66 74 65 72 |p it round after| 00001d20 20 37 0a 30 30 37 33 20 20 20 30 31 39 30 20 20 | 7.0073 0190 | 00001d30 20 63 6c 72 66 20 20 20 53 63 61 6e 4e 6f 20 20 | clrf ScanNo | 00001d40 20 20 20 20 20 20 20 0a 30 30 37 34 20 20 20 32 | .0074 2| 00001d50 30 37 36 20 20 20 63 61 6c 6c 20 20 20 73 63 61 |076 call sca| 00001d60 6e 20 20 20 20 20 20 20 20 20 20 20 0a 30 30 37 |n .007| 00001d70 35 20 20 20 32 38 36 43 20 20 20 67 6f 74 6f 20 |5 286C goto | 00001d80 20 20 4d 61 69 6e 20 20 20 20 20 20 20 20 20 20 | Main | 00001d90 20 0a 0a 73 63 61 6e 3a 0a 0a 30 30 37 36 20 20 | ..scan:..0076 | 00001da0 20 30 31 38 36 20 20 20 63 6c 72 66 20 20 20 50 | 0186 clrf P| 00001db0 4f 52 54 42 20 20 20 20 20 20 20 20 20 20 3b 20 |ORTB ; | 00001dc0 42 6c 61 6e 6b 20 6f 75 74 20 72 6f 77 0a 30 30 |Blank out row.00| 00001dd0 37 37 20 20 20 31 30 30 33 20 20 20 62 63 66 20 |77 1003 bcf | 00001de0 20 20 20 53 54 41 54 55 53 2c 43 20 20 20 20 20 | STATUS,C | 00001df0 20 20 0a 30 30 37 38 20 20 20 30 44 31 30 20 20 | .0078 0D10 | 00001e00 20 72 6c 66 20 20 20 20 53 63 61 6e 4e 6f 2c 77 | rlf ScanNo,w| 00001e10 20 20 20 20 20 20 20 3b 53 63 61 6e 20 4e 6f 20 | ;Scan No | 00001e20 2a 20 33 20 2b 20 44 69 73 42 75 66 20 3d 20 72 |* 3 + DisBuf = r| 00001e30 65 67 20 61 64 64 72 65 73 73 0a 30 30 37 39 20 |eg address.0079 | 00001e40 20 20 30 37 31 30 20 20 20 61 64 64 77 66 20 20 | 0710 addwf | 00001e50 53 63 61 6e 4e 6f 2c 77 20 20 20 20 20 20 20 0a |ScanNo,w .| 00001e60 30 30 37 41 20 20 20 33 45 31 41 20 20 20 61 64 |007A 3E1A ad| 00001e70 64 6c 77 20 20 44 69 73 42 75 66 20 20 20 20 20 |dlw DisBuf | 00001e80 20 20 20 20 0a 30 30 37 42 20 20 20 30 30 38 34 | .007B 0084| 00001e90 20 20 20 6d 6f 76 77 66 20 20 34 20 20 20 20 20 | movwf 4 | 00001ea0 20 20 20 20 20 20 20 20 20 3b 74 6f 20 69 6e 64 | ;to ind| 00001eb0 69 72 65 63 74 20 72 65 67 69 73 74 65 72 0a 30 |irect register.0| 00001ec0 30 37 43 20 20 20 32 30 38 43 20 20 20 63 61 6c |07C 208C cal| 00001ed0 6c 20 20 20 72 62 6f 75 74 20 20 20 20 20 20 20 |l rbout | 00001ee0 20 20 20 3b 4f 75 74 70 75 74 20 66 69 72 73 74 | ;Output first| 00001ef0 20 62 79 74 65 0a 30 30 37 44 20 20 20 30 41 38 | byte.007D 0A8| 00001f00 34 20 20 20 69 6e 63 66 20 20 20 34 2c 66 20 20 |4 incf 4,f | 00001f10 20 20 20 20 20 20 20 20 20 20 3b 4e 65 78 74 20 | ;Next | 00001f20 62 79 74 65 0a 30 30 37 45 20 20 20 32 30 38 43 |byte.007E 208C| 00001f30 20 20 20 63 61 6c 6c 20 20 20 72 62 6f 75 74 20 | call rbout | 00001f40 20 20 20 20 20 20 20 20 20 0a 30 30 37 46 20 20 | .007F | 00001f50 20 30 41 38 34 20 20 20 69 6e 63 66 20 20 20 34 | 0A84 incf 4| 00001f60 2c 66 20 20 20 20 20 20 20 20 20 20 20 20 3b 4c |,f ;L| 00001f70 61 73 74 20 62 79 74 65 0a 30 30 38 30 20 20 20 |ast byte.0080 | 00001f80 32 30 38 41 20 20 20 63 61 6c 6c 20 20 20 68 72 |208A call hr| 00001f90 6f 75 74 20 20 20 20 20 20 20 20 20 20 0a 30 30 |out .00| 00001fa0 38 31 20 20 20 30 38 31 30 20 20 20 6d 6f 76 66 |81 0810 movf| 00001fb0 20 20 20 53 63 61 6e 4e 6f 2c 77 20 20 20 20 20 | ScanNo,w | 00001fc0 20 20 0a 30 30 38 32 20 20 20 30 30 39 31 20 20 | .0082 0091 | 00001fd0 20 6d 6f 76 77 66 20 20 52 6f 77 43 20 20 20 20 | movwf RowC | 00001fe0 20 20 20 20 20 20 20 3b 52 6f 77 20 43 6f 75 6e | ;Row Coun| 00001ff0 74 0a 30 30 38 33 20 20 20 30 41 39 31 20 20 20 |t.0083 0A91 | 00002000 69 6e 63 66 20 20 20 52 6f 77 43 2c 66 20 20 20 |incf RowC,f | 00002010 20 20 20 20 20 20 3b 4f 6e 65 20 6d 6f 72 65 20 | ;One more | 00002020 70 75 6c 73 65 0a 30 30 38 34 20 20 20 31 30 30 |pulse.0084 100| 00002030 33 20 20 20 62 63 66 20 20 20 20 53 54 41 54 55 |3 bcf STATU| 00002040 53 2c 43 20 20 20 20 20 20 20 0a 30 30 38 35 20 |S,C .0085 | 00002050 20 20 30 44 39 31 20 20 20 72 6c 66 20 20 20 20 | 0D91 rlf | 00002060 52 6f 77 43 2c 66 20 20 20 20 20 20 20 20 20 0a |RowC,f .| 00002070 30 30 38 36 20 20 20 30 44 39 31 20 20 20 72 6c |0086 0D91 rl| 00002080 66 20 20 20 20 52 6f 77 43 2c 66 20 20 20 20 20 |f RowC,f | 00002090 20 20 20 20 0a 30 30 38 37 20 20 20 30 44 31 31 | .0087 0D11| 000020a0 20 20 20 72 6c 66 20 20 20 20 52 6f 77 43 2c 77 | rlf RowC,w| 000020b0 20 20 20 20 20 20 20 20 20 0a 30 30 38 38 20 20 | .0088 | 000020c0 20 30 30 38 36 20 20 20 6d 6f 76 77 66 20 20 50 | 0086 movwf P| 000020d0 4f 52 54 42 20 20 20 20 20 20 20 20 20 20 0a 30 |ORTB .0| 000020e0 30 38 39 20 20 20 30 30 30 38 20 20 20 72 65 74 |089 0008 ret| 000020f0 75 72 6e 20 20 20 20 20 20 20 20 20 20 20 20 20 |urn | 00002100 20 20 20 0a 0a 68 72 6f 75 74 3a 0a 0a 30 30 38 | ..hrout:..008| 00002110 41 20 20 20 33 30 30 34 20 20 20 6d 6f 76 6c 77 |A 3004 movlw| 00002120 20 20 34 20 20 20 20 20 20 20 20 20 20 20 20 20 | 4 | 00002130 20 3b 4f 6e 6c 79 20 34 20 62 69 74 73 20 6f 75 | ;Only 4 bits ou| 00002140 74 0a 30 30 38 42 20 20 20 32 38 38 44 20 20 20 |t.008B 288D | 00002150 67 6f 74 6f 20 20 20 68 65 20 20 20 20 20 20 20 |goto he | 00002160 20 20 20 20 20 20 0a 72 62 6f 75 74 3a 0a 30 30 | .rbout:.00| 00002170 38 43 20 20 20 33 30 30 38 20 20 20 6d 6f 76 6c |8C 3008 movl| 00002180 77 20 20 38 20 20 20 20 20 20 20 20 20 20 20 20 |w 8 | 00002190 20 20 3b 6e 75 6d 62 65 72 20 6f 66 20 73 68 69 | ;number of shi| 000021a0 66 74 73 20 74 6f 20 64 6f 0a 68 65 3a 0a 30 30 |fts to do.he:.00| 000021b0 38 44 20 20 20 30 30 39 31 20 20 20 6d 6f 76 77 |8D 0091 movw| 000021c0 66 20 20 52 6f 77 43 20 20 20 20 20 20 20 20 20 |f RowC | 000021d0 20 20 3b 73 68 69 66 74 20 73 74 6f 72 65 0a 30 | ;shift store.0| 000021e0 30 38 45 20 20 20 30 38 30 30 20 20 20 6d 6f 76 |08E 0800 mov| 000021f0 66 20 20 20 30 2c 77 20 20 20 20 20 20 20 20 20 |f 0,w | 00002200 20 20 20 3b 67 65 74 20 62 79 74 65 20 74 6f 20 | ;get byte to | 00002210 73 65 6e 64 0a 30 30 38 46 20 20 20 30 30 39 32 |send.008F 0092| 00002220 20 20 20 6d 6f 76 77 66 20 20 53 73 74 6f 72 65 | movwf Sstore| 00002230 20 20 20 20 20 20 20 20 20 3b 73 74 6f 72 65 20 | ;store | 00002240 69 74 0a 72 6c 6f 6f 70 3a 0a 30 30 39 30 20 20 |it.rloop:.0090 | 00002250 20 30 43 39 32 20 20 20 72 72 66 20 20 20 20 53 | 0C92 rrf S| 00002260 73 74 6f 72 65 2c 66 20 20 20 20 20 20 20 3b 67 |store,f ;g| 00002270 65 74 20 6e 65 78 74 20 62 69 74 20 69 6e 74 6f |et next bit into| 00002280 20 63 61 72 72 79 0a 30 30 39 31 20 20 20 31 30 | carry.0091 10| 00002290 38 36 20 20 20 62 63 66 20 20 20 20 50 4f 52 54 |86 bcf PORT| 000022a0 42 2c 63 64 61 74 20 20 20 20 20 3b 47 65 74 20 |B,cdat ;Get | 000022b0 64 61 74 61 20 6c 69 6e 65 20 72 69 67 68 74 0a |data line right.| 000022c0 30 30 39 32 20 20 20 31 38 30 33 20 20 20 62 74 |0092 1803 bt| 000022d0 66 73 63 20 20 53 54 41 54 55 53 2c 43 20 20 20 |fsc STATUS,C | 000022e0 20 20 20 20 0a 30 30 39 33 20 20 20 31 34 38 36 | .0093 1486| 000022f0 20 20 20 62 73 66 20 20 20 20 50 4f 52 54 42 2c | bsf PORTB,| 00002300 63 64 61 74 20 20 20 20 20 0a 30 30 39 34 20 20 |cdat .0094 | 00002310 20 31 35 30 36 20 20 20 62 73 66 20 20 20 20 50 | 1506 bsf P| 00002320 4f 52 54 42 2c 63 63 6b 20 20 20 20 20 20 3b 54 |ORTB,cck ;T| 00002330 6f 67 67 6c 65 20 63 6c 6f 63 6b 0a 30 30 39 35 |oggle clock.0095| 00002340 20 20 20 31 31 30 36 20 20 20 62 63 66 20 20 20 | 1106 bcf | 00002350 20 50 4f 52 54 42 2c 63 63 6b 20 20 20 20 20 20 | PORTB,cck | 00002360 0a 30 30 39 36 20 20 20 30 42 39 31 20 20 20 64 |.0096 0B91 d| 00002370 65 63 66 73 7a 20 52 6f 77 43 2c 66 20 20 20 20 |ecfsz RowC,f | 00002380 20 20 20 20 20 3b 41 6c 6c 20 62 69 74 73 20 64 | ;All bits d| 00002390 6f 6e 65 3f 0a 30 30 39 37 20 20 20 32 38 39 30 |one?.0097 2890| 000023a0 20 20 20 67 6f 74 6f 20 20 20 72 6c 6f 6f 70 20 | goto rloop | 000023b0 20 20 20 20 20 20 20 20 20 0a 30 30 39 38 20 20 | .0098 | 000023c0 20 30 30 30 38 20 20 20 72 65 74 75 72 6e 20 20 | 0008 return | 000023d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0a 0a | ..| 000023e0 3b 43 6f 6d 6d 61 6e 64 73 0a 0a 73 6c 65 66 74 |;Commands..sleft| 000023f0 3a 0a 0a 30 30 39 39 20 20 20 33 30 31 41 20 20 |:..0099 301A | 00002400 20 6d 6f 76 6c 77 20 20 44 69 73 42 75 66 20 20 | movlw DisBuf | 00002410 20 20 20 20 20 20 20 3b 53 63 72 6f 6c 6c 20 6d | ;Scroll m| 00002420 65 6d 6f 72 79 20 6c 65 66 74 0a 30 30 39 41 20 |emory left.009A | 00002430 20 20 30 30 38 34 20 20 20 6d 6f 76 77 66 20 20 | 0084 movwf | 00002440 34 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3b |4 ;| 00002450 69 6e 74 6f 20 69 6e 64 69 72 65 63 74 20 72 65 |into indirect re| 00002460 67 69 73 74 65 72 0a 30 30 39 42 20 20 20 33 30 |gister.009B 30| 00002470 30 37 20 20 20 6d 6f 76 6c 77 20 20 37 20 20 20 |07 movlw 7 | 00002480 20 20 20 20 20 20 20 20 20 20 20 3b 4e 75 6d 62 | ;Numb| 00002490 65 72 20 6f 66 20 72 6f 77 73 20 74 6f 20 73 63 |er of rows to sc| 000024a0 72 6f 6c 6c 0a 30 30 39 43 20 20 20 30 30 38 43 |roll.009C 008C| 000024b0 20 20 20 6d 6f 76 77 66 20 20 73 42 75 66 20 20 | movwf sBuf | 000024c0 20 20 20 20 20 20 20 20 20 3b 54 65 6d 70 20 73 | ;Temp s| 000024d0 74 6f 72 61 67 65 0a 30 30 39 44 20 20 20 31 30 |torage.009D 10| 000024e0 30 33 20 20 20 62 63 66 20 20 20 20 53 54 41 54 |03 bcf STAT| 000024f0 55 53 2c 43 20 20 20 20 20 20 20 0a 73 6c 6c 6f |US,C .sllo| 00002500 6f 70 3a 0a 30 30 39 45 20 20 20 30 44 38 30 20 |op:.009E 0D80 | 00002510 20 20 72 6c 66 20 20 20 20 30 2c 66 20 20 20 20 | rlf 0,f | 00002520 20 20 20 20 20 20 20 20 3b 4d 6f 76 65 20 66 69 | ;Move fi| 00002530 72 73 74 20 62 79 74 65 0a 30 30 39 46 20 20 20 |rst byte.009F | 00002540 30 41 38 34 20 20 20 69 6e 63 66 20 20 20 34 2c |0A84 incf 4,| 00002550 66 20 20 20 20 20 20 20 20 20 20 20 20 0a 30 30 |f .00| 00002560 41 30 20 20 20 30 44 38 30 20 20 20 72 6c 66 20 |A0 0D80 rlf | 00002570 20 20 20 30 2c 66 20 20 20 20 20 20 20 20 20 20 | 0,f | 00002580 20 20 3b 4d 6f 76 65 20 73 65 63 6f 6e 64 20 62 | ;Move second b| 00002590 79 74 65 0a 30 30 41 31 20 20 20 30 41 38 34 20 |yte.00A1 0A84 | 000025a0 20 20 69 6e 63 66 20 20 20 34 2c 66 20 20 20 20 | incf 4,f | 000025b0 20 20 20 20 20 20 20 20 0a 30 30 41 32 20 20 20 | .00A2 | 000025c0 30 44 38 30 20 20 20 72 6c 66 20 20 20 20 30 2c |0D80 rlf 0,| 000025d0 66 20 20 20 20 20 20 20 20 20 20 20 20 3b 4d 6f |f ;Mo| 000025e0 76 65 20 6c 61 73 74 20 62 79 74 65 0a 30 30 41 |ve last byte.00A| 000025f0 33 20 20 20 31 32 30 30 20 20 20 62 63 66 20 20 |3 1200 bcf | 00002600 20 20 30 2c 34 20 20 20 20 20 20 20 20 20 20 20 | 0,4 | 00002610 20 3b 42 6c 61 6e 6b 20 62 69 74 20 66 61 6c 6c | ;Blank bit fall| 00002620 65 6e 20 6f 66 66 20 74 68 65 20 65 6e 64 0a 30 |en off the end.0| 00002630 30 41 34 20 20 20 30 41 38 34 20 20 20 69 6e 63 |0A4 0A84 inc| 00002640 66 20 20 20 34 2c 66 20 20 20 20 20 20 20 20 20 |f 4,f | 00002650 20 20 20 3b 4d 6f 76 65 20 6f 6e 20 66 6f 72 20 | ;Move on for | 00002660 6e 65 78 74 20 74 69 6d 65 0a 30 30 41 35 20 20 |next time.00A5 | 00002670 20 30 42 38 43 20 20 20 64 65 63 66 73 7a 20 73 | 0B8C decfsz s| 00002680 42 75 66 2c 66 20 20 20 20 20 20 20 20 20 3b 4c |Buf,f ;L| 00002690 6f 6f 70 20 75 6e 74 69 6c 20 61 6c 6c 20 37 20 |oop until all 7 | 000026a0 72 6f 77 73 20 61 72 65 20 6f 75 74 0a 30 30 41 |rows are out.00A| 000026b0 36 20 20 20 32 38 39 45 20 20 20 67 6f 74 6f 20 |6 289E goto | 000026c0 20 20 73 6c 6c 6f 6f 70 20 20 20 20 20 20 20 20 | slloop | 000026d0 20 0a 30 30 41 37 20 20 20 31 38 31 34 20 20 20 | .00A7 1814 | 000026e0 62 74 66 73 63 20 20 43 6f 6d 32 2c 30 20 20 20 |btfsc Com2,0 | 000026f0 20 20 20 20 20 20 3b 4e 6f 77 20 70 75 74 20 6e | ;Now put n| 00002700 65 77 20 64 61 74 61 20 69 6e 0a 30 30 41 38 20 |ew data in.00A8 | 00002710 20 20 31 34 31 41 20 20 20 62 73 66 20 20 20 20 | 141A bsf | 00002720 44 69 73 42 75 66 2c 30 20 20 20 20 20 20 20 0a |DisBuf,0 .| 00002730 30 30 41 39 20 20 20 31 38 39 34 20 20 20 62 74 |00A9 1894 bt| 00002740 66 73 63 20 20 43 6f 6d 32 2c 31 20 20 20 20 20 |fsc Com2,1 | 00002750 20 20 20 20 0a 30 30 41 41 20 20 20 31 34 31 44 | .00AA 141D| 00002760 20 20 20 62 73 66 20 20 20 20 44 69 73 42 75 66 | bsf DisBuf| 00002770 21 33 2c 30 20 20 20 20 20 0a 30 30 41 42 20 20 |!3,0 .00AB | 00002780 20 31 39 31 34 20 20 20 62 74 66 73 63 20 20 43 | 1914 btfsc C| 00002790 6f 6d 32 2c 32 20 20 20 20 20 20 20 20 20 0a 30 |om2,2 .0| 000027a0 30 41 43 20 20 20 31 34 32 30 20 20 20 62 73 66 |0AC 1420 bsf| 000027b0 20 20 20 20 44 69 73 42 75 66 21 36 2c 30 20 20 | DisBuf!6,0 | 000027c0 20 20 20 0a 30 30 41 44 20 20 20 31 39 39 34 20 | .00AD 1994 | 000027d0 20 20 62 74 66 73 63 20 20 43 6f 6d 32 2c 33 20 | btfsc Com2,3 | 000027e0 20 20 20 20 20 20 20 20 0a 30 30 41 45 20 20 20 | .00AE | 000027f0 31 34 32 33 20 20 20 62 73 66 20 20 20 20 44 69 |1423 bsf Di| 00002800 73 42 75 66 21 39 2c 30 20 20 20 20 20 0a 30 30 |sBuf!9,0 .00| 00002810 41 46 20 20 20 31 41 31 34 20 20 20 62 74 66 73 |AF 1A14 btfs| 00002820 63 20 20 43 6f 6d 32 2c 34 20 20 20 20 20 20 20 |c Com2,4 | 00002830 20 20 0a 30 30 42 30 20 20 20 31 34 32 36 20 20 | .00B0 1426 | 00002840 20 62 73 66 20 20 20 20 44 69 73 42 75 66 21 31 | bsf DisBuf!1| 00002850 32 2c 30 20 20 20 20 0a 30 30 42 31 20 20 20 31 |2,0 .00B1 1| 00002860 41 39 34 20 20 20 62 74 66 73 63 20 20 43 6f 6d |A94 btfsc Com| 00002870 32 2c 35 20 20 20 20 20 20 20 20 20 0a 30 30 42 |2,5 .00B| 00002880 32 20 20 20 31 34 32 39 20 20 20 62 73 66 20 20 |2 1429 bsf | 00002890 20 20 44 69 73 42 75 66 21 31 35 2c 30 20 20 20 | DisBuf!15,0 | 000028a0 20 0a 30 30 42 33 20 20 20 31 42 31 34 20 20 20 | .00B3 1B14 | 000028b0 62 74 66 73 63 20 20 43 6f 6d 32 2c 36 20 20 20 |btfsc Com2,6 | 000028c0 20 20 20 20 20 20 0a 30 30 42 34 20 20 20 31 34 | .00B4 14| 000028d0 32 43 20 20 20 62 73 66 20 20 20 20 44 69 73 42 |2C bsf DisB| 000028e0 75 66 21 31 38 2c 30 20 20 20 20 0a 30 30 42 35 |uf!18,0 .00B5| 000028f0 20 20 20 30 30 30 38 20 20 20 72 65 74 75 72 6e | 0008 return| 00002900 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002910 0a 0a 65 6e 64 0a 0a 4d 65 6d 6f 72 79 20 55 73 |..end..Memory Us| 00002920 61 67 65 20 4d 61 70 20 28 27 58 27 20 3d 20 55 |age Map ('X' = U| 00002930 73 65 64 2c 20 27 2d 27 20 3d 20 55 6e 75 73 65 |sed, '-' = Unuse| 00002940 64 29 0a 0a 30 30 30 30 20 20 20 3a 20 58 2d 2d |d)..0000 : X--| 00002950 2d 58 58 58 58 58 58 58 58 58 58 58 58 20 58 58 |-XXXXXXXXXXXX XX| 00002960 58 58 58 58 58 58 58 58 58 58 58 58 58 58 20 58 |XXXXXXXXXXXXXX X| 00002970 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 20 |XXXXXXXXXXXXXXX | 00002980 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 |XXXXXXXXXXXXXXXX| 00002990 0a 30 30 34 30 20 20 20 3a 20 58 58 58 58 58 58 |.0040 : XXXXXX| 000029a0 58 58 58 58 58 58 58 58 58 58 20 58 58 58 58 58 |XXXXXXXXXX XXXXX| 000029b0 58 58 58 58 58 58 58 58 58 58 58 20 58 58 58 58 |XXXXXXXXXXX XXXX| 000029c0 58 58 58 58 58 58 58 58 58 58 58 58 20 58 58 58 |XXXXXXXXXXXX XXX| 000029d0 58 58 58 58 58 58 58 58 58 58 58 58 58 0a 30 30 |XXXXXXXXXXXXX.00| 000029e0 38 30 20 20 20 3a 20 58 58 58 58 58 58 58 58 58 |80 : XXXXXXXXX| 000029f0 58 58 58 58 58 58 58 20 58 58 58 58 58 58 58 58 |XXXXXXX XXXXXXXX| 00002a00 58 58 58 58 58 58 58 58 20 58 58 58 58 58 58 58 |XXXXXXXX XXXXXXX| 00002a10 58 58 58 58 58 58 58 58 58 20 58 58 58 58 58 58 |XXXXXXXXX XXXXXX| 00002a20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 35 34 20 4c |----------..54 L| 00002a30 61 62 6c 65 73 20 26 20 43 6f 6e 73 74 61 6e 74 |ables & Constant| 00002a40 73 3a 2d 0a 48 65 78 20 20 20 20 4e 61 6d 65 0a |s:-.Hex Name.| 00002a50 30 30 30 30 20 20 20 43 0a 30 30 30 32 20 20 20 |0000 C.0002 | 00002a60 50 43 4c 0a 30 30 30 32 20 20 20 5a 0a 30 30 30 |PCL.0002 Z.000| 00002a70 36 20 20 20 50 4f 52 54 42 0a 30 30 30 35 20 20 |6 PORTB.0005 | 00002a80 20 50 4f 52 54 41 0a 30 30 38 36 20 20 20 54 52 | PORTA.0086 TR| 00002a90 49 53 42 0a 30 30 38 35 20 20 20 54 52 49 53 41 |ISB.0085 TRISA| 00002aa0 0a 30 30 38 38 20 20 20 45 45 43 4f 4e 31 0a 30 |.0088 EECON1.0| 00002ab0 30 30 38 20 20 20 45 45 44 41 54 41 0a 30 30 30 |008 EEDATA.000| 00002ac0 42 20 20 20 49 4e 54 43 4f 4e 0a 30 30 30 39 20 |B INTCON.0009 | 00002ad0 20 20 45 45 41 44 52 0a 30 30 30 33 20 20 20 53 | EEADR.0003 S| 00002ae0 54 41 54 55 53 0a 30 30 30 35 20 20 20 52 50 30 |TATUS.0005 RP0| 00002af0 0a 30 30 30 31 20 20 20 49 4e 43 0a 30 30 30 32 |.0001 INC.0002| 00002b00 20 20 20 63 74 73 0a 30 30 30 33 20 20 20 72 74 | cts.0003 rt| 00002b10 73 0a 30 30 30 31 20 20 20 63 64 61 74 0a 30 30 |s.0001 cdat.00| 00002b20 30 32 20 20 20 63 63 6b 0a 30 30 30 33 20 20 20 |02 cck.0003 | 00002b30 72 63 6c 72 0a 30 30 30 34 20 20 20 72 63 6b 0a |rclr.0004 rck.| 00002b40 30 30 30 35 20 20 20 72 64 61 74 0a 30 30 30 43 |0005 rdat.000C| 00002b50 20 20 20 73 42 75 66 0a 30 30 30 44 20 20 20 53 | sBuf.000D S| 00002b60 63 6f 75 6e 74 0a 30 30 30 45 20 20 20 43 64 6f |count.000E Cdo| 00002b70 77 6e 0a 30 30 30 46 20 20 20 72 42 75 66 0a 30 |wn.000F rBuf.0| 00002b80 30 31 30 20 20 20 53 63 61 6e 4e 6f 0a 30 30 31 |010 ScanNo.001| 00002b90 31 20 20 20 52 6f 77 43 0a 30 30 31 32 20 20 20 |1 RowC.0012 | 00002ba0 53 73 74 6f 72 65 0a 30 30 31 33 20 20 20 43 6f |Sstore.0013 Co| 00002bb0 6d 31 0a 30 30 31 34 20 20 20 43 6f 6d 32 0a 30 |m1.0014 Com2.0| 00002bc0 30 31 35 20 20 20 73 61 76 65 5f 77 0a 30 30 31 |015 save_w.001| 00002bd0 36 20 20 20 73 61 76 65 5f 73 0a 30 30 31 37 20 |6 save_s.0017 | 00002be0 20 20 73 61 76 65 5f 70 0a 30 30 31 41 20 20 20 | save_p.001A | 00002bf0 44 69 73 42 75 66 0a 30 30 30 44 20 20 20 6f 75 |DisBuf.000D ou| 00002c00 74 0a 30 30 31 35 20 20 20 52 78 0a 30 30 31 37 |t.0015 Rx.0017| 00002c10 20 20 20 53 62 0a 30 30 31 41 20 20 20 52 6e 62 | Sb.001A Rnb| 00002c20 0a 30 30 32 34 20 20 20 53 65 6e 64 0a 30 30 32 |.0024 Send.002| 00002c30 41 20 20 20 53 6c 6f 6f 70 0a 30 30 33 38 20 20 |A Sloop.0038 | 00002c40 20 63 44 65 6c 61 79 0a 30 30 33 42 20 20 20 68 | cDelay.003B h| 00002c50 44 65 6c 61 79 0a 30 30 33 45 20 20 20 72 44 65 |Delay.003E rDe| 00002c60 6c 61 79 0a 30 30 34 31 20 20 20 44 65 6c 61 79 |lay.0041 Delay| 00002c70 0a 30 30 34 33 20 20 20 44 6c 6f 6f 70 0a 30 30 |.0043 Dloop.00| 00002c80 34 36 20 20 20 53 74 61 72 74 0a 30 30 36 43 20 |46 Start.006C | 00002c90 20 20 4d 61 69 6e 0a 30 30 37 36 20 20 20 73 63 | Main.0076 sc| 00002ca0 61 6e 0a 30 30 38 41 20 20 20 68 72 6f 75 74 0a |an.008A hrout.| 00002cb0 30 30 38 43 20 20 20 72 62 6f 75 74 0a 30 30 38 |008C rbout.008| 00002cc0 44 20 20 20 68 65 0a 30 30 39 30 20 20 20 72 6c |D he.0090 rl| 00002cd0 6f 6f 70 0a 30 30 39 39 20 20 20 73 6c 65 66 74 |oop.0099 sleft| 00002ce0 0a 30 30 39 45 20 20 20 73 6c 6c 6f 6f 70 0a 0a |.009E slloop..| 00002cf0 30 20 45 72 72 6f 72 73 |0 Errors| 00002cf8