home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaDemoCD2.iso / ASCII / TEXTE / SCENE / AMIGA / Useful-Amiga / HardwareHacking / KEYWIN95.LHA / ATkeyboard / keyb_w95.lst < prev    next >
Encoding:
File List  |  1996-12-31  |  59.4 KB  |  1,127 lines

  1. MPASM 01.40 Released         KEYB_W95.ASM   8-11-1996  13:45:29         PAGE  1
  2.  
  3.  
  4. LOC  OBJECT CODE     LINE SOURCE TEXT
  5.   VALUE
  6.  
  7.                     00001         list    p=16c84, r=dec, n=0
  8.                     00002 
  9.   000000ED          00003 cmd_option      equ     0xed
  10.   000000F3          00004 cmd_typematic   equ     0xf3
  11.   000000F6          00005 cmd_default     equ     0xf6
  12.   000000FE          00006 cmd_resend      equ     0xfe
  13.   000000FF          00007 cmd_reset       equ     0xff
  14.   00000078          00008 rst_warn        equ     0x78
  15.   000000FD          00009 pwr_up          equ     0xfd    ;power up key stream
  16.   000000FE          00010 t_pwr_up        equ     0xfe    ;terminate key stream
  17.   FFFFFFFF          00011 no_send         equ     -1      ;do not send to amiga
  18.                     00012 
  19.                     00013         cblock  1
  20.   00000001          00014         tmr0            ;timer
  21.   00000002          00015         pc              ;lsb pc
  22.   00000003          00016         status
  23.   00000004          00017         fsr
  24.   00000005          00018         pa              ;port a
  25.   00000006          00019         pb              ;port b
  26.   00000007          00020         dummy
  27.   00000008          00021         eedata
  28.   00000009          00022         eeadr
  29.   0000000A          00023         pclath          ;msb pc latch
  30.   0000000B          00024         intcon          ;interrupt control reg.
  31.   0000000C          00025         int_addr        ;interrupt routine addr. 
  32.   0000000D          00026         trans_addr      ;trans. routine addr. 
  33.   0000000E          00027         _byte           ;byte to receive/transmit
  34.   0000000F          00028         save_byte       ;resend byte
  35.   00000010          00029         ami_byte        ;byte to transmit -> amiga
  36.   00000011          00030         _temp           ;rotation temp storage
  37.   00000012          00031         bit_cnt         ;bit counter
  38.   00000013          00032         cnt_dwn         ;count down reg.
  39.   00000014          00033         parity
  40.   00000015          00034         at_s_ret        ;"at realsend routine" return addr.
  41.   00000016          00035         x_flag          ;"xtra flag" reg.
  42.   00000017          00036         leds            ;at-keyboard leds
  43.   00000018          00037         l_byte          ;last received byte
  44.   00000019          00038         e0_l_byte       ;last received 0xe0 byte
  45.   0000001A          00039         tmr_ret         ;timer return addr.
  46.   0000001B          00040         tmr_ret_pch     ;timer return pc high latch
  47.   0000001C          00041         tmr_addr        ;delay wait routine addr.
  48.   0000001D          00042         tmr_pch         ;delay wait routine pc high latch
  49.   0000001E          00043         tmr_cntdwn      ;0xff cycles in wdt lookalike routine
  50.   0000001F          00044         tmr_ms          ;remaining cycles in wdt lookalike routine
  51.                     00045         endc
  52.                     00046 
  53.                     00047 #define carry           status,0
  54.                     00048 #define zero            status,2
  55.                     00049 #define rp0             status,5        ;page select
  56.                     00050 #define rd              eecon1,0        ;read eeprom
  57.                     00051 #define wr              eecon1,1        ;write eeprom
  58.                     00052 #define wren            eecon1,2        ;write eeprom enable
  59.                     00053 #define eeif            eecon1,4        ;eeprom write int
  60.                     00054 #define rbif            intcon,0        ;pb change int. flag
  61.                     00055 #define intf            intcon,1        ;pb,0 int. flag
  62.                     00056 #define t0if            intcon,2        ;tmr0 int. flag
  63.                     00057 #define rbie            intcon,3
  64.                     00058 #define inte            intcon,4
  65.                     00059 #define t0ie            intcon,5
  66.                     00060 #define eeie            intcon,6
  67.                     00061 #define gie             intcon,7        ;global interrupt enable
  68.                     00062 #define pch_0           pclath,0
  69.                     00063 #define pch_1           pclath,1
  70.                     00064 
  71.                     00065 #define at_clk_in       pb,0
  72.                     00066 #define at_clk_out      pb,1
  73.                     00067 #define ami_type        pb,3            ;resetmode switch
  74.                     00068 #define at_dat_in       pb,6
  75.                     00069 #define at_dat_out      pb,7
  76.                     00070 #define ami_dat_out     pa,0
  77.                     00071 #define ami_dat_in      pa,1
  78.                     00072 #define _kbreset        pa,3
  79.                     00073 #define ami_clk         pa,4            ;open drain
  80.                     00074 #define par_chk         _byte,7         ;parity check bit
  81.                     00075 #define _break          ami_byte,7      ;break bit
  82.                     00076 #define c_lock          leds,2          ;caps lock on/off
  83.                     00077 #define p_res           x_flag,0        ;pause pressed twice chk
  84.                     00078 #define rw_ctrl         x_flag,1        ;reset warning chk bits
  85.                     00079 #define rw_lalt         x_flag,2
  86.                     00080 #define rw_ralt         x_flag,3
  87.                     00081 #define rwarn           x_flag,4        ;reset warning main flag
  88.                     00082 #define tmr_tst         x_flag,5        ;longdelay test bit
  89.                     00083 #define s_break         x_flag,6        ;"special mission keys" break flag
  90.                     00084 #define sync_cd         x_flag,7        ;sync countdown checkbit
  91.                     00085 
  92. 0000                00086         org     0               ;reset vector
  93. 0000 30FF           00087         movlw   0xff            ;init ports
  94. 0001 0086           00088         movwf   pb
  95. 0002 0085           00089         movwf   pa
  96. 0003 29A5           00090         goto    init
  97.                     00091 
  98. 0004                00092         org     4               ;interrupt vector
  99. 0004 188B           00093         btfsc   intf            ;pb,0
  100. 0005 2824           00094         goto    at_clk
  101.                     00095 ;---------------------------------------------------
  102. 0006 110B           00096         bcf     t0if            ;watch dog timer lookalike routine
  103. Message[305]: Using default destination of 1 (file).
  104. 0007 0B9E           00097         decfsz  tmr_cntdwn
  105. 0008 0009           00098         retfie                  ;65536us @ 4MHz
  106.                     00099 
  107. 0009 1A96           00100         btfsc   tmr_tst
  108. 000A 2813           00101         goto    tmr_end
  109.                     00102 
  110. Message[305]: Using default destination of 1 (file).
  111. 000B 0A9E           00103         incf    tmr_cntdwn
  112. 000C 1696           00104         bsf     tmr_tst
  113. 000D 081F           00105         movf    tmr_ms,w
  114. 000E 0081           00106         movwf   tmr0
  115. 000F 081D           00107         movf    tmr_pch,w
  116. 0010 008A           00108         movwf   pclath
  117. 0011 081C           00109         movf    tmr_addr,w
  118. 0012 0009           00110         retfie
  119.                     00111 
  120. 0013 308F           00112 tmr_end movlw   b'10001111'
  121. Warning[224]: Use of this instruction is not recommended.
  122. 0014 0062           00113         option
  123. 0015 081B           00114         movf    tmr_ret_pch,w
  124. 0016 008A           00115         movwf   pclath
  125. 0017 081A           00116         movf    tmr_ret,w
  126. 0018 0008           00117         return
  127.                     00118 
  128. 0019                00119 tmr_init
  129. 0019 009C           00120         movwf   tmr_addr        ;save wait routine addr.
  130. 001A 1296           00121         bcf     tmr_tst
  131. 001B 3087           00122         movlw   b'10000111'     ;assign presc. to tmr0, presc. 256
  132. Warning[224]: Use of this instruction is not recommended.
  133. 001C 0062           00123         option
  134. 001D 0181           00124         clrf    tmr0
  135. 001E 30A0           00125         movlw   b'10100000'     ;gie,t0ie =enable
  136. 001F 008B           00126         movwf   intcon
  137. 0020 081D           00127         movf    tmr_pch,w
  138. 0021 008A           00128         movwf   pclath
  139. 0022 081C           00129         movf    tmr_addr,w
  140. 0023 0008           00130         return
  141.                     00131 ;---------------------------------------------------
  142. 0024 108B           00132 at_clk  bcf     intf
  143. 0025 080C           00133         movf    int_addr,w      ;get correct int. routine
  144. 0026 0082           00134         movwf   pc
  145.                     00135 ;---------------------------------------------------
  146. 0027 0082           00136 wait    movwf   pc
  147.                     00137 
  148.                     00138 ;========-at get key-===============================
  149. 0028                00139 at_get_key
  150. 0028 3030           00140         movlw   at_g0
  151. 0029 008C           00141         movwf   int_addr
  152. 002A 3082           00142         movlw   b'10000010'     ;set at_out
  153. 002B 0086           00143         movwf   pb
  154. 002C 3090           00144         movlw   b'10010000'     ;gie,inte=enable intf=clear
  155. 002D 008B           00145 at_g_st movwf   intcon
  156. 002E 3027           00146         movlw   wait
  157. 002F 2827           00147         goto    wait
  158.                     00148 
  159. 0030 1B06           00149 at_g0   btfsc   at_dat_in       ;chk startbit =0
  160. 0031 2848           00150         goto    at_g_rint       ;if not ,return interrupt
  161.                     00151 
  162. 0032 303A           00152         movlw   at_g1
  163. 0033 008C           00153         movwf   int_addr
  164. 0034 3040           00154         movlw   b'01000000'     ;parity chk on bit 6
  165. 0035 0094           00155         movwf   parity
  166. 0036 3008           00156         movlw   8               ;8 databits
  167. 0037 0092           00157         movwf   bit_cnt
  168. 0038 3027           00158         movlw   wait
  169. 0039 0009           00159         retfie
  170.                     00160 
  171. 003A 0806           00161 at_g1   movf    pb,w
  172. 003B 0091           00162         movwf   _temp
  173. Message[305]: Using default destination of 1 (file).
  174. 003C 0D91           00163         rlf     _temp
  175. Message[305]: Using default destination of 1 (file).
  176. 003D 0D91           00164         rlf     _temp
  177. Message[305]: Using default destination of 1 (file).
  178. 003E 0C8E           00165         rrf     _byte
  179. 003F 1B8E           00166         btfsc   par_chk         ;calc parity
  180. Message[305]: Using default destination of 1 (file).
  181. 0040 0994           00167         comf    parity
  182. Message[305]: Using default destination of 1 (file).
  183. 0041 0B92           00168         decfsz  bit_cnt         ;decrease bit counter
  184. 0042 2848           00169         goto    at_g_rint
  185.                     00170 
  186. 0043 304A           00171         movlw   at_par_bit
  187. 0044 008C           00172         movwf   int_addr
  188. 0045 0814           00173         movf    parity,w
  189. 0046 3940           00174         andlw   b'01000000'     ;mask parity bit 6
  190. 0047 0094           00175         movwf   parity
  191. 0048                00176 at_g_rint
  192. 0048 3027           00177         movlw   wait
  193. 0049 0009           00178         retfie
  194.                     00179 
  195. 004A                00180 at_par_bit
  196. 004A 0806           00181         movf    pb,w            ;check if received parity is correct
  197. 004B 3940           00182         andlw   b'01000000'     ;mask parity bit 6
  198. Message[305]: Using default destination of 1 (file).
  199. 004C 0294           00183         subwf   parity
  200. 004D 1903           00184         btfsc   zero
  201. 004E 2854           00185         goto    at_stopbit
  202.                     00186 
  203. 004F 3051           00187         movlw   at_g_rs         ;clean up stack, before resend
  204. 0050 0008           00188         return
  205.                     00189 
  206. 0051 30FE           00190 at_g_rs movlw   cmd_resend      ;error, please resend
  207. 0052 205D           00191         call    at_send
  208. 0053 2828           00192         goto    at_get_key
  209.                     00193 
  210. 0054                00194 at_stopbit
  211. 0054 3058           00195         movlw   at_g3
  212. 0055 008C           00196         movwf   int_addr
  213.                     00197 
  214. 0056 3027           00198         movlw   wait
  215. 0057 0009           00199         retfie
  216.                     00200 
  217. 0058 1C06           00201 at_g3   btfss   at_clk_in       ;wait clk hi
  218. 0059 2858           00202         goto    at_g3
  219. 005A 1086           00203         bcf     at_clk_out
  220. 005B 305C           00204         movlw   at_g4
  221. 005C 0008           00205 at_g4   return                  ;return at_get_key routine
  222.                     00206 ;========-at send-==================================
  223. 005D 008F           00207 at_send movwf   save_byte       ;if resend
  224. 005E                00208 at_resend
  225. 005E 008E           00209         movwf   _byte
  226. 005F 018B           00210         clrf    intcon
  227. 0060 3008           00211         movlw   8
  228. 0061 0092           00212         movwf   bit_cnt
  229. 0062 3001           00213         movlw   1
  230. 0063 0094           00214         movwf   parity
  231. 0064 308D           00215         movlw   at_s
  232. 0065 008C           00216         movwf   int_addr
  233. 0066 3082           00217         movlw   b'10000010'     ;set at_out
  234. 0067 0086           00218         movwf   pb
  235.                     00219 
  236. 0068 0806           00220 chk_bsy movf    pb,w            ;check if at= busy
  237. 0069 3941           00221         andlw   b'01000001'     ;mask at_in bits
  238. 006A 3C41           00222         sublw   b'01000001'
  239. 006B 1D03           00223         btfss   zero
  240. 006C 2868           00224         goto    chk_bsy
  241.                     00225 
  242. 006D 3075           00226         movlw   at_s_parity     ;return addr.
  243. 006E 0095           00227         movwf   at_s_ret
  244. 006F 3090           00228         movlw   b'10010000'     ;gie=enable intf=clear inte=enable
  245. 0070 008B           00229         movwf   intcon
  246. 0071 018A           00230         clrf    pclath
  247. 0072 3027           00231         movlw   wait
  248. 0073 1386           00232         bcf     at_dat_out      ;tell the AT-keyb. we want to transmit
  249. 0074 2827           00233         goto    wait
  250.                     00234 
  251. 0075                00235 at_s_parity                     ;parity, stop & ex bits send routine
  252. 0075 0814           00236         movf    parity,w
  253. 0076 3806           00237         iorlw   b'00000110'     ;set stop & ex-bit
  254. 0077 008E           00238         movwf   _byte
  255. 0078 307F           00239         movlw   at_s_ack        ;return addr.
  256. 0079 0095           00240         movwf   at_s_ret
  257. 007A 3003           00241         movlw   3
  258. 007B 0092           00242         movwf   bit_cnt
  259. 007C 3027           00243         movlw   wait
  260. 007D 178B           00244         bsf     gie             ;enable ints.
  261. 007E 2827           00245         goto    wait
  262.                     00246 
  263. 007F                00247 at_s_ack                        ;at send ack. routine
  264. 007F 1C06           00248         btfss   at_clk_in       ;test clk=hi
  265. 0080 287F           00249         goto    at_s_ack
  266. 0081 30F6           00250         movlw   0xf6            ;short delay
  267. 0082 2100           00251         call    delay
  268. 0083 1086           00252         bcf     at_clk_out      ;ack.
  269. 0084 309C           00253         movlw   0x9c            ;ca:100us
  270. 0085 2100           00254         call    delay
  271. 0086 2028           00255         call    at_get_key      ;get ack. byte
  272. 0087 080E           00256         movf    _byte,w
  273. 0088 3CFE           00257         sublw   cmd_resend      ;if equal, we'll have to  resend
  274. 0089 1D03           00258         btfss   zero
  275. 008A 0008           00259         return
  276.                     00260 
  277. 008B 080F           00261         movf    save_byte,w     ;prepare resend
  278. 008C 285E           00262         goto    at_resend
  279.                     00263 
  280. 008D 0C0E           00264 at_s    rrf     _byte,w
  281. Message[305]: Using default destination of 1 (file).
  282. 008E 0C8E           00265         rrf     _byte
  283. 008F 080E           00266         movf    _byte,w         ;real send routine
  284. 0090 3802           00267         iorlw   b'00000010'     ;set at_clk_out
  285. 0091 0086           00268         movwf   pb
  286. 0092 1B8E           00269         btfsc   par_chk
  287. Message[305]: Using default destination of 1 (file).
  288. 0093 0994           00270         comf    parity
  289. Message[305]: Using default destination of 1 (file).
  290. 0094 0B92           00271         decfsz  bit_cnt
  291. 0095 2898           00272         goto    at_s_r
  292. 0096 0815           00273         movf    at_s_ret,w
  293. 0097 0008           00274         return
  294.                     00275 
  295. 0098 3027           00276 at_s_r  movlw   wait
  296. 0099 0009           00277         retfie
  297.                     00278 
  298.                     00279 ;===================================================
  299. 009A 1D86           00280 _reset  btfss   ami_type        ;check resetmode
  300. 009B 28B5           00281         goto    r_hardreset
  301.                     00282 
  302. 009C 1796           00283         bsf     sync_cd
  303. 009D 300A           00284         movlw   10
  304. 009E 0093           00285         movwf   cnt_dwn
  305. 009F 3078           00286         movlw   rst_warn
  306. 00A0 2200           00287         call    ami_send
  307.                     00288 
  308. 00A1 300A           00289         movlw   10
  309. 00A2 0093           00290         movwf   cnt_dwn
  310. 00A3 1616           00291         bsf     rwarn
  311. 00A4 3078           00292         movlw   rst_warn
  312. 00A5 2200           00293         call    ami_send
  313.                     00294 
  314. 00A6 30B5           00295         movlw   r_hardreset
  315. 00A7 009A           00296         movwf   tmr_ret
  316. 00A8 019B           00297         clrf    tmr_ret_pch
  317. 00A9 3098           00298         movlw   152             ;10s
  318. 00AA 009E           00299         movwf   tmr_cntdwn
  319. 00AB 3069           00300         movlw   -151
  320. 00AC 009F           00301         movwf   tmr_ms
  321. 00AD 019D           00302         clrf    tmr_pch
  322. 00AE 30B0           00303         movlw   r_sync1         ;wait routine addr.
  323. 00AF 2019           00304         call    tmr_init
  324.                     00305 
  325. 00B0 138B           00306 r_sync1 bcf     gie
  326. 00B1 1885           00307         btfsc   ami_dat_in      ;wait kdat hi. max 10s
  327. 00B2 28B5           00308         goto    r_hardreset
  328. 00B3 178B           00309         bsf     gie
  329. 00B4 0082           00310         movwf   pc
  330.                     00311 
  331. 00B5                00312 r_hardreset
  332. 00B5 3001           00313         movlw   1
  333. 00B6 009B           00314         movwf   tmr_ret_pch
  334. Warning[202]: Argument out of range.  Least significant bits used.
  335. 00B7 30C7           00315         movlw   i_1
  336. 00B8 009A           00316         movwf   tmr_ret
  337. 00B9 3007           00317         movlw   7               ;500ms
  338. 00BA 009E           00318         movwf   tmr_cntdwn
  339. 00BB 305F           00319         movlw   -161
  340. 00BC 009F           00320         movwf   tmr_ms
  341. 00BD 1205           00321         bcf     ami_clk         ;hard reset a2000
  342. 00BE 019D           00322         clrf    tmr_pch
  343. 00BF 1185           00323         bcf     _kbreset        ;hard reset a500/a1200
  344. 00C0 3027           00324         movlw   wait
  345. 00C1 2019           00325         call    tmr_init
  346. 00C2 2827           00326         goto    wait
  347.                     00327 
  348.                     00328 ;---------------------------------------------------
  349. 00C3 30B5           00329 r_sync  movlw   r_hardreset     ;wait kdat lo ack. 250ms
  350. 00C4 009A           00330         movwf   tmr_ret
  351. 00C5 019B           00331         clrf    tmr_ret_pch
  352. 00C6 3003           00332         movlw   3               ;3*65536us
  353. 00C7 009E           00333         movwf   tmr_cntdwn
  354. 00C8 302F           00334         movlw   -209            ;(2.5*10^5-3*65536)/256=209
  355. 00C9 009F           00335         movwf   tmr_ms
  356. 00CA 28E1           00336         goto    rw_s
  357.                     00337 ;=======-AmiSync routine-===========================
  358. 00CB 1F96           00338 sync_up btfss   sync_cd
  359. 00CC 28D0           00339         goto    sync_up1
  360. Message[305]: Using default destination of 1 (file).
  361. 00CD 0393           00340         decf    cnt_dwn
  362. 00CE 1903           00341         btfsc   zero
  363. 00CF 28B5           00342         goto    r_hardreset
  364.                     00343 
  365. 00D0                00344 sync_up1
  366. 00D0 1005           00345         bcf     ami_dat_out     ;clock out 1:s
  367. 00D1 30EC           00346         movlw   -20
  368. 00D2 2100           00347         call    delay
  369. 00D3 1205           00348         bcf     ami_clk
  370. 00D4 30EC           00349         movlw   -20
  371. 00D5 2100           00350         call    delay
  372. 00D6 1605           00351         bsf     ami_clk
  373. 00D7 30EC           00352         movlw   -20
  374. 00D8 2100           00353         call    delay
  375. 00D9 1405           00354         bsf     ami_dat_out
  376.                     00355 ;       goto    ami_sync
  377.                     00356 
  378.                     00357 ;---------------------------------------------------
  379. 00DA                00358 ami_sync
  380. 00DA 30CB           00359         movlw   sync_up
  381. 00DB 009A           00360         movwf   tmr_ret
  382. 00DC 019B           00361         clrf    tmr_ret_pch
  383. 00DD 3002           00362         movlw   2               ;2*65536us
  384. 00DE 009E           00363         movwf   tmr_cntdwn
  385. 00DF 30D1           00364         movlw   -47             ;remaining (1.43*10^5-2*65536)/256=47
  386. 00E0 009F           00365         movwf   tmr_ms
  387. 00E1 30FF           00366 rw_s    movlw   0xff            ;set all ami_outputs
  388. 00E2 0085           00367         movwf   pa
  389. 00E3 019D           00368         clrf    tmr_pch
  390. 00E4 30E6           00369         movlw   sync_1          ;wait routine addr.
  391. 00E5 2019           00370         call    tmr_init        ;init long delay
  392.                     00371 
  393. 00E6 138B           00372 sync_1  bcf     gie
  394. 00E7 1C85           00373         btfss   ami_dat_in      ;wait lo ack. 143ms
  395. 00E8 28EB           00374         goto    sync_2
  396. 00E9 178B           00375         bsf     gie
  397. 00EA 0082           00376         movwf   pc
  398.                     00377 
  399. 00EB 2013           00378 sync_2  call    tmr_end         ;deinit long delay
  400.                     00379 
  401. 00EC 1A16           00380         btfsc   rwarn
  402. 00ED 0008           00381         return
  403.                     00382 
  404. 00EE 1C85           00383 sync_3  btfss   ami_dat_in      ;wait ack. end
  405. 00EF 28EE           00384         goto    sync_3
  406. 00F0 0008           00385         return
  407.                     00386 
  408. 0100                00387         org     0x100
  409.                     00388 ;=======-Delay routine-=============================
  410. 0100 0081           00389 delay   movwf   tmr0
  411. 0101 308F           00390         movlw   b'10001111'
  412. Warning[224]: Use of this instruction is not recommended.
  413. 0102 0062           00391         option
  414. 0103 128B           00392         bcf     t0ie            ;disable tmr int.
  415. 0104 110B           00393         bcf     t0if
  416. 0105 1D0B           00394 dly     btfss   t0if
  417. 0106 2905           00395         goto    dly
  418. 0107 0008           00396         return
  419.                     00397 
  420.                     00398 ;===================================================
  421. 0108                00399 translate
  422. 0108 140A           00400         bsf     pch_0
  423. 0109 108A           00401         bcf     pch_1
  424. 010A 080D           00402         movf    trans_addr,w
  425. 010B 0082           00403         movwf   pc
  426.                     00404 ;---------------------------------------------------
  427. 010C 080E           00405 t_chk   movf    _byte,w
  428. 010D 3CE1           00406         sublw   0xe1            ;pause
  429. 010E 1903           00407         btfsc   zero
  430. 010F 2994           00408         goto    s_pause
  431.                     00409 
  432. 0110 1016           00410         bcf     p_res           ;reset pause flag
  433.                     00411 
  434. 0111 080E           00412         movf    _byte,w
  435. 0112 3CE0           00413         sublw   0xe0            ;arrowkeys etc.
  436. 0113 1903           00414         btfsc   zero
  437. 0114 2932           00415         goto    t_e0
  438.                     00416 
  439. 0115 0199           00417         clrf    e0_l_byte
  440.                     00418 
  441. 0116 080E           00419         movf    _byte,w
  442. 0117 3CF0           00420         sublw   0xf0            ;break code
  443. 0118 1903           00421         btfsc   zero
  444. 0119 2925           00422         goto    t_break
  445.                     00423 
  446. 011A 1316           00424         bcf     s_break         ;reset "special mission keys" break flag
  447.                     00425 
  448. 011B 0818           00426         movf    l_byte,w        ;get rid of repeating chars
  449. 011C 020E           00427         subwf   _byte,w
  450. 011D 1D03           00428         btfss   zero
  451. 011E 2922           00429         goto    not_eq
  452. 011F 30FF           00430         movlw   no_send
  453. 0120 0090           00431         movwf   ami_byte
  454. 0121 0008           00432         return
  455.                     00433 
  456. 0122 080E           00434 not_eq  movf    _byte,w
  457. 0123 0098           00435         movwf   l_byte
  458. 0124 2B01           00436         goto    table
  459.                     00437 
  460.                     00438 ;---------------------------------------------------
  461. 0125 0198           00439 t_break clrf    l_byte
  462. 0126 1716           00440         bsf     s_break
  463. Warning[202]: Argument out of range.  Least significant bits used.
  464. 0127 302C           00441         movlw   t_b1
  465. 0128 008D           00442         movwf   trans_addr
  466. 0129 30FF           00443         movlw   no_send
  467. 012A 0090           00444         movwf   ami_byte
  468. 012B 0008           00445         return
  469.                     00446 
  470. Warning[202]: Argument out of range.  Least significant bits used.
  471. 012C 300C           00447 t_b1    movlw   t_chk
  472. 012D 008D           00448         movwf   trans_addr
  473.                     00449 
  474. 012E 080E           00450         movf    _byte,w
  475. 012F 2301           00451         call    table
  476. 0130 1790           00452         bsf     _break
  477. 0131 0008           00453         return
  478.                     00454 ;---------------------------------------------------
  479. 0132 0198           00455 t_e0    clrf    l_byte
  480. 0133 1316           00456         bcf     s_break
  481. Warning[202]: Argument out of range.  Least significant bits used.
  482. 0134 3039           00457         movlw   t_e01
  483. 0135 008D           00458         movwf   trans_addr
  484. 0136 30FF           00459         movlw   no_send
  485. 0137 0090           00460         movwf   ami_byte
  486. 0138 0008           00461         return
  487.                     00462 
  488. 0139 080E           00463 t_e01   movf    _byte,w
  489. 013A 3CF0           00464         sublw   0xf0            ;break
  490. 013B 1903           00465         btfsc   zero
  491. 013C 2946           00466         goto    t_e0_b
  492.                     00467 
  493. Warning[202]: Argument out of range.  Least significant bits used.
  494. 013D 300C           00468         movlw   t_chk
  495. 013E 008D           00469         movwf   trans_addr
  496.                     00470 
  497. 013F 0819           00471         movf    e0_l_byte,w     ;get rid of repeating chars
  498. 0140 020E           00472         subwf   _byte,w
  499. 0141 1903           00473         btfsc   zero
  500. 0142 0008           00474         return
  501.                     00475 
  502. 0143 080E           00476         movf    _byte,w
  503. 0144 0099           00477         movwf   e0_l_byte
  504. 0145 2B00           00478         goto    e0_table
  505.                     00479 
  506. 0146 1716           00480 t_e0_b  bsf     s_break
  507. Warning[202]: Argument out of range.  Least significant bits used.
  508. 0147 304B           00481         movlw   t_e0_b1
  509. 0148 008D           00482         movwf   trans_addr
  510. 0149 0199           00483         clrf    e0_l_byte
  511. 014A 0008           00484         return
  512.                     00485 
  513. Warning[202]: Argument out of range.  Least significant bits used.
  514. 014B 300C           00486 t_e0_b1 movlw   t_chk
  515. 014C 008D           00487         movwf   trans_addr
  516.                     00488 
  517. 014D 080E           00489         movf    _byte,w
  518. 014E 2300           00490         call    e0_table
  519. 014F 1790           00491         bsf     _break
  520. 0150 0008           00492         return
  521.                     00493 
  522.                     00494 ;=======-special mission keys-======================
  523.                     00495 
  524. 0151 1B16           00496 s_home  btfsc   s_break
  525. 0152 2956           00497         goto    s_home_b
  526. 0153 3061           00498         movlw   0x61            ;right shift
  527. 0154 2200           00499         call    ami_send
  528. 0155 344F           00500         retlw   0x4f            ;arrow left
  529. 0156                00501 s_home_b
  530. 0156 30CF           00502         movlw   0x4f+0x80
  531. 0157 2200           00503         call    ami_send
  532. 0158 34E1           00504         retlw   0x61+0x80
  533.                     00505 ;---------------------------------------------------
  534. 0159 1B16           00506 s_end   btfsc   s_break
  535. 015A 295E           00507         goto    s_end_b
  536. 015B 3061           00508         movlw   0x61            ;right shift
  537. 015C 2200           00509         call    ami_send
  538. 015D 344E           00510         retlw   0x4e            ;arrow right
  539. 015E 30CE           00511 s_end_b movlw   0x4e+0x80
  540. 015F 2200           00512         call    ami_send
  541. 0160 34E1           00513         retlw   0x61+0x80
  542.                     00514 ;---------------------------------------------------
  543. 0161                00515 s_pageup
  544. 0161 1B16           00516         btfsc   s_break
  545. 0162 2966           00517         goto    s_pageup_b
  546. 0163 3061           00518         movlw   0x61            ;right shift
  547. 0164 2200           00519         call    ami_send
  548. 0165 344C           00520         retlw   0x4c            ;arrow up
  549. 0166                00521 s_pageup_b
  550. 0166 30CC           00522         movlw   0x4c+0x80       ;arrow up + break
  551. 0167 2200           00523         call    ami_send
  552. 0168 34E1           00524         retlw   0x61+0x80       ;right shift + break
  553.                     00525 ;---------------------------------------------------
  554. 0169                00526 s_pagedown
  555. 0169 1B16           00527         btfsc   s_break
  556. 016A 296E           00528         goto    s_pagedown_b
  557. 016B 3061           00529         movlw   0x61            ;right shift
  558. 016C 2200           00530         call    ami_send
  559. 016D 344D           00531         retlw   0x4d            ;arrow down
  560. 016E                00532 s_pagedown_b
  561. 016E 30CD           00533         movlw   0x4d+0x80       ;arrow down + break
  562. 016F 2200           00534         call    ami_send
  563. 0170 34E1           00535         retlw   0x61+0x80       ;right shift + break
  564.                     00536 ;---------------------------------------------------
  565. 0171                00537 s_c_screen
  566. 0171 1B16           00538         btfsc   s_break
  567. 0172 2976           00539         goto    s_c_screen_b
  568. 0173 3066           00540         movlw   0x66            ;left amiga
  569. 0174 2200           00541         call    ami_send
  570. 0175 3437           00542         retlw   0x37            ;m
  571. 0176                00543 s_c_screen_b
  572. 0176 30B7           00544         movlw   0x37+0x80       ;m + break
  573. 0177 2200           00545         call    ami_send
  574. 0178 34E6           00546         retlw   0x66+0x80       ;left amiga + break
  575.                     00547 ;---------------------------------------------------
  576. 0179 1496           00548 s_ctrl  bsf     rw_ctrl
  577. 017A 1B16           00549         btfsc   s_break
  578. 017B 1096           00550         bcf     rw_ctrl
  579. 017C 3463           00551         retlw   0x63
  580.                     00552 ;---------------------------------------------------
  581. 017D                00553 s_lamiga
  582. 017D 1516           00554         bsf     rw_lalt
  583. 017E 1B16           00555         btfsc   s_break
  584. 017F 1116           00556         bcf     rw_lalt
  585. 0180 3466           00557         retlw   0x66
  586.                     00558 ;---------------------------------------------------
  587. 0181                00559 s_ramiga
  588. 0181 1596           00560         bsf     rw_ralt
  589. 0182 1B16           00561         btfsc   s_break
  590. 0183 1196           00562         bcf     rw_ralt
  591. 0184 3467           00563         retlw   0x67
  592.                     00564 ;---------------------------------------------------
  593. 0185 1B16           00565 s_caps  btfsc   s_break
  594. 0186 34FF           00566         retlw   no_send
  595.                     00567 
  596. 0187 018A           00568         clrf    pclath
  597. 0188 30ED           00569         movlw   cmd_option
  598. 0189 205D           00570         call    at_send
  599.                     00571 
  600. 018A 1D17           00572         btfss   c_lock          ;chk capslock= on
  601. 018B 2990           00573         goto    s_c_on
  602.                     00574 
  603. 018C 1117           00575         bcf     c_lock          ;capslock off
  604. 018D 0817           00576         movf    leds,w
  605. 018E 205D           00577         call    at_send
  606. 018F 34E2           00578         retlw   0x62+0x80       ;capslock + break
  607.                     00579 
  608. 0190 1517           00580 s_c_on  bsf     c_lock          ;capslock on
  609. 0191 0817           00581         movf    leds,w
  610. 0192 205D           00582         call    at_send
  611. 0193 3462           00583         retlw   0x62            ;capslock
  612.                     00584 ;---------------------------------------------------
  613. 0194 0198           00585 s_pause clrf    l_byte
  614. 0195 0199           00586         clrf    e0_l_byte
  615. Warning[202]: Argument out of range.  Least significant bits used.
  616. 0196 309D           00587         movlw   s_p1
  617. 0197 008D           00588         movwf   trans_addr
  618. 0198 3007           00589         movlw   7               ;receive 7 more pause bytes,
  619. 0199 0093           00590         movwf   cnt_dwn         ;waste of time don't u think :-)
  620. 019A 30FF           00591         movlw   no_send
  621. 019B 0090           00592         movwf   ami_byte
  622. 019C 0008           00593         return
  623.                     00594 
  624. Message[305]: Using default destination of 1 (file).
  625. 019D 0B93           00595 s_p1    decfsz  cnt_dwn
  626. 019E 0008           00596         return
  627.                     00597 
  628. 019F 1816           00598         btfsc   p_res           ;chk if pause pressed twice
  629. 01A0 289A           00599         goto    _reset          ;p_res = hi -> hardreset
  630.                     00600 
  631. 01A1 1416           00601         bsf     p_res
  632. Warning[202]: Argument out of range.  Least significant bits used.
  633. 01A2 300C           00602         movlw   t_chk
  634. 01A3 008D           00603         movwf   trans_addr
  635. 01A4 0008           00604         return
  636.                     00605 
  637.                     00606 ;===================================================
  638. 01A5 307D           00607 init    movlw   b'01111101'     ;0=output 1=input
  639. Warning[224]: Use of this instruction is not recommended.
  640. 01A6 0066           00608         tris    pb
  641. 01A7 30E6           00609         movlw   b'11100110'
  642. Warning[224]: Use of this instruction is not recommended.
  643. 01A8 0065           00610         tris    pa
  644. 01A9 308F           00611         movlw   b'10001111'     ;pull up pb disable,falling edge
  645. Warning[224]: Use of this instruction is not recommended.
  646. 01AA 0062           00612         option                  ;assign prescaler to wdt, presc. 128
  647.                     00613 
  648.                     00614 ;---------------------------------------------------
  649. 01AB                00615 at_startup
  650. 01AB 3002           00616         movlw   2
  651. 01AC 009B           00617         movwf   tmr_ret_pch
  652. Warning[202]: Argument out of range.  Least significant bits used.
  653. 01AD 30BA           00618         movlw   at_st_ret
  654. 01AE 009A           00619         movwf   tmr_ret
  655. 01AF 304C           00620         movlw   76              ;wdt 5s
  656. 01B0 009E           00621         movwf   tmr_cntdwn
  657. 01B1 30B5           00622         movlw   -75             ;(5*10^6-76*256²)/256=75
  658. 01B2 009F           00623         movwf   tmr_ms
  659. 01B3 019D           00624         clrf    tmr_pch
  660. 01B4 3027           00625         movlw   wait
  661. 01B5 2019           00626         call    tmr_init
  662.                     00627 
  663. 01B6 3030           00628         movlw   at_g0
  664. 01B7 008C           00629         movwf   int_addr
  665. 01B8 30B0           00630         movlw   b'10110000'     ;gie,t0ie,inte=enable t0if,intf=reset
  666. 01B9 202D           00631         call    at_g_st
  667.                     00632 
  668.                     00633 ;---------------------------------------------------
  669. 01BA                00634 at_st_ret
  670. 01BA 1086           00635         bcf     at_clk_out
  671. 01BB 300F           00636         movlw   15              ;delay 1s
  672. 01BC 009E           00637         movwf   tmr_cntdwn
  673. 01BD 30BE           00638         movlw   -66             ;(10^6-15*256²)/256=66
  674. 01BE 009F           00639         movwf   tmr_ms
  675. 01BF 3001           00640         movlw   1
  676. 01C0 009B           00641         movwf   tmr_ret_pch
  677. Warning[202]: Argument out of range.  Least significant bits used.
  678. 01C1 30C7           00642         movlw   i_1
  679. 01C2 009A           00643         movwf   tmr_ret
  680. 01C3 019D           00644         clrf    tmr_pch
  681. 01C4 3027           00645         movlw   wait
  682. 01C5 2019           00646         call    tmr_init
  683. 01C6 2827           00647         goto    wait
  684.                     00648 ;---------------------------------------------------
  685.                     00649 
  686. 01C7 0196           00650 i_1     clrf    x_flag          ;init "xtra flag" reg.
  687. 01C8 0198           00651         clrf    l_byte          ;init last byte chk
  688. 01C9 0199           00652         clrf    e0_l_byte
  689.                     00653 
  690. 01CA 30FF           00654         movlw   cmd_reset       ;at reset
  691. 01CB 205D           00655         call    at_send
  692. 01CC 2028           00656         call    at_get_key      ;receive 0xaa= bat/selftest complete
  693.                     00657 
  694. 01CD 30F6           00658         movlw   cmd_default
  695. 01CE 205D           00659         call    at_send
  696.                     00660 
  697. 01CF 30ED           00661         movlw   cmd_option      ;at option cmd.
  698. 01D0 205D           00662         call    at_send
  699.                     00663 
  700. 01D1 3004           00664         movlw   b'00000100'     ;capslock on
  701. 01D2 205D           00665         call    at_send
  702.                     00666 
  703. 01D3 1796           00667         bsf     sync_cd         ;enable sync-countdown
  704. 01D4 3032           00668         movlw   50              ;if sync does not arrive within 50 retries,
  705. 01D5 0093           00669         movwf   cnt_dwn         ;then hard reset
  706. 01D6 20CB           00670         call    sync_up         ;synchronize with amiga
  707.                     00671 
  708. 01D7 300A           00672         movlw   10
  709. 01D8 0093           00673         movwf   cnt_dwn
  710. 01D9 30FD           00674         movlw   pwr_up          ;power up key stream
  711. 01DA 2200           00675         call    ami_send
  712.                     00676 
  713. 01DB 300A           00677         movlw   10
  714. 01DC 0093           00678         movwf   cnt_dwn
  715. 01DD 30FE           00679         movlw   t_pwr_up        ;terminate key stream
  716. 01DE 2200           00680         call    ami_send
  717. 01DF 1396           00681         bcf     sync_cd         ;disable sync-countdown
  718.                     00682 
  719. 01E0 30ED           00683         movlw   cmd_option
  720. 01E1 205D           00684         call    at_send
  721.                     00685 
  722. 01E2 0197           00686         clrf    leds            ;all leds off
  723. 01E3 0103           00687         clrw
  724. 01E4 205D           00688         call    at_send
  725.                     00689 
  726. Warning[202]: Argument out of range.  Least significant bits used.
  727. 01E5 300C           00690         movlw   t_chk
  728. 01E6 008D           00691         movwf   trans_addr      ;init trans_addr
  729.                     00692 
  730.                     00693 ;=======-Main Loop-=================================
  731. 01E7 018A           00694 loop    clrf    pclath
  732. 01E8 2028           00695         call    at_get_key
  733. 01E9 2108           00696         call    translate       ;atcode -> amigacode
  734.                     00697 
  735. 01EA 0816           00698         movf    x_flag,w
  736. 01EB 390E           00699         andlw   b'00001110'
  737. 01EC 3C0E           00700         sublw   b'00001110'     ;chk reset warning
  738. 01ED 1903           00701         btfsc   zero
  739. 01EE 289A           00702         goto    _reset
  740.                     00703 
  741. 01EF 0810           00704         movf    ami_byte,w
  742. 01F0 3CFF           00705         sublw   no_send         ;0xff = no amisend
  743. 01F1 1903           00706         btfsc   zero
  744. 01F2 29E7           00707         goto    loop
  745.                     00708 
  746. 01F3 0810           00709         movf    ami_byte,w
  747. 01F4 2200           00710         call    ami_send
  748. 01F5 29E7           00711         goto    loop
  749.                     00712 
  750. 0200                00713         org     0x200
  751.                     00714 ;=======-Amiga Send-================================
  752. 0200                00715 ami_send
  753. 0200 018B           00716         clrf    intcon          ;disable all interrupts
  754. 0201 0090           00717         movwf   ami_byte
  755. 0202 0D10           00718         rlf     ami_byte,w      ;put bit #7 first
  756. Message[305]: Using default destination of 1 (file).
  757. 0203 0D90           00719         rlf     ami_byte
  758. Message[305]: Using default destination of 1 (file).
  759. 0204 0990           00720         comf    ami_byte        ;& invert, according to rkm hw-ref
  760. 0205 30FF           00721         movlw   0xff            ;set ami out
  761. 0206 0085           00722         movwf   pa
  762. 0207 3008           00723         movlw   8               ;8 bits to transmit
  763. 0208 0092           00724         movwf   bit_cnt
  764.                     00725 
  765. 0209 0D10           00726 ami_out rlf     ami_byte,w
  766. Message[305]: Using default destination of 1 (file).
  767. 020A 0D90           00727         rlf     ami_byte
  768. 020B 0810           00728         movf    ami_byte,w
  769. 020C 3818           00729         iorlw   b'00011000'     ;set ami_clk & _kbreset
  770. 020D 0085           00730         movwf   pa
  771. 020E 30EC           00731         movlw   -20             ;20us
  772. 020F 2100           00732         call    delay
  773. 0210 1205           00733         bcf     ami_clk
  774. 0211 30EC           00734         movlw   -20
  775. 0212 2100           00735         call    delay
  776. 0213 1605           00736         bsf     ami_clk
  777. 0214 30EC           00737         movlw   -20
  778. 0215 2100           00738         call    delay
  779. Message[305]: Using default destination of 1 (file).
  780. 0216 0B92           00739         decfsz  bit_cnt
  781. 0217 2A09           00740         goto    ami_out
  782. 0218 1405           00741         bsf     ami_dat_out
  783.                     00742 
  784. 0219 1A16           00743         btfsc   rwarn           ;chk if in resetmode
  785. 021A 28C3           00744         goto    r_sync          ;then wait 250ms for ack.
  786.                     00745 
  787. 021B 28DA           00746         goto    ami_sync        ;wait 143ms for ack.
  788.                     00747 
  789.                     00748 
  790. 0300                00749         org     0x300
  791.                     00750 ;======-key lookup table-===========================
  792. 0300                00751 e0_table
  793. 0300 3E70           00752         addlw   0x70    ;correct the keylookup-table to work with e0xx-codes
  794.                     00753 
  795. 0301 2304           00754 table   call    tab
  796. 0302 0090           00755         movwf   ami_byte
  797. 0303 0008           00756         return
  798.                     00757 
  799. 0304 140A           00758 tab     bsf     pch_0
  800. 0305 148A           00759         bsf     pch_1
  801. Message[305]: Using default destination of 1 (file).
  802. 0306 0782           00760         addwf   pc
  803.                     00761 
  804. 0307 34FF           00762         fill (retlw no_send),1
  805. 0308 3458           00763         retlw   0x58            ;f9     =0x01
  806. 0309 34FF           00764         fill (retlw no_send),1
  807. 030A 3454           00765         retlw   0x54            ;f5     =0x03
  808. 030B 3452           00766         retlw   0x52            ;f3     =0x04
  809. 030C 3450           00767         retlw   0x50            ;f1     =0x05
  810. 030D 3451           00768         retlw   0x51            ;f2     =0x06
  811. 030E 345B           00769         retlw   0x5b            ;f12    =0x07 -> ]}
  812. 030F 34FF           00770         fill (retlw no_send),1
  813. 0310 3459           00771         retlw   0x59            ;f10    =0x09
  814. 0311 3457           00772         retlw   0x57            ;f8     =0x0a
  815. 0312 3455           00773         retlw   0x55            ;f6     =0x0b
  816. 0313 3453           00774         retlw   0x53            ;f4     =0x0c
  817. 0314 3442           00775         retlw   0x42            ;tab    =0x0d
  818. 0315 3400           00776         retlw   0x00            ;`~     =0x0e
  819. 0316 34FF           00777         fill (retlw no_send),2
  820. 0318 3464           00778         retlw   0x64            ;l alt  =0x11
  821. 0319 3460           00779         retlw   0x60            ;l shift=0x12
  822. 031A 34FF           00780         fill (retlw no_send),1
  823. 031B 2979           00781         goto    s_ctrl          ;l ctrl =0x14
  824. 031C 3410           00782         retlw   0x10            ;Q      =0x15
  825. 031D 3401           00783         retlw   0x01            ;1      =0x16
  826. 031E 34FF           00784         fill (retlw no_send),3
  827. 0321 3431           00785         retlw   0x31            ;Z      =0x1a
  828. 0322 3421           00786         retlw   0x21            ;S      =0x1b
  829. 0323 3420           00787         retlw   0x20            ;A      =0x1c
  830. 0324 3411           00788         retlw   0x11            ;W      =0x1d
  831. 0325 3402           00789         retlw   0x02            ;2      =0x1e
  832. 0326 34FF           00790         fill (retlw no_send),2
  833. 0328 3433           00791         retlw   0x33            ;C      =0x21
  834. 0329 3432           00792         retlw   0x32            ;X      =0x22
  835. 032A 3422           00793         retlw   0x22            ;D      =0x23
  836. 032B 3412           00794         retlw   0x12            ;E      =0x24
  837. 032C 3404           00795         retlw   0x04            ;4      =0x25
  838. 032D 3403           00796         retlw   0x03            ;3      =0x26
  839. 032E 34FF           00797         fill (retlw no_send),2
  840. 0330 3440           00798         retlw   0x40            ;space  =0x29
  841. 0331 3434           00799         retlw   0x34            ;V      =0x2a
  842. 0332 3423           00800         retlw   0x23            ;F      =0x2b
  843. 0333 3414           00801         retlw   0x14            ;T      =0x2c
  844. 0334 3413           00802         retlw   0x13            ;R      =0x2d
  845. 0335 3405           00803         retlw   0x05            ;5      =0x2e
  846. 0336 34FF           00804         fill (retlw no_send),2
  847. 0338 3436           00805         retlw   0x36            ;N      =0x31
  848. 0339 3435           00806         retlw   0x35            ;B      =0x32
  849. 033A 3425           00807         retlw   0x25            ;H      =0x33
  850. 033B 3424           00808         retlw   0x24            ;G      =0x34
  851. 033C 3415           00809         retlw   0x15            ;Y      =0x35
  852. 033D 3406           00810         retlw   0x06            ;6      =0x36
  853. 033E 34FF           00811         fill (retlw no_send),3
  854. 0341 3437           00812         retlw   0x37            ;M      =0x3a
  855. 0342 3426           00813         retlw   0x26            ;J      =0x3b
  856. 0343 3416           00814         retlw   0x16            ;U      =0x3c
  857. 0344 3407           00815         retlw   0x07            ;7      =0x3d
  858. 0345 3408           00816         retlw   0x08            ;8      =0x3e
  859. 0346 34FF           00817         fill (retlw no_send),2
  860. 0348 3438           00818         retlw   0x38            ;;,     =0x41
  861. 0349 3427           00819         retlw   0x27            ;K      =0x42
  862. 034A 3417           00820         retlw   0x17            ;I      =0x43
  863. 034B 3418           00821         retlw   0x18            ;O      =0x44
  864. 034C 340A           00822         retlw   0x0a            ;0      =0x45
  865. 034D 3409           00823         retlw   0x09            ;9      =0x46
  866. 034E 34FF           00824         fill (retlw no_send),2
  867. 0350 3439           00825         retlw   0x39            ;:.     =0x49
  868. 0351 343A           00826         retlw   0x3a            ;_-     =0x4a
  869. 0352 3428           00827         retlw   0x28            ;L      =0x4b
  870. 0353 3429           00828         retlw   0x29            ;ö      =0x4c
  871. 0354 3419           00829         retlw   0x19            ;P      =0x4d
  872. 0355 340B           00830         retlw   0x0b            ;+      =0x4e
  873. 0356 34FF           00831         fill (retlw no_send),3
  874. 0359 342A           00832         retlw   0x2a            ;Ä      =0x52
  875. 035A 34FF           00833         fill (retlw no_send),1
  876. 035B 341A           00834         retlw   0x1a            ;Å      =0x54
  877. 035C 340C           00835         retlw   0x0c            ;=+     =0x55
  878. 035D 34FF           00836         fill (retlw no_send),2
  879. 035F 2985           00837         goto    s_caps          ;caps l.=0x58
  880. 0360 3461           00838         retlw   0x61            ;r shift=0x59
  881. 0361 3444           00839         retlw   0x44            ;return =0x5a
  882. 0362 341B           00840         retlw   0x1b            ;]      =0x5b
  883. 0363 34FF           00841         fill (retlw no_send),1
  884. 0364 342B           00842         retlw   0x2b            ;*'     =0x5d
  885. 0365 34FF           00843         fill (retlw no_send),3
  886. 0368 3430           00844         retlw   0x30            ;<>     =0x61
  887. 0369 34FF           00845         fill (retlw no_send),4
  888. 036D 3441           00846         retlw   0x41            ;bs     =0x66
  889. 036E 34FF           00847         fill (retlw no_send),2
  890. 0370 341D           00848         retlw   0x1d            ;kp1    =0x69
  891. 0371 34FF           00849         fill (retlw no_send),1
  892. 0372 342D           00850         retlw   0x2d            ;kp4    =0x6b
  893. 0373 343D           00851         retlw   0x3d            ;kp7    =0x6c
  894. 0374 34FF           00852         fill (retlw no_send),3
  895. 0377 340F           00853         retlw   0x0f            ;kp0    =0x70
  896. 0378 343C           00854         retlw   0x3c            ;kp.    =0x71
  897. 0379 341E           00855         retlw   0x1e            ;kp2    =0x72
  898. 037A 342E           00856         retlw   0x2e            ;kp5    =0x73
  899. 037B 342F           00857         retlw   0x2f            ;kp6    =0x74
  900. 037C 343E           00858         retlw   0x3e            ;kp8    =0x75
  901. 037D 3445           00859         retlw   0x45            ;esc    =0x76
  902. 037E 345A           00860         retlw   0x5a            ;numlock=0x77
  903. 037F 340D           00861         retlw   0x0d            ;f11    =0x78 -> \|
  904. 0380 345E           00862         retlw   0x5e            ;kp+    =0x79
  905. 0381 341F           00863         retlw   0x1f            ;kp3    =0x7a
  906. 0382 344A           00864         retlw   0x4a            ;kp-    =0x7b
  907. 0383 345D           00865         retlw   0x5d            ;kp*    =0x7c
  908. 0384 343F           00866         retlw   0x3f            ;kp9    =0x7d
  909. 0385 2985           00867         goto    s_caps          ;scrl l.=0x7e -> caps lock
  910. 0386 34FF           00868         fill (retlw no_send),2
  911. 0388 3465           00869         retlw   0x65            ;r alt  =0x11
  912. 0389 34FF           00870         retlw   no_send         ;l shift=0x12 (numlock x-byte +lshift)
  913. 038A 3456           00871         retlw   0x56            ;f7     =0x83
  914. 038B 2979           00872         goto    s_ctrl          ;r ctrl =0x14
  915. 038C 34FF           00873         fill (retlw no_send),0x1f-0x14-1
  916. 0396 297D           00874         goto    s_lamiga        ;win95  =0x1f
  917. 0397 34FF           00875         fill (retlw no_send),0x27-0x1f-1
  918. 039E 2981           00876         goto    s_ramiga        ;win95  =0x27
  919. 039F 34FF           00877         fill (retlw no_send),0x2f-0x27-1
  920. 03A6 2971           00878         goto    s_c_screen      ;menu95 =0x2f
  921. 03A7 34FF           00879         fill (retlw no_send),0x4a-0x2f-1
  922. 03C1 345C           00880         retlw   0x5c            ;kp/    =0x4a
  923. 03C2 34FF           00881         fill (retlw no_send),14
  924. 03D0 34FF           00882         retlw   no_send         ;r shift=0x59 (useless x-byte)
  925. 03D1 3443           00883         retlw   0x43            ;enter  =0x5a
  926. 03D2 34FF           00884         fill (retlw no_send),14
  927. 03E0 2959           00885         goto    s_end           ;end    =0x69
  928. 03E1 34FF           00886         fill (retlw no_send),1
  929. 03E2 344F           00887         retlw   0x4f            ;l arrow=0x6b
  930. 03E3 2951           00888         goto    s_home          ;home   =0x6c
  931. 03E4 34FF           00889         fill (retlw no_send),3
  932. 03E7 345F           00890         retlw   0x5f            ;insert =0x70 -> help
  933. 03E8 3446           00891         retlw   0x46            ;delete =0x71
  934. 03E9 344D           00892         retlw   0x4d            ;d arrow=0x72
  935. 03EA 34FF           00893         fill (retlw no_send),1
  936. 03EB 344E           00894         retlw   0x4e            ;r arrow=0x74
  937. 03EC 344C           00895         retlw   0x4c            ;u arrow=0x75
  938. 03ED 34FF           00896         fill (retlw no_send),4
  939. 03F1 2969           00897         goto    s_pagedown      ;pagedn =0x7a
  940. 03F2 34FF           00898         fill (retlw no_send),1
  941. 03F3 2971           00899         goto    s_c_screen      ;print s=0x7c
  942. 03F4 2961           00900         goto    s_pageup        ;pageup =0x7d
  943.                     00901 
  944.                     00902         end
  945. MPASM 01.40 Released         KEYB_W95.ASM   8-11-1996  13:45:29         PAGE  2
  946.  
  947.  
  948. SYMBOL TABLE
  949.   LABEL                             VALUE 
  950.  
  951. __16C84                           00000001
  952. _break                            ami_byte,7
  953. _byte                             0000000E
  954. _kbreset                          pa,3
  955. _reset                            0000009A
  956. _temp                             00000011
  957. ami_byte                          00000010
  958. ami_clk                           pa,4
  959. ami_dat_in                        pa,1
  960. ami_dat_out                       pa,0
  961. ami_out                           00000209
  962. ami_send                          00000200
  963. ami_sync                          000000DA
  964. ami_type                          pb,3
  965. at_clk                            00000024
  966. at_clk_in                         pb,0
  967. at_clk_out                        pb,1
  968. at_dat_in                         pb,6
  969. at_dat_out                        pb,7
  970. at_g0                             00000030
  971. at_g1                             0000003A
  972. at_g3                             00000058
  973. at_g4                             0000005C
  974. at_g_rint                         00000048
  975. at_g_rs                           00000051
  976. at_g_st                           0000002D
  977. at_get_key                        00000028
  978. at_par_bit                        0000004A
  979. at_resend                         0000005E
  980. at_s                              0000008D
  981. at_s_ack                          0000007F
  982. at_s_parity                       00000075
  983. at_s_r                            00000098
  984. at_s_ret                          00000015
  985. at_send                           0000005D
  986. at_st_ret                         000001BA
  987. at_startup                        000001AB
  988. at_stopbit                        00000054
  989. bit_cnt                           00000012
  990. c_lock                            leds,2
  991. carry                             status,0
  992. chk_bsy                           00000068
  993. cmd_default                       000000F6
  994. cmd_option                        000000ED
  995. cmd_resend                        000000FE
  996. cmd_reset                         000000FF
  997. cmd_typematic                     000000F3
  998. cnt_dwn                           00000013
  999. delay                             00000100
  1000. dly                               00000105
  1001. dummy                             00000007
  1002. e0_l_byte                         00000019
  1003. e0_table                          00000300
  1004. eeadr                             00000009
  1005. eedata                            00000008
  1006. eeie                              intcon,6
  1007. eeif                              eecon1,4
  1008. fsr                               00000004
  1009. gie                               intcon,7
  1010. i_1                               000001C7
  1011. init                              000001A5
  1012. int_addr                          0000000C
  1013. intcon                            0000000B
  1014. inte                              intcon,4
  1015. intf                              intcon,1
  1016. l_byte                            00000018
  1017. leds                              00000017
  1018. loop                              000001E7
  1019. no_send                           FFFFFFFF
  1020. not_eq                            00000122
  1021. p_res                             x_flag,0
  1022. pa                                00000005
  1023. par_chk                           _byte,7
  1024. parity                            00000014
  1025. pb                                00000006
  1026. pc                                00000002
  1027. pch_0                             pclath,0
  1028. pch_1                             pclath,1
  1029. pclath                            0000000A
  1030. pwr_up                            000000FD
  1031. r_hardreset                       000000B5
  1032. r_sync                            000000C3
  1033. r_sync1                           000000B0
  1034. rbie                              intcon,3
  1035. rbif                              intcon,0
  1036. rd                                eecon1,0
  1037. rp0                               status,5
  1038. rst_warn                          00000078
  1039. rw_ctrl                           x_flag,1
  1040. rw_lalt                           x_flag,2
  1041. rw_ralt                           x_flag,3
  1042. rw_s                              000000E1
  1043. rwarn                             x_flag,4
  1044. s_break                           x_flag,6
  1045. s_c_on                            00000190
  1046. s_c_screen                        00000171
  1047. s_c_screen_b                      00000176
  1048. s_caps                            00000185
  1049. s_ctrl                            00000179
  1050. s_end                             00000159
  1051. s_end_b                           0000015E
  1052. s_home                            00000151
  1053. s_home_b                          00000156
  1054. s_lamiga                          0000017D
  1055. s_p1                              0000019D
  1056. s_pagedown                        00000169
  1057. s_pagedown_b                      0000016E
  1058. s_pageup                          00000161
  1059. s_pageup_b                        00000166
  1060. s_pause                           00000194
  1061. s_ramiga                          00000181
  1062. save_byte                         0000000F
  1063. status                            00000003
  1064. sync_1                            000000E6
  1065. sync_2                            000000EB
  1066. sync_3                            000000EE
  1067. sync_cd                           x_flag,7
  1068. sync_up                           000000CB
  1069. sync_up1                          000000D0
  1070. t0ie                              intcon,5
  1071. t0if                              intcon,2
  1072. t_b1                              0000012C
  1073. t_break                           00000125
  1074. t_chk                             0000010C
  1075. t_e0                              00000132
  1076. t_e01                             00000139
  1077. t_e0_b                            00000146
  1078. t_e0_b1                           0000014B
  1079. t_pwr_up                          000000FE
  1080. tab                               00000304
  1081. table                             00000301
  1082. tmr0                              00000001
  1083. tmr_addr                          0000001C
  1084. tmr_cntdwn                        0000001E
  1085. tmr_end                           00000013
  1086. tmr_init                          00000019
  1087. tmr_ms                            0000001F
  1088. tmr_pch                           0000001D
  1089. tmr_ret                           0000001A
  1090. tmr_ret_pch                       0000001B
  1091. tmr_tst                           x_flag,5
  1092. trans_addr                        0000000D
  1093. translate                         00000108
  1094. wait                              00000027
  1095. wr                                eecon1,1
  1096. wren                              eecon1,2
  1097. x_flag                            00000016
  1098. zero                              status,2
  1099.  
  1100.  
  1101. MEMORY USAGE MAP ('X' = Used,  '-' = Unused)
  1102.  
  1103. 0000 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
  1104. 0040 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
  1105. 0080 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
  1106. 00C0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX X---------------
  1107. 0100 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
  1108. 0140 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
  1109. 0180 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
  1110. 01C0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXX----------
  1111. 0200 : XXXXXXXXXXXXXXXX XXXXXXXXXXXX---- ---------------- ----------------
  1112. 0300 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
  1113. 0340 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
  1114. 0380 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
  1115. 03C0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXX-----------
  1116.  
  1117. All other memory blocks unused.
  1118.  
  1119. Program Memory Words Used:   760
  1120. Program Memory Words Free:   264
  1121.  
  1122.  
  1123. Errors   :     0
  1124. Warnings :    18 reported,     0 suppressed
  1125. Messages :    18 reported,     0 suppressed
  1126.  
  1127.