cardiograph-computer/2023-09-08.md

4.1 KiB
Raw Blame History

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?

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 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

How a CPU works: Bare metal C on my RISC-V toy CPU · Florian Noeding's blog

https://edaplayground.com/

PDP

PDP-10 Arith-Tests

Learn PDP-11 Assembly Coding Lesson 1 - For absolute beginners! - YouTube