├── 6502-bootrom.asm ├── 6502-bootrom.bin ├── README.md ├── Screenshot 2022-10-01 125620.png └── Screenshot 2022-10-01 125643.png /6502-bootrom.asm: -------------------------------------------------------------------------------- 1 | ; 6502 early/late test code 2 | ; Runs on Apple IIe at $E000 on 8k ROM 3 | ; Rev 0.3a 4 | ; IZ8DWF 2022 5 | 6 | ; VIDEO RAM is mapped from $0400 to $07FF 7 | 8 | * = $E000 9 | reset 10 | SEI 11 | CLD 12 | LDX #$FF 13 | TXS ; initialize the stack pointer 14 | 15 | ; soft switches 16 | LDX $C051 ; text mode 17 | LDX $C054 ; page 2 off 18 | 19 | ; we then use $00,$01 as pointer for video memory 20 | LDA #$00 21 | STA $00 22 | LDA #$04 23 | STA $01 24 | LDA #$08 ; end of video memory (page) 25 | STA $02 26 | ; clears the entire screen 27 | LDY #$00 28 | npcl: LDA #$20 29 | cls: STA ($00),Y 30 | INY 31 | BNE cls 32 | INC $01 33 | LDA $02 34 | CMP $01 35 | BNE npcl 36 | ;prints the welcome string 37 | LDA #$00 38 | STA $00 39 | LDA #$04 40 | STA $01 41 | LDA #welc 44 | STA $11 45 | JSR print 46 | ; set up the second video row's address 47 | LDA #$80 48 | STA $00 49 | LDA #$04 50 | STA $01 51 | ;let's test the ROR now 52 | LDA #$00 53 | SEC 54 | ROR ; an early 6502 will just "ASL" so A will be still zero 55 | BNE nobug 56 | LDA #rorb 59 | STA $11 60 | JSR print 61 | ever: JMP ever ; we may want to reset? 62 | nobug: LDA #rorok 65 | STA $11 66 | JSR print 67 | JMP ever 68 | 69 | print: 70 | LDY #$00 71 | pnext: LDA ($10),Y ; pointer to the string 72 | BEQ pexit ; end of string 73 | STA ($00),Y ; video memory pointer 74 | INC $00 75 | CPY $00 76 | BNE skipv 77 | INC $01 78 | skipv: INC $10 79 | CPY $10 80 | BNE pnext 81 | INC $11 82 | JMP pnext 83 | pexit: RTS 84 | 85 | welc: 86 | .aasc "WELCOME TO THE 6502 EARLY/LATE TEST: ", 0 87 | 88 | rorb: 89 | .aasc "THIS 6502 HAS THE ROR BUG!!! ", 0 90 | 91 | rorok: 92 | .aasc "THIS IS A 'REGULAR' 6502 ", 0 93 | 94 | endofrom 95 | ; fills the unused space with $FF 96 | * = $FFFA 97 | .dsb (*-endofrom), $FF 98 | 99 | ; vectors 100 | * = $FFFA 101 | 102 | .db $00,$E0,$00,$E0,$00,$E0 103 | 104 | -------------------------------------------------------------------------------- /6502-bootrom.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/misterblack1/6502_ror_bug_test/a7800e3a08943277c54a692f83569798fbf8ccdc/6502-bootrom.bin -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Boot rom for Apple II to test for 6502 ROR instruction bug 2 | 3 | ## Use this ROM at your own risk! 4 | 5 | This code was created by Frank IZ8DWF to test 6502 processors to see if they contain the ROR instruction bug. 6 | 7 | Early 6502 chips (until about May or June 1976) contained a bug where the ROR instruction didn't behave correctly. Because of this, MOS did not include the ROR instruction on the list of 6502 instructions, even though people knew it was supposed to be there. 8 | 9 | This ROM which is designed for the Apple II will initialize the system and then test the CPU for this bug. It will then simply display a message telling you which CPU you are running. 10 | 11 | The ROM does not do anything else. 12 | 13 | The BIN file can be flashed onto a 2764 or 2864 and installed into the EF ROM rocket on an Apple IIe. It should work just fine on the original Apple II and II+, but you will need to figure out how to get the code into the F0XX ROM space as these computer use custom ROM chips. 14 | 15 | Frank IZ8DWF's YouTube channel: 16 | https://www.youtube.com/c/iz8dwf/videos 17 | 18 | To use the ROM: 19 | 20 | * Install the code into a ROM chip 21 | * Install it into the computer 22 | * Power on the computer 23 | 24 | For a CPU that does not have the ROR bug, you will see this: (Post May/June 1976 chips) 25 | ![](https://github.com/misterblack1/6502_ror_bug_test/blob/main/Screenshot%202022-10-01%20125643.png?raw=true) 26 | 27 | For a CPU that has the ROR bug, you will see this: (Before May/June 1976 chips) 28 | ![](https://github.com/misterblack1/6502_ror_bug_test/blob/main/Screenshot%202022-10-01%20125620.png?raw=true) 29 | 30 | To read more about the ROR bug: 31 | https://www.pagetable.com/?p=406 32 | -------------------------------------------------------------------------------- /Screenshot 2022-10-01 125620.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/misterblack1/6502_ror_bug_test/a7800e3a08943277c54a692f83569798fbf8ccdc/Screenshot 2022-10-01 125620.png -------------------------------------------------------------------------------- /Screenshot 2022-10-01 125643.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/misterblack1/6502_ror_bug_test/a7800e3a08943277c54a692f83569798fbf8ccdc/Screenshot 2022-10-01 125643.png --------------------------------------------------------------------------------