home *** CD-ROM | disk | FTP | other *** search
/ TAP YIPL / TAP_and_YIPL_Collection_CD.iso / PHREAK / GENERAL / TELECARD.ZIP / TELECRD1.LST < prev    next >
File List  |  1994-09-16  |  30KB  |  511 lines

  1. MPASM 01.02 Released  TELECRD1.ASM   9-16-1994  10:19:21                 PAGE  1
  2. ISO 7816 Synchronous Memory Card Emulator
  3.  
  4. LOC  OBJECT CODE     LINE SOURCE TEXT
  5.   VALUE
  6.  
  7.                      0001  
  8.                      0002         TITLE   "ISO 7816 Synchronous Memory Card Emulator" 
  9.                      0003         LIST    P=PIC16C84, R=HEX 
  10.                      0004     INCLUDE "PICREG.EQU" 
  11.                      0001 ; PIC16Cxx Microcontroller Include File 
  12.                      0002  
  13.   01FF               0003 PIC54           equ     0x1ff   ; PIC16C54 Reset Vector 
  14.   01FF               0004 PIC55           equ     0x1ff   ; PIC16C55 Reset Vector 
  15.   03FF               0005 PIC56           equ     0x3ff   ; PIC16C56 Reset Vector 
  16.   07FF               0006 PIC57           equ     0x7ff   ; PIC16C57 Reset Vector 
  17.   0000               0007 PIC71           equ     0x000   ; PIC16C71 Reset Vector 
  18.   0000               0008 PIC84           equ     0x000   ; PIC16C84 Reset Vector 
  19.   0004               0009 INTVEC          equ     0x004   ; PIC16C71/84 Interupt Vector 
  20.                      0010  
  21.   0000               0011 INDIR           equ     0x000   ; Indirect File Reg Address Register 
  22.   0001               0012 RTCC            equ     0x001   ; Real Time Clock Counter 
  23.   0002               0013 PCL             equ     0x002   ; Program Counter Low Byte 
  24.   0003               0014 STATUS          equ     0x003   ; Status Register 
  25.   0004               0015 FSR             equ     0x004   ; File Select Register 
  26.   0005               0016 PORTA           equ     0x005   ; Port A I/O Register 
  27.   0006               0017 PORTB           equ     0x006   ; Port B I/O Register 
  28.   0007               0018 PORTC           equ     0x007   ; Port C I/O Register 
  29.   0008               0019 ADCON0          equ     0x008   ; PIC16C71 A/D Control Reg 0 
  30.   0009               0020 ADRES           equ     0x009   ; PIC16C71 A/D Converter Result Register 
  31.   0008               0021 EEDATA          equ     0x008   ; PIC16C84 EEPROM Data Register 
  32.   0009               0022 EEADR           equ     0x009   ; PIC16C84 EEPROM Address Register 
  33.   000A               0023 PCLATH          equ     0x00a   ; Program Counter High Bits 
  34.   000B               0024 INTCON          equ     0x00b   ; Interrupt Control Register 
  35.   0005               0025 TRISA           equ     0x005   ; Port A I/O Direction Register 
  36.   0006               0026 TRISB           equ     0x006   ; Port B I/O Direction Register 
  37.   0007               0027 TRISC           equ     0x007   ; Port C I/O Direction Register 
  38.   0008               0028 ADCON1          equ     0x008   ; PIC16C71 A/D Control Reg 1 
  39.   0008               0029 EECON1          equ     0x008   ; PIC16C84 EEPROM Control Reg. 1 
  40.   0009               0030 EECON2          equ     0x009   ; PIC16C84 EEPROM Control Reg. 2 
  41.   0001               0031 OPTION          equ     0x001   ; Option Register 
  42.                      0032  
  43.   0007               0033 MSB             equ     0x007   ; Most-Significant Bit 
  44.   0000               0034 LSB             equ     0x000   ; Least-Significant Bit 
  45.   0001               0035 TRUE            equ     1 
  46.   0001               0036 YES             equ     1 
  47.   0000               0037 FALSE           equ     0 
  48.   0000               0038 NO              equ     0 
  49.                      0039  
  50.                      0040 ; Status Register (f03) Bits 
  51.                      0041  
  52.   0000               0042 CARRY           equ     0x000   ; Carry Bit 
  53.   0000               0043 C               equ     0x000   ; Carry Bit 
  54.   0001               0044 DCARRY          equ     0x001   ; Digit Carry Bit 
  55.   0001               0045 DC              equ     0x001   ; Digit Carry Bit 
  56.   0002               0046 Z_BIT           equ     0x002   ; Zero Bit 
  57.   0002               0047 Z               equ     0x002   ; Zero Bit 
  58.   0003               0048 P_DOWN          equ     0x003   ; Power Down Bit 
  59.   0003               0049 PD              equ     0x003   ; Power Down Bit 
  60. MPASM 01.02 Released  TELECRD1.ASM   9-16-1994  10:19:21                 PAGE  2
  61. ISO 7816 Synchronous Memory Card Emulator
  62.  
  63. LOC  OBJECT CODE     LINE SOURCE TEXT
  64.   VALUE
  65.  
  66.   0004               0050 T_OUT           equ     0x004   ; Watchdog Time-Out Bit 
  67.   0004               0051 TO              equ     0x004   ; Watchdog Time-Out Bit 
  68.   0005               0052 RP0             equ     0x005   ; Register Page Select 0 
  69.   0006               0053 RP1             equ     0x006   ; Register Page Select 1 
  70.   0007               0054 IRP             equ     0x007   ; Indirect Addressing Reg. Page Sel. 
  71.                      0055  
  72.                      0056 ; INTCON Register (f0b) Bits 
  73.                      0057  
  74.   0000               0058 RBIF            equ     0x000   ; RB Port change interrupt flag 
  75.   0001               0059 INTF            equ     0x001   ; INT Interrupt Flag 
  76.   0002               0060 RTIF            equ     0x002   ; RTCC Overflow Interupt Flag 
  77.   0003               0061 RBIE            equ     0x003   ; RB Port Ch. Interupt Enable 
  78.   0004               0062 INTE            equ     0x004   ; INT Interupt Enable 
  79.   0005               0063 RTIE            equ     0x005   ; RTCC Overflow Int. Enable 
  80.   0006               0064 ADIE            equ     0x006   ; PIC16C71 A/D Int. Enable 
  81.   0006               0065 EEIE            equ     0x006   ; PIC16C84 EEPROM Write Int. Enable 
  82.   0007               0066 GIE             equ     0x007   ; Global Interupt Enable 
  83.                      0067  
  84.                      0068 ; OPTION Register (f81) Bits 
  85.                      0069  
  86.   0000               0070 PS0             equ     0x000   ; Prescaler Bit 0 
  87.   0001               0071 PS1             equ     0x001   ; Prescaler Bit 1 
  88.   0002               0072 PS2             equ     0x002   ; Prescaler Bit 2 
  89.   0003               0073 PSA             equ     0x003   ; Prescaler Assignment Bit 
  90.   0004               0074 RTE             equ     0x004   ; RTCC Signal Edge Select 
  91.   0005               0075 RTS             equ     0x005   ; RTCC Signal Source Select 
  92.   0006               0076 INTEDG          equ     0x006   ; Interupt Edge Select 
  93.   0007               0077 RBPU            equ     0x007   ; Port B Pull-up Enable 
  94.                      0078  
  95.                      0079 ; ADCON0 Register (f08) Bits 
  96.                      0080  
  97.   0000               0081 ADON            equ     0x000   ; A/D Converter Power Switch 
  98.   0001               0082 ADIF            equ     0x001   ; A/D Conversion Interupt Flag 
  99.   0002               0083 ADGO            equ     0x002   ; A/D Conversion Start Flag 
  100.   0003               0084 CHS0            equ     0x003   ; A/D Converter Channel Select 0 
  101.   0004               0085 CHS1            equ     0x004   ; A/D Converter Channel Select 1 
  102.   0006               0086 ADCS0           equ     0x006   ; A/D Conversion Clock Select 0 
  103.   0007               0087 ADCS1           equ     0x007   ; A/D Conversion Clock Select 0 
  104.                      0088  
  105.                      0089 ; ADCON1 Register (f88) Bits 
  106.                      0090  
  107.   0000               0091 PCFG0           equ     0x000   ; RA0-RA3 Configuration Bit 0 
  108.   0001               0092 PCFG1           equ     0x001   ; RA0-RA3 Configuration Bit 0 
  109.                      0093  
  110.                      0094 ; EECON1 Register (f88) Bits 
  111.                      0095  
  112.   0000               0096 RD              equ     0x000   ; PIC16C84 EEPROM Read Data Flag 
  113.   0001               0097 WR              equ     0x001   ; PIC16C84 EEPROM Write Data Flag 
  114.   0002               0098 WREN            equ     0x002   ; PIC16C84 EEPROM Write Enable Flag 
  115.   0003               0099 WRERR           equ     0x003   ; PIC16C84 EEPROM Write Error Flag 
  116.   0004               0100 EEIF            equ     0x004   ; PIC16C84 EEPROM Interupt Flag 
  117.                      0101  
  118.                      0102 ; Some useful macros... 
  119. MPASM 01.02 Released  TELECRD1.ASM   9-16-1994  10:19:21                 PAGE  3
  120. ISO 7816 Synchronous Memory Card Emulator
  121.  
  122. LOC  OBJECT CODE     LINE SOURCE TEXT
  123.   VALUE
  124.  
  125.                      0103  
  126.                      0104 PUSH    macro 
  127.                      0105     movwf   TEMP_W 
  128.                      0106     swapf   STATUS,W 
  129.                      0107     movwf   TEMP_S 
  130.                      0108     endm 
  131.                      0109  
  132.                      0110 POP     macro 
  133.                      0111     swapf   TEMP_S,W 
  134.                      0112     movwf   STATUS 
  135.                      0113     swapf   TEMP_W 
  136.                      0114     swapf   TEMP_W,W 
  137.                      0115     endm 
  138.                      0116  
  139.                      0117         END 
  140.                      0004  
  141.                      0005  
  142.                      0006 ; PIC16C84 I/O Pin Assignment List 
  143.                      0007  
  144.   0000               0008 CRD_CLK         equ     0       ; RB0 + RA4 = Card Clock 
  145.   0000               0009 CRD_DTA         equ     0       ; RA0 = Card Data Output 
  146.   0001               0010 CRD_RST         equ     1       ; RB1 = Card Reset, Low-Active 
  147.   0007               0011 CRD_WE          equ     7       ; RB7 = Card Write-Enable, Hi-Active 
  148.                      0012  
  149.                      0013 ; PIC16C84 RAM Register Assignments 
  150.                      0014  
  151.   000C               0015 CRD_ID          equ     0x00c   ; Smartcard ID, 12 bytes 
  152.   0018               0016 FUSCNT          equ     0x018   ; Fused units counter 
  153.   0019               0017 BITCNT          equ     0x019   ; Bitcounter 
  154.   001A               0018 LOOPCNT         equ     0x01a   ; Loop Counter 
  155.   001B               0019 EE_FLAG         equ     0x01b   ; EEPROM Write Flag 
  156.   001C               0020 TEMP1           equ     0x01c   ; Temporary Storage #1 
  157.   001D               0021 TEMP2           equ     0x01d   ; Temporary Storage #2 
  158.   001E               0022 TEMP3           equ     0x01e   ; Temporary Storage #3 
  159.   001F               0023 TEMP4           equ     0x01f   ; Temporary STorage #4 
  160.   002E               0024 TEMP_W          equ     0x02e   ; Temporary W Save Address 
  161.   002F               0025 TEMP_S          equ     0x02f   ; Temporary STATUS Save Address 
  162.                      0026  
  163.                      0027         org     0x2000          ; Chip ID Data 
  164. Warning: Address exceeds maximum range for this processor
  165. Warning: Address exceeds maximum range for this processor
  166. Warning: Address exceeds maximum range for this processor
  167. 2000 0042 0042 0042  0028         dw      042,042,042,042 
  168. Warning: Address exceeds maximum range for this processor
  169. 2003 0042            0028  
  170.                      0029  
  171.                      0030         org     0x2007          ; Configuration Fuses 
  172. Warning: Address exceeds maximum range for this processor
  173. 2007 0001            0031         dw      B'00000001' 
  174.                      0032  
  175.                      0033         org     PIC84           ; Reset-vector 
  176. 0000 2810            0034         goto    INIT            ; Jump to initialization routine 
  177.                      0035  
  178. MPASM 01.02 Released  TELECRD1.ASM   9-16-1994  10:19:21                 PAGE  4
  179. ISO 7816 Synchronous Memory Card Emulator
  180.  
  181. LOC  OBJECT CODE     LINE SOURCE TEXT
  182.   VALUE
  183.  
  184.                      0036         org     INTVEC          ; Interupt-vector 
  185.                      0037     push                    ; Save registers 
  186. 0004 00AE               M         movwf   TEMP_W 
  187. 0005 0E03               M         swapf   STATUS,W 
  188. 0006 00AF               M         movwf   TEMP_S 
  189. 0007 204D            0038         call    INTMAIN         ; Call main interupt routine 
  190.                      0039     pop                     ; Restore registers 
  191. 0008 0E2F               M         swapf   TEMP_S,W 
  192. 0009 0083               M         movwf   STATUS 
  193. 000A 0EAE               M         swapf   TEMP_W 
  194. 000B 0E2E               M         swapf   TEMP_W,W 
  195. 000C 0009            0040         retfie                  ; return from interupt & clear flag 
  196.                      0041  
  197.                      0042         org     0x010           ; Start address for init rout. 
  198. 0010 1683            0043 INIT    bsf     STATUS,RP0      ; Access register bank 1 
  199. 0011 0064            0044         clrwdt                  ; Clear watchdog timer 
  200. 0012 30E8            0045         movlw   B'11101000'     ; OPTION reg. settings 
  201. 0013 0081            0046         movwf   OPTION          ; Store in OPTION register 
  202. 0014 30FE            0047         movlw   B'11111110'     ; Set PORT A Tristate Latches 
  203. 0015 0085            0048         movwf   TRISA           ; Store in PORT A tristate register 
  204. 0016 30FF            0049         movlw   B'11111111'     ; Set PORT B Tristate Latches 
  205. 0017 0086            0050         movwf   TRISB           ; Store in PORT B tristate register 
  206. 0018 1283            0051         bcf     STATUS,RP0      ; Access register bank 0 
  207. 0019 0181            0052         clrf    RTCC            ; Clear RTCC 
  208. 001A 0185            0053         clrf    PORTA           ; Clear PORTA 
  209. 001B 0186            0054         clrf    PORTB           ; Clear PORTB 
  210. 001C 300C            0055         movlw   0c              ; EEPROM Fused Units Counter is at $0c 
  211. 001D 0089            0056         movwf   EEADR           ; Store in EEPROM Address Pointer 
  212. 001E 1683            0057         bsf     STATUS,RP0      ; Access register bank 1 
  213. 001F 1408            0058         bsf     EECON1,RD       ; Set EECON1 Read Data Flag 
  214. 0020 1283            0059         bcf     STATUS,RP0      ; Access register bank 0 
  215. 0021 0808            0060         movfw   EEDATA          ; Read EEPROM fused units counter 
  216. 0022 0098            0061         movwf   FUSCNT          ; Store in FUSCNT         
  217. 0023 300C            0062         movlw   0c              ; 12 bytes to copy 
  218. 0024 009A            0063         movwf   LOOPCNT         ; Store in LOOPCNT 
  219. 0025 300C            0064         movlw   0c              ; Start storing at $0c in RAM 
  220. 0026 0084            0065         movwf   FSR             ; Store in FSR 
  221. 0027 0189            0066         clrf    EEADR           ; Start at EEPROM Address 0 
  222. 0028                 0067 EECOPY   
  223. 0028 0809            0068         movfw   EEADR 
  224. 0029 2092            0069         call    CARDID 
  225. 002A 0080            0070         movwf   INDIR           ; Store in RAM pointed at by FSR 
  226. 002B 0A84            0071         incf    FSR             ; Increase FSR pointer 
  227. 002C 0A89            0072         incf    EEADR           ; Increase EEPROM Address Pointer 
  228. 002D 0B9A            0073         decfsz  LOOPCNT,1       ; Decrease LOOPCNT until it's 0 
  229. 002E 2828            0074         goto    EECOPY          ; Go and get some more bytes! 
  230. 002F 1683            0075         bsf     STATUS,RP0      ; Access register bank 1 
  231. 0030 1208            0076         bcf     EECON1,EEIF     ; Clear EEPROM Write Int. Flag 
  232. 0031 1108            0077         bcf     EECON1,WREN     ; EEPROM Write Disable 
  233. 0032 1283            0078         bcf     STATUS,RP0      ; Access register bank 0 
  234. 0033 3090            0079         movlw   B'10010000'     ; Enable INT Interupt 
  235. MPASM 01.02 Released  TELECRD1.ASM   9-16-1994  10:19:21                 PAGE  5
  236. ISO 7816 Synchronous Memory Card Emulator
  237.  
  238. LOC  OBJECT CODE     LINE SOURCE TEXT
  239.   VALUE
  240.  
  241. 0034 008B            0080         movwf   INTCON          ; Store in INTCON 
  242.                      0081  
  243. 0035 1683            0082 MAIN    bsf     STATUS,RP0      ; Access register bank 1 
  244. 0036 1888            0083         btfsc   EECON1,WR       ; Check if EEPROM Write Flag Set 
  245. 0037 2835            0084         goto    MAIN            ; Skip if EEPROM Write is Completed 
  246. 0038 1208            0085         bcf     EECON1,EEIF     ; Reset Write Completion Flag 
  247. 0039 1108            0086         bcf     EECON1,WREN     ; EEPROM Write Disable 
  248. 003A 1283            0087         bcf     STATUS,RP0      ; Access register bank 0 
  249. 003B 1C1B            0088         btfss   EE_FLAG,LSB     ; Check for EEPROM Write Flag 
  250. 003C 2835            0089         goto    MAIN            ; If not set, jump back and wait some more 
  251. 003D 019B            0090         clrf    EE_FLAG         ; Clear EEPROM Write Flag 
  252. 003E 300C            0091         movlw   0c              ; Units is stored in byte $0c 
  253. 003F 0089            0092         movwf   EEADR           ; Store in EEPROM Address Counter 
  254. 0040 0818            0093         movfw   FUSCNT          ; Get fused units counter 
  255. 0041 0088            0094         movwf   EEDATA          ; Store in EEDATA 
  256. 0042 1683            0095         bsf     STATUS,RP0      ; Access register bank 1 
  257. 0043 1508            0096         bsf     EECON1,WREN     ; EEPROM Write Enable 
  258. 0044 138B            0097         bcf     INTCON,GIE      ; Disable all interupts 
  259. 0045 3055            0098         movlw   055             ; Magic Number #1 for EEPROM Write 
  260. 0046 0089            0099         movwf   EECON2          ; Store in EECON2 
  261. 0047 30AA            0100         movlw   0aa             ; Magic Number #2 for EEPROM Write 
  262. 0048 0089            0101         movwf   EECON2          ; Store in EECON2 
  263. 0049 1488            0102         bsf     EECON1,WR       ; Execute EEPROM Write 
  264. 004A 178B            0103         bsf     INTCON,GIE      ; Enable all interupts again! 
  265. 004B 1283            0104         bcf     STATUS,RP0      ; Access register bank 0 
  266. 004C 2835            0105         goto    MAIN            ; Program main loop! 
  267.                      0106  
  268. 004D 188B            0107 INTMAIN btfsc   INTCON,INTF     ; Check for INT Interupt 
  269. 004E 2852            0108         goto    INTMAIN2        ; If set, jump to INTMAIN2 
  270. 004F 3010            0109         movlw   B'00010000'     ; Enable INT Interupt 
  271. 0050 008B            0110         movwf   INTCON          ; Store in INTCON 
  272. 0051 0008            0111         return 
  273.                      0112  
  274. 0052                 0113 INTMAIN2 
  275. 0052 1283            0114         bcf     STATUS,RP0      ; Access register bank 0 
  276. 0053 1405            0115         bsf     PORTA,CRD_DTA   ; Set Data Output High 
  277. 0054 1886            0116         btfsc   PORTB,CRD_RST   ; Check if reset is low 
  278. 0055 2862            0117         goto    NO_RST          ; If not, skip reset sequence 
  279. 0056 0801            0118         movfw   RTCC            ; Get RTCC Value 
  280. 0057 009F            0119         movwf   TEMP4           ; Store in TEMP4 
  281. 0058 0181            0120         clrf    RTCC            ; Clear RTCC 
  282. 0059 3055            0121         movlw   055             ; Subtract $55 from TEMP4 
  283. 005A 021F            0122         subwf   TEMP4,0         ; Subtract with $55 to check for reset 
  284. 005B 1D03 2860       0123         bnz     NO_RST2         ; If not zero, jump to NO_RST 
  285. 005D 3002            0124         movlw   02              ; Unused one has $02 in FUSCNT 
  286. 005E 0098            0125         movwf   FUSCNT          ; Store full value in FUSCNT 
  287. 005F 141B            0126         bsf     EE_FLAG,LSB     ; Set EEPROM Write Flag 
  288. 0060 108B            0127 NO_RST2 bcf     INTCON,INTF     ; Clear INT Interupt Flag 
  289. 0061 0008            0128         return                  ; Mission Accomplished, return to sender 
  290.                      0129  
  291. 0062 0801            0130 NO_RST  movfw   RTCC            ; Get RTCC Value 
  292. 0063 0099            0131         movwf   BITCNT          ; Copy it to BITCNT 
  293. 0064 009C            0132         movwf   TEMP1           ; Copy it to TEMP1 
  294. MPASM 01.02 Released  TELECRD1.ASM   9-16-1994  10:19:21                 PAGE  6
  295. ISO 7816 Synchronous Memory Card Emulator
  296.  
  297. LOC  OBJECT CODE     LINE SOURCE TEXT
  298.   VALUE
  299.  
  300. 0065 009D            0133         movwf   TEMP2           ; Copy it to TEMP2 
  301. 0066 3060            0134         movlw   060             ; Load W with $60 
  302. 0067 021C            0135         subwf   TEMP1,0         ; Subtract $60 from TEMP1 
  303. 0068 1903 2881       0136         bz      CREDIT          ; If it is equal to $60 
  304. 006A 1803 2881       0137         bc      CREDIT          ; or greater, then skip to units area 
  305. 006C 0C9D            0138         rrf     TEMP2           ; Rotate TEMP2 one step right 
  306. 006D 0C9D            0139         rrf     TEMP2           ; Rotate TEMP2 one step right 
  307. 006E 0C9D            0140         rrf     TEMP2           ; Rotate TEMP2 one step right 
  308. 006F 300F            0141         movlw   0f              ; Load W with $f 
  309. 0070 059D            0142         andwf   TEMP2,1         ; And TEMP2 with W register 
  310. 0071 081D            0143         movfw   TEMP2           ; Load W with TEMP2 
  311. 0072 3E0C            0144         addlw   0c              ; Add W with $0c 
  312. 0073 0084            0145         movwf   FSR             ; Store data address in FSR 
  313. 0074 0800            0146         movfw   INDIR           ; Get databyte pointed at by FSR 
  314. 0075 009E            0147         movwf   TEMP3           ; Store it in TEMP3 
  315. 0076 3007            0148         movlw   07              ; Load W with $07 
  316. 0077 059C            0149         andwf   TEMP1,1         ; And TEMP1 with $07 
  317. 0078 1903 287D       0150         bz      NO_ROT          ; If result is zero, skip shift loop 
  318. 007A 0D9E            0151 ROTLOOP rlf     TEMP3           ; Shift TEMP3 one step left 
  319. 007B 0B9C            0152         decfsz  TEMP1,1         ; Decrement TEMP1 until zero 
  320. 007C 287A            0153         goto    ROTLOOP         ; If not zero, repeat until it is! 
  321. 007D 1F9E            0154 NO_ROT  btfss   TEMP3,MSB       ; Check if MSB of TEMP3 is set 
  322. 007E 1005            0155         bcf     PORTA,CRD_DTA   ; Clear Data Output 
  323. 007F 108B            0156         bcf     INTCON,INTF     ; Clear INT Interupt Flag 
  324. 0080 0008            0157         return                  ; Mission Accomplished, return to sender 
  325.                      0158  
  326. 0081 1F86            0159 CREDIT  btfss   PORTB,CRD_WE    ; Check if Card Write Enable is High 
  327. 0082 2889            0160         goto    NO_WRT          ; Abort write operation if not... 
  328. 0083 1C86            0161         btfss   PORTB,CRD_RST   ; Check if Card Reset is High 
  329. 0084 2889            0162         goto    NO_WRT          ; Abort write operation if not... 
  330. 0085 0A98            0163         incf    FUSCNT          ; Increase used-up units counter 
  331. 0086 141B            0164         bsf     EE_FLAG,LSB     ; Set EEPROM Write-Flag 
  332. 0087 108B            0165         bcf     INTCON,INTF     ; Clear INT Interupt Flag 
  333. 0088 0008            0166         return                  ; Mission Accomplished, return to sender 
  334.                      0167  
  335. 0089 3060            0168 NO_WRT  movlw   060             ; Load W with $60 
  336. 008A 0299            0169         subwf   BITCNT,1        ; Subtract $60 from BITCNT 
  337. 008B 0818            0170         movfw   FUSCNT          ; Load W with FUSCNT 
  338. 008C 0299            0171         subwf   BITCNT,1        ; Subtract FUSCNT from BITCNT 
  339. 008D 1C03 2890       0172         bnc     FUSED           ; If result is negative, unit is fused 
  340. 008F 1005            0173         bcf     PORTA,CRD_DTA   ; Clear Data Output 
  341. 0090 108B            0174 FUSED   bcf     INTCON,INTF     ; Clear INT Interupt Flag 
  342. 0091 0008            0175         return                  ; Mission Accomplished, return to sender 
  343.                      0176      
  344. 0092 0782            0177 CARDID  addwf   PCL             ; Card ID Data!!! 
  345. 0093 3481            0178         retlw   0x081 
  346. 0094 3442            0179         retlw   0x042 
  347. 0095 3400            0180         retlw   0x000 
  348. 0096 3411            0181         retlw   0x011 
  349. 0097 3422            0182         retlw   0x022 
  350. 0098 3433            0183         retlw   0x033 
  351. 0099 3444            0184         retlw   0x044 
  352. 009A 3455            0185         retlw   0x055 
  353. MPASM 01.02 Released  TELECRD1.ASM   9-16-1994  10:19:21                 PAGE  7
  354. ISO 7816 Synchronous Memory Card Emulator
  355.  
  356. LOC  OBJECT CODE     LINE SOURCE TEXT
  357.   VALUE
  358.  
  359. 009B 3466            0186         retlw   0x066 
  360. 009C 3477            0187         retlw   0x077 
  361. 009D 3411            0188         retlw   0x011 
  362. 009E 3484            0189         retlw   0x084 
  363.                      0190  
  364.                      0191         END 
  365.                      0192  
  366. MPASM 01.02 Released  TELECRD1.ASM   9-16-1994  10:19:21                 PAGE  8
  367. ISO 7816 Synchronous Memory Card Emulator
  368.  
  369. SYMBOL TABLE
  370.  
  371. LABEL                            VALUE
  372.  
  373. ADCON0                            0008 
  374. ADCON1                            0008 
  375. ADCS0                             0006 
  376. ADCS1                             0007 
  377. ADGO                              0002 
  378. ADIE                              0006 
  379. ADIF                              0001 
  380. ADON                              0000 
  381. ADRES                             0009 
  382. BITCNT                            0019 
  383. C                                 0000 
  384. CARDID                            0092 
  385. CARRY                             0000 
  386. CHS0                              0003 
  387. CHS1                              0004 
  388. CRD_CLK                           0000 
  389. CRD_DTA                           0000 
  390. CRD_ID                            000C 
  391. CRD_RST                           0001 
  392. CRD_WE                            0007 
  393. CREDIT                            0081 
  394. DC                                0001 
  395. DCARRY                            0001 
  396. EEADR                             0009 
  397. EECON1                            0008 
  398. EECON2                            0009 
  399. EECOPY                            0028 
  400. EEDATA                            0008 
  401. EEIE                              0006 
  402. EEIF                              0004 
  403. EE_FLAG                           001B 
  404. FALSE                             0000 
  405. FSR                               0004 
  406. FUSCNT                            0018 
  407. FUSED                             0090 
  408. GIE                               0007 
  409. INDIR                             0000 
  410. INIT                              0010 
  411. INTCON                            000B 
  412. INTE                              0004 
  413. INTEDG                            0006 
  414. INTF                              0001 
  415. INTMAIN                           004D 
  416. INTMAIN2                          0052 
  417. INTVEC                            0004 
  418. IRP                               0007 
  419. LOOPCNT                           001A 
  420. LSB                               0000 
  421. MAIN                              0035 
  422. MSB                               0007 
  423. NO                                0000 
  424. NO_ROT                            007D  MPASM 01.02 Released  TELECRD1.ASM   9-16-1994  10:19:21                 PAGE  9
  425. ISO 7816 Synchronous Memory Card Emulator
  426.  
  427. SYMBOL TABLE - Continued
  428.  
  429. LABEL                            VALUE
  430.  
  431. NO_RST                            0062 
  432. NO_RST2                           0060 
  433. NO_WRT                            0089 
  434. OPTION                            0001 
  435. PCFG0                             0000 
  436. PCFG1                             0001 
  437. PCL                               0002 
  438. PCLATH                            000A 
  439. PD                                0003 
  440. PIC54                             01FF 
  441. PIC55                             01FF 
  442. PIC56                             03FF 
  443. PIC57                             07FF 
  444. PIC71                             0000 
  445. PIC84                             0000 
  446. PORTA                             0005 
  447. PORTB                             0006 
  448. PORTC                             0007 
  449. PS0                               0000 
  450. PS1                               0001 
  451. PS2                               0002 
  452. PSA                               0003 
  453. P_DOWN                            0003 
  454. RBIE                              0003 
  455. RBIF                              0000 
  456. RBPU                              0007 
  457. RD                                0000 
  458. ROTLOOP                           007A 
  459. RP0                               0005 
  460. RP1                               0006 
  461. RTCC                              0001 
  462. RTE                               0004 
  463. RTIE                              0005 
  464. RTIF                              0002 
  465. RTS                               0005 
  466. STATUS                            0003 
  467. TEMP1                             001C 
  468. TEMP2                             001D 
  469. TEMP3                             001E 
  470. TEMP4                             001F 
  471. TEMP_S                            002F 
  472. TEMP_W                            002E 
  473. TO                                0004 
  474. TRISA                             0005 
  475. TRISB                             0006 
  476. TRISC                             0007 
  477. TRUE                              0001 
  478. T_OUT                             0004 
  479. WR                                0001 
  480. WREN                              0002 
  481. WRERR                             0003 
  482. YES                               0001  MPASM 01.02 Released  TELECRD1.ASM   9-16-1994  10:19:21                 PAGE 10
  483. ISO 7816 Synchronous Memory Card Emulator
  484.  
  485. SYMBOL TABLE - Continued
  486.  
  487. LABEL                            VALUE
  488.  
  489. Z                                 0002 
  490. Z_BIT                             0002 
  491.  
  492.  
  493. MEMORY USAGE MAP ('X' = Used,  '-' = Unused)
  494.  
  495. 0000 : X---XXXXXXXXX--- XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
  496. 0040 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
  497.  
  498. 0080 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX- ---------------- ----------------
  499. 00C0 : ---------------- ---------------- ---------------- ----------------
  500.  
  501. 2000 : XXXX---X-------- ---------------- ---------------- ----------------
  502. 2040 : ---------------- ---------------- ---------------- ----------------
  503.  
  504. All other memory blocks unused.
  505.  
  506.  
  507. Errors   :    0
  508. Warnings :    5
  509. Messages :    0
  510.  
  511.