📄 ps2code.lst
字号:
M endif
M if (2==2)
00B3 28B4 M goto $ + 1
M exitm
00B4 0923 00350 comf PARITY, w
00B5 20C5 00351 call BitOut ;Parity bit
00B6 1D85 00352 btfss CLOCK ;Test for inhibit
00B7 28C0 00353 goto ByteOutEnd
00354 Delay 5
M if (5==1)
M nop
M exitm
M endif
M if (5==2)
M goto $ + 1
M exitm
M endif
M if (5==3)
M nop
M goto $ + 1
M exitm
M endif
M if (5==4)
M goto $ + 1
M goto $ + 1
M exitm
M endif
M if (5==5)
00B8 28B9 M goto $ + 1
00B9 28BA M goto $ + 1
00BA 0000 M nop
M exitm
00BB 30FF 00355 movlw 0xFF
00BC 20C5 00356 call BitOut ;Stop bit (1)
00357 Delay 48
MPASM 03.20.02 Released PS2CODE.ASM 6-30-2004 14:27:07 PAGE 10
PS/2 Keyboard Emulator
Copyright 2001, Adam Chapweske
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
M if (48==1)
M nop
M exitm
M endif
M if (48==2)
M goto $ + 1
M exitm
M endif
M if (48==3)
M nop
M goto $ + 1
M exitm
M endif
M if (48==4)
M goto $ + 1
M goto $ + 1
M exitm
M endif
M if (48==5)
M goto $ + 1
M goto $ + 1
M nop
M exitm
M endif
M if (48==6)
M goto $ + 1
M goto $ + 1
M goto $ + 1
M exitm
M endif
M if (48==7)
M goto $ + 1
M goto $ + 1
M goto $ + 1
M nop
M exitm
M endif
M if (48%4==0)
00BD 300B M movlw (48-4)/4
00BE 2121 M call Delay_us
M exitm
00BF 3400 00358 retlw 0x00
00C0 1683 00359 ByteOutEnd bsf STATUS, RP0
00C1 1505 00360 bsf DATA
00C2 1585 00361 bsf CLOCK
00C3 1283 00362 bcf STATUS, RP0
00C4 34FE 00363 retlw 0xFE
00364
00C5 1683 00365 BitOut bsf STATUS, RP0
00C6 3901 00366 andlw 0x01
00C7 1D03 00367 btfss STATUS, Z
00C8 1505 00368 bsf DATA
00C9 1903 00369 btfsc STATUS, Z
MPASM 03.20.02 Released PS2CODE.ASM 6-30-2004 14:27:07 PAGE 11
PS/2 Keyboard Emulator
Copyright 2001, Adam Chapweske
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00CA 1105 00370 bcf DATA
00371 Delay 21
M if (21==1)
M nop
M exitm
M endif
M if (21==2)
M goto $ + 1
M exitm
M endif
M if (21==3)
M nop
M goto $ + 1
M exitm
M endif
M if (21==4)
M goto $ + 1
M goto $ + 1
M exitm
M endif
M if (21==5)
M goto $ + 1
M goto $ + 1
M nop
M exitm
M endif
M if (21==6)
M goto $ + 1
M goto $ + 1
M goto $ + 1
M exitm
M endif
M if (21==7)
M goto $ + 1
M goto $ + 1
M goto $ + 1
M nop
M exitm
M endif
M if (21%4==0)
M movlw (21-4)/4
M call Delay_us
M exitm
M endif
M if (21%4==1)
00CB 3004 M movlw (21-5)/4
00CC 2121 M call Delay_us
00CD 0000 M nop
M exitm
00CE 1185 00372 bcf CLOCK
00373 Delay 45
M if (45==1)
M nop
MPASM 03.20.02 Released PS2CODE.ASM 6-30-2004 14:27:07 PAGE 12
PS/2 Keyboard Emulator
Copyright 2001, Adam Chapweske
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
M exitm
M endif
M if (45==2)
M goto $ + 1
M exitm
M endif
M if (45==3)
M nop
M goto $ + 1
M exitm
M endif
M if (45==4)
M goto $ + 1
M goto $ + 1
M exitm
M endif
M if (45==5)
M goto $ + 1
M goto $ + 1
M nop
M exitm
M endif
M if (45==6)
M goto $ + 1
M goto $ + 1
M goto $ + 1
M exitm
M endif
M if (45==7)
M goto $ + 1
M goto $ + 1
M goto $ + 1
M nop
M exitm
M endif
M if (45%4==0)
M movlw (45-4)/4
M call Delay_us
M exitm
M endif
M if (45%4==1)
00CF 300A M movlw (45-5)/4
00D0 2121 M call Delay_us
00D1 0000 M nop
M exitm
00D2 1585 00374 bsf CLOCK
00D3 1283 00375 bcf STATUS, RP0
00376 Delay 5
M if (5==1)
M nop
M exitm
M endif
M if (5==2)
MPASM 03.20.02 Released PS2CODE.ASM 6-30-2004 14:27:07 PAGE 13
PS/2 Keyboard Emulator
Copyright 2001, Adam Chapweske
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
M goto $ + 1
M exitm
M endif
M if (5==3)
M nop
M goto $ + 1
M exitm
M endif
M if (5==4)
M goto $ + 1
M goto $ + 1
M exitm
M endif
M if (5==5)
00D4 28D5 M goto $ + 1
00D5 28D6 M goto $ + 1
00D6 0000 M nop
M exitm
00D7 0008 00377 return
00378
00379 ;---------------------------------------------------------------------------------------------
00380 ; READ ONE BYTE: (Takes about 1ms) - TIMING IS CRITICAL!!!
00381 ;---------------------------------------------------------------------------------------------
00382
00D8 1D85 00383 ByteIn btfss CLOCK ;Test for Request-to-send
00D9 34FE 00384 retlw 0xFE
00DA 1905 00385 btfsc DATA
00DB 34FE 00386 retlw 0xFE
00DC 3008 00387 movlw 0x08
00DD 00A4 00388 movwf COUNTER
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -