4.1 KiB
2023-09-08 — Dev notes
- what changes are required to address more memory?
•••
- drop the Overflow flag?
- … what flags does uxn have?
Qs: Reading input
- what do we do if we want to ask the tape reader (etc.) to read in some data?
- is it enough to have that device do polling??
- what does uxn do?
Networking??? - Gameboy link cable
- how does the gameboy link cable work?
Serial Data Transfer (Link Cable) - GbdevWiki
gb link cable has 1 gb clocking the other, for synchronization
Program ideas
- machine monitor w output to graph display
Flags
- reconsider flags… i think i want to drop the overflow flag…
Other educational machines
https://en.wikipedia.org/wiki/MIX
https://en.wikipedia.org/wiki/DLX
- good info on instruction cycle!
https://en.wikipedia.org/wiki/MicroBlaze
! https://en.wikipedia.org/wiki/MikroSim
these educational machines seem to never cover actually loading a program into memory / bootstrapping …
freedosproject/toycpu: A simulation of a Minimal instruction set computer
- great readme opcode reference
- this has a front panel! loading!
LC-3
https://en.wikipedia.org/wiki/Little_Computer_3
Articles on simulating + LC-3's design
Let's build an LC-3 Virtual Machine :: Rodrigo Araujo — Computer Scientist and Software Engineer
- nb: section on TRAP
- get char
- write char
- puts
- prompt…
- putsp
- KBSR & KBDR mem mapped regusters
great piece on building an LC-3 VM
enum { OP_BR = 0, /* branch / OP_ADD, / add / OP_LD, / load / OP_ST, / store / OP_JSR, / jump register / OP_AND, / bitwise and / OP_LDR, / load register / OP_STR, / store register / OP_RTI, / unused / OP_NOT, / bitwise not / OP_LDI, / load indirect / OP_STI, / store indirect / OP_JMP, / jump / OP_RES, / reserved (unused) / OP_LEA, / load effective address / OP_TRAP / execute trap */ };
LC-3 just has flags for pos, zero, neg
You may be wondering why the trap codes are not included in the instructions. This is because they do not actually introduce any new functionality to the LC-3, they just provide a convenient way to perform a task (similar to OS system calls). In the official LC-3 simulator, trap routines are written in assembly. When a trap code is called, the PC is moved to that code’s address. The CPU executes the procedure’s instructions, and when it is complete, the PC is reset to the location following the initial call. Note: This is why programs start at address 0x3000 instead of 0x0. The lower addresses are left empty to leave space for the trap routine code.
…
Note: Getting input from the keyboard is one specific example of this. The assembly version uses a loop to continuously check the keyboard for input.
KBSR = keyboard status KBDR = keyboard data
and those seem to just have regular memory addresses
https://www.jmeiners.com/lc3-vm/supplies/lc3-ref-card.png
"IP" vs "PC"?
- should i rename IP to PC since that’s what everyone else calls it?
Misc. references
How a CPU works: Bare metal C on my RISC-V toy CPU · Florian Noeding's blog
PDP
Learn PDP-11 Assembly Coding Lesson 1 - For absolute beginners! - YouTube