;------------------------------------------------------------------------------- ; ; REU-Format (without verify) ; ; Compiler : ACME ; ; Release : 31.10.2005 ; ; ;------------------------------------------------------------------------------- ; (c) M. Sachse , http://www.cbmhardware.de ; http://www.cbmpet.de ;------------------------------------------------------------------------------- ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; either version 2 of the License, or ; (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with this program; if not, write to the Free Software ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ; ;------------------------------------------------------------------------------- *= $0400 !byte $00,$0c,$08,$0a,$00,$9e,$31,$30,$38,$38,$00,$00,$00,$00 !to"reusetup.prg" *=$0440 ;-------------------------------------------------- via =$8800 via_b =$8a00 datalatch =$8900 banks =$0a dummy =$0b memory =$4000 ram2 =$00 ;-------------------------------------------------- lda #147 jsr $FFD2 ldx #40 ; chars lda #line sta $20 ; and high byte JSR $CA23 ; show mes on screen ldx #30 ;chars lda #mes1 sta $20 ; and high byte JSR $CA23 ; show mes on screen JSR $FDD0 ; CR ldx #40 ; chars lda #line sta $20 ; and high byte JSR $CA23 ; show mes on screen JSR $FDD0 ; CR JSR $FDD0 ; CR lda #255 ; switch ports to output and compare output sta via+2 sta via+3 lda #255 ; switch ports to output again sta via+2 sta via+3 lda #255 ; switch ports to output again sta via_b+2 sta via_b+3 ldx #28 ; chars lda #mes6 sta $20 ; and high byte jsr $CA23 ; show mes on screen lda #00 sta via sta via+1 sta via_b+1 lda #204 ; CA2/CB2 %00 sta via+12 lda datalatch sta dummy lda %0101010101 sta datalatch lda datalatch cmp %0101010101 bne fault beq ok c0 lda dummy sta datalatch jmp format ;-------------------------------------------------- fault ldx #7 ; chars lda #mes3 sta $20 ; and high byte jsr $CA23 ; show mes on screen jsr $FDD0 ; CR jmp exit rts ok ldx #4 ; chars lda #mes4 sta $20 ; and high byte jsr $CA23 ; show mes on screen jsr $FDD0 ; CR jmp c0 exit JSR $FDD0 ; CR ldx #40 ; chars lda #fatal sta $20 ; and high byte JSR $CA23 ; show mes on screen JSR $FDD0 ; CR rts fatal!TEXT"!FATAL ERROR OCCURED: PLEASE CHECK PCB !" line !TEXT"技技技技技技技技技技技技技技技技技技技技" !Byte $0d mes1 !TEXT " PET-REU 1024K SETUP " !Byte $0d mes3 !TEXT "FAULT !" !Byte $0d mes4 !TEXT "OK !" !Byte $0d mes6 !TEXT "TESTING RAM AND DATALATCH : " format ;--------------------------------------------------- ; show text and setup via(s) ;--------------------------------------------------- jsr $FDD0 ; CR jsr $FDD0 ; CR ldx #13 lda #mes sta $20 ; and high byte JSR $CA23 ; show mes on screen lda #255 sta via+2 sta via+3 ; ports to output sta via_b+2 sta via_b+3 lda #00 ; set addr. $0000 in SRAM sta via ; register B sta via+1 ; register A lda #204 ; CA2/CB2 : %00 sta via+12 ; choose RAM-IC 0 lda #00 sta banks ;--------------------------------------------------- ; Looproutine for 8 banks ;--------------------------------------------------- bank lda banks JSR $FDCD ; put one space between bank counter lda banks JSR $E775 ; show written bank sta via_b+1 ; and set bank 0 (port a) jsr ramcopy lda banks ; read banks cmp #07 ; 8 ? bne bank JSR $FDCD ; put one space between bank counter lda banks JSR $E775 ; show written bank jmp next_ic ;--------------------------------------------------- ; 64K Format : Fillbyte : $20 ;--------------------------------------------------- ramcopy ldx #00 repump ldy #00 ; low addr. counter pump lda #$20 ; fillbyte sta datalatch ; write byte to port iny sty via+1 ; register A : set low addr. bne pump inx stx via ; register B : set high addr. pcounter cpx #255 ; blocks bne repump ; damned, we do 256x256 Byte = 65536 Byte (64KB) inc banks ; in 8 banks = 524288 words by 8bit end rts ;--------------------------------------------------- mes !TEXT "IC1 FORMAT : " !Byte $0d mesa !TEXT "IC2 FORMAT : " !Byte $0d next_ic lda datalatch sta dummy lda %0101010101 sta datalatch f1 lda #236 ; CA2/CB2 : %01 sta via+12 ; choose RAM-IC 1 jsr $FDD0 ; CR jsr $FDD0 ; CR ldx #13 lda #mesa sta $20 ; and high byte JSR $CA23 ; show mes on screen lda datalatch cmp %0101010101 beq fbank bne fend lda #01 sta ram2 lda #00 sta banks b1 lda banks JSR $FDCD ; put one space between bank counter lda banks JSR $E775 ; show written bank sta via_b+1 ; and set bank 0 (port a) jsr ramcopy lda banks ; read banks cmp #07 ; 8 ? bne b1 JSR $FDCD ; put one space between bank counter lda banks JSR $E775 ; show written bank jmp fin fend ldx #20 lda #skipram sta $20 ; and high byte JSR $CA23 ; show mes on screen lda #00 sta ram2 jmp fin ;-------------------------------------------------- skipram !TEXT " NOT PRESENT - SKIP" !Byte $0d fbank lda #00 sta banks fbank1 lda banks JSR $FDCD ; put one space between bank counter lda banks JSR $E775 ; show written bank sta via_b+1 ; and set bank 0 (port a) jsr ramcopy lda banks ; read banks cmp #07 ; 8 ? bne fbank1 JSR $FDCD ; put one space between bank counter lda banks JSR $E775 ; show written bank ;-------------------------------------------------- fin jsr $FDD0 ; CR jsr $FDD0 ; CR ldx #35 lda #success sta $20 ; and high byte JSR $CA23 ; show mes on screen jsr $FDD0 ; CR rts success !TEXT"FINISHED, HAVE A NICE DAY HACKER !" !Byte $0d