Re: v6502
Posted: 19 Oct 2019, 09:56
Thanks! This was a fun project.
MSBASIC
The attached GT1 file below can be dropped in the online emulator for those who don't want to dig up their Arduino.
Supported are:
Some possible improvements are listed in the source:
v6502
Even with the above open issues in mind, this concludes the v6502 validation: no bugs were found since we hastily included it as an Easter egg(*) in ROMv4. So v6502 has now also become an "official" ROMv4 function and interface.json was updated accordingly.
(*) For those playing along at home or in the online emulator:
To munch squares again:
There's a really nice tutorial on SB-Projects. The wozmon entry points for ECHO, GETLIN, PRBYTE, PRHEX are in the same memory address as the original. But there are some important differences: our video system and wozmon are using zero page 0..$3f. Location $80 is reserved as well. That means that some classic examples that put something at address $30 will cause trouble. Furthermore, the stack lives in the top of page 0, but usually you won't notice. With all that in mind, you can write a little 6502 program that emits characters to the screen. This is from the original Apple 1 manual, with a bug fixed ("42"):
And here you'll notice another difference with the real system. After one round it halts and waits for a key press. That has to do with the special meaning of character 0 in the mockup.
Next?
A next phase can be to add 65C02 opcodes so we can use the FAT32 library from the SteckSchwein 6502 project. Adding instructions is easy. Adding addressing modes not so much. So we still have to see if this is doable.
Another idea is to hop over to v8080. Combine that with a block device and we have CP/M... and we get the file system with that. The real technical challenge there is the memory layout. And the screen resolution is insufficient for a minimal CP/M terminal.
.
MSBASIC
The attached GT1 file below can be dropped in the online emulator for those who don't want to dig up their Arduino.
Supported are:
- 9 digit floating point (40 bits) with transcendental functions
- Pi symbol and constant
- TIME and TIME$
- Break with Ctrl-C
- WAIT-6502 Easter Egg
- No file I/O (SAVE, LOAD, VERIFY)
- Screen shows 11 lines of text
- No line editing or delete (yet) Edit: shortly after writing this post we added simple line editing
- Stack space is limited
Some possible improvements are listed in the source:
Code: Select all
XXX Win 256 bytes by moving init code to flank of screen
XXX Fix POS() and TAB() (needs proper POSX system variable)
XXX No line editting yet (DEL)
XXX Lower STACK_BOT for more stack (3x nested FOR). Move CHRGET?
XXX Support 64K Gigatron
XXX Floating point buffer (STACK2) should move
XXX TI$ doesn't wrap after "235959"
XXX Check RND(-1)
v6502
Even with the above open issues in mind, this concludes the v6502 validation: no bugs were found since we hastily included it as an Easter egg(*) in ROMv4. So v6502 has now also become an "official" ROMv4 function and interface.json was updated accordingly.
(*) For those playing along at home or in the online emulator:
- Force a double reset by holding PageUp for 5 seconds and then release
- Munching squares appear after the second reset
- Type Ctrl-C to enter the mockup Apple-1 environment
- There is a disassembler at $400 and that takes it's address from $44/$45. For example:
Code: Select all
44: 0 ff
400R
R
R
Code: Select all
280R
Code: Select all
40: A9 1 20 EF FF 38 69 0 4C 42 0 R
Next?
A next phase can be to add 65C02 opcodes so we can use the FAT32 library from the SteckSchwein 6502 project. Adding instructions is easy. Adding addressing modes not so much. So we still have to see if this is doable.
Another idea is to hop over to v8080. Combine that with a block device and we have CP/M... and we get the file system with that. The real technical challenge there is the memory layout. And the screen resolution is insufficient for a minimal CP/M terminal.
.