; z80dasm 1.1.6 ; command line: z80dasm -a -l -g 0x00 -t -v -o 2708-Patrick-PKTB.dasm TMS2708@DIP24_Patrick-PKTB.BIN ; firmware for the keyboard & printer board P006h: equ I/O port 06h, used for input and output P007h: equ I/O port 07h, used for output INTCODE: equ 4000h NMICODE: equ 4006h org 00000h l0000h: im 1 ;0000 ed 56 . V ld hl,l009dh ;0002 21 9d 00 ! . . copy ld de,04000h ;0005 11 00 40 . . @ last three ld bc,00003h ;0008 01 03 00 . . . bytes to ldir ;000b ed b0 . . 4000h (RAM?) jp 00070h ;000d c3 70 00 . p . l0010h: ;; Is the next block used? Not from this EPROM dec c ;0010 0d . nop ;0011 00 . sbc hl,de ;0012 ed 52 . R ld (00d75h),hl ;0014 22 75 0d " u . ld bc,l0269h ;0017 01 69 02 . i . zero memory ld hl,00db0h ;001a 21 b0 0d ! . . range from ld (hl),000h ;001d 36 00 6 . 0db1h - 0db1h + 0269h ld de,00db1h ;001f 11 b1 0d . . . ldir ;0022 ed b0 . . ld hl,l0000h ;0024 21 00 00 ! . . ld (00d69h),hl ;0027 22 69 0d " i . ld (00d6bh),hl ;002a 22 6b 0d " k . ld (00d61h),hl ;002d 22 61 0d " a . ld (00d63h),hl ;0030 22 63 0d " c . ld (ix-00bh),000h ;0033 dd 36 f5 00 . 6 . . defb 3ah l0038h: ; target if Mode 1 interrupt jp 04000h ;0038 c3 00 40 . . @ l003bh: ; target of the jump in RAM @4000h in a,(006h) ;003b db 06 . . read byte from CPU ld d,a ;003d 57 W keep it xor a ;003e af . and write 00h out (006h),a ;003f d3 06 . . back (status?) ret ;0041 c9 . ? where is the call? Or is it a legitimate alternate for reti? ld l,a ;0042 6f o dec c ;0043 0d . add hl,de ;0044 19 . ld (hl),00dh ;0045 36 0d 6 . xor a ;0047 af . ld (00d86h),a ;0048 32 86 0d 2 . . ex de,hl ;004b eb . l004ch: dec de ;004c 1b . ld hl,(00d6fh) ;004d 2a 6f 0d * o . or a ;0050 b7 . sbc hl,de ;0051 ed 52 . R jr nc,l00a6h ;0053 30 51 0 Q ld a,(de) ;0055 1a . cp 02fh ;0056 fe 2f . / jr nz,l004ch ;0058 20 f2 . ld a,00dh ;005a 3e 0d > . ld (de),a ;005c 12 . inc de ;005d 13 . ld a,001h ;005e 3e 01 > . ld (00d86h),a ;0060 32 86 0d 2 . . ld a,(de) ;0063 1a . inc de ;0064 13 . defb 0feh ;0065 l0066h: jp 04006h ;0066 c3 06 40 . . @ cp 043h ;0069 fe 43 . C jr nz,l0071h ;006b 20 04 . defb 0ddh,0cbh,0f5h ;006d dd cb f5 . . . ! garbage? l0070h: l0071h: ;; this lands halfway the next instruction. Is the whole block from l004ch garbage? ld de,00 ;0070 21 00 add a,b ;0072 80 . ld sp,hl ;0073 f9 . xor a ;0074 af . out (007h),a ;0075 d3 07 . . output 00h ld a,080h ;0077 3e 80 > . out (006h),a ;0079 d3 06 . . output 80h ld hl,04003h ;007b 21 03 40 ! . @ used in next interrupt ? ei ;007e fb . halt ;007f 76 v ld c,d ;0080 4a J ei ;0081 fb . halt ;0082 76 v ld b,d ;0083 42 B l0084h: ei ;0084 fb . halt ;0085 76 v l0086h: ld (hl),d ;0086 72 r inc hl ;0087 23 # dec bc ;0088 0b . xor a ;0089 af . cp c ;008a b9 . jp nz,l0084h ;008b c2 84 00 . . . cp b ;008e b8 . jp nz,l0084h ;008f c2 84 00 . . . ld hl,04000h ;0092 21 00 40 ! . @ xor a ;0095 af . ld (hl),a ;0096 77 w inc hl ;0097 23 # ld (hl),a ;0098 77 w di ;0099 f3 . jp 04009h ;009a c3 09 40 . . @ l009dh: ; moved to 4000h and used in Interrupt 1 code jp l003bh ;009d c3 3b 00 . ; . rst 38h