cardiograph-computer/2023-09-08.md

123 lines
4.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 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?
- [emulation - How does the Gameboy Link Cable work? - Retrocomputing Stack Exchange](https://retrocomputing.stackexchange.com/questions/12549/how-does-the-gameboy-link-cable-work)
[Serial Data Transfer (Link Cable) - GbdevWiki](https://gbdev.gg8.se/wiki/articles/Serial_Data_Transfer_(Link_Cable))
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](https://github.com/freedosproject/toycpu)
- 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](https://www.rodrigoaraujo.me/posts/lets-build-an-lc-3-virtual-machine/)
- nb: section on TRAP
- get char
- write char
- puts
- prompt…
- putsp
- KBSR & KBDR mem mapped regusters
[great piece on building an LC-3 VM](https://justinmeiners.github.io/lc3-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 codes address. The CPU executes the procedures 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 thats what everyone else calls it?
## Misc. references
[history - Which computers did Donald Knuth "mix" together to get MIX? - Retrocomputing Stack Exchange](https://retrocomputing.stackexchange.com/questions/18117/which-computers-did-donald-knuth-mix-together-to-get-mix)
[How a CPU works: Bare metal C on my RISC-V toy CPU · Florian Noeding's blog](https://florian.noeding.com/posts/risc-v-toy-cpu/cpu-from-scratch/)
https://edaplayground.com/
### PDP
[PDP-10 Arith-Tests](http://pdp10.nocrew.org/docs/instruction-set/Arith-Tests.html)
[Learn PDP-11 Assembly Coding Lesson 1 - For absolute beginners! - YouTube](https://www.youtube.com/watch?v=sk5Y26Qb1Ow)