; Acorn PROM Programmer Board (200.007) Software ; From Technical Manual Issue 2 Jan-1981 ; ; Chris Oddy February 2019 ; ; Execute from $2840 (START) ; ; Zeropage Registers ; bflip := $80 ck := $81 hl := $81 ve := $82 bl := $83 howvec := $84 toblow := $86 temp := $88 regmap := $8A job := $8B from := $8C point := $8E mask := $8E tries := $8F extra := $90 count := $90 curent := $91 number := $92 crc := $93 buff := $0100 ; ; Hardware Address's ; kb := $0E21 ; keyboard blower := $1980 ; base address for 8255 PIA porta := $1980 ; 8255 port A portb := $1981 ; 8255 port B portc := $1982 ; 8255 port C cwr := $1983 ; 8255 control register ; ; ASCII ; CR := $0D ; Carriage Return ESC := $1B ; ESCape SPACE := $20 ; SPACE ; ; Vectors ; brkvec := $0202 ; BRK Vector ; ; OS Calls ; OSWRCH := $FFF4 ; WRite CHaracter to output channel OSASCI := $FFE9 ; WRite CHaracter to output channel (adds LF if CR) OSRDCH := $FFE3 ; ReaD CHaracter from input channel OSCRLF := $FFED ; write CRLF to output channel OSECHO := $FFE6 ; reads character from Input channel and ECHOs it to output channel OSCLI := $FFF7 ; call Command Line Interpreter ; .org $2800 ; VSTRNG: pla sta temp pla sta temp+1 vstrlp: ldy #$00 inc temp bne inctpc inc temp+1 inctpc: lda (temp),y cmp #$EA beq vstrnx jsr OSASCI jmp vstrlp vstrnx: jmp (temp) BUFFIN: ldx #$00 ; Input Buffer Routine answer: jsr OSECHO sta buff,x cmp #$7F ; check for delete bne enterd buffa: dex bmi BUFFIN bpl answer enterd: cmp #$0D ; terminated by CR bne notdun rts notdun: inx cpx #$28 ; limit buffer length bne answer lda #$7F jsr OSWRCH jmp buffa START: lda #START sta brkvec+1 jsr VSTRNG .byte CR,"Which PROM ?" nop jsr BUFFIN ; get reply ldy #$00 find: ldx #$00 which: lda buff,x ; find entry in table cmp TABLE,y bne next ; not this entry inx iny cpx #$04 ; for all four characters bne which ldx #$07 ; good we have found it found: lda TABLE,y ; so put parameters in page zero sta bflip,x iny dex bpl found bmi what ; and go to next step next: inx iny cpx #$0C bne next cpy #$44 ; check for end of table bcc find lda buff cmp #'*' ; check for OS command bne START ; unknown command lda #SPACE sta buff jsr OSCLI ; and hand to OS jmp START what: jsr VSTRNG .byte "BLOW : READ : VERIFY : CLEAR",CR .byte "Enter initial letter ?" nop jsr BUFFIN ; get reply lda buff sta job cmp #'C' beq nonum where: jsr VSTRNG ; get number of needed .byte "From ?" nop jsr BUFFIN ; get reply ldx #$00 ; and translate from ASCII stx from stx from+1 dex numlop: inx lda buff,x cmp #'0' bcc nonum cmp #$3A bcc numcon sbc #$07 bcc nonum cmp #$40 bcs nonum numcon: and #$0F asl a asl a asl a asl a ldy #$04 numcin: asl a rol from rol from+1 dey bne numcin beq numlop nonum: jmp (toblow) ; PROM/EPROM Programming Data TABLE: .byte "571H" .byte >FUSE ; what to blow .byte FUSE .byte EPROM ; what to blow .byte DOTWO ; how to blow it - no of Kbytes .byte EPROM ; what to blow .byte CORE ; how to blow it - no of Kbytes .byte EPROM ; what to blow .byte DOFOUR ; how to blow it - no of Kbytes .byte EPROM ; what to blow .byte DOTWO ; how to blow it - no of Kbytes .byte