update readme

This commit is contained in:
Sarah Jamie Lewis 2021-11-12 15:39:15 -08:00
parent 5b958337a6
commit 23c5195365
1 changed files with 0 additions and 114 deletions

114
README.md
View File

@ -69,117 +69,3 @@ The below represents some ideas for projects to tackle within Boo OS.
- [ ] But, it should quickly all the construction of new commands from old ones
- [ ] Finally, the shell should facilitate saving and loading of disk-images
- [ ] Write a Bootstrapped Assembler Application in Boo Bytecode Assembly
# Formal Reqs
Run time:
- Memory needs R/W/E flags - 3 bits
- Mapping Memory before handing off to lesser privileged processes
- Needs some understanding off operating mode
- Never attempt to pop an empty stack
Memory
We treat each 64 chunks of memory as a single page:
0x0000 4800 Pages of Write only Display Memory
0x4B000 1 Page of Registers [rip, mode, display, rax, r2, r3, r4, r5, r6, r7, r8]
0x4B040 1 Page of Call Stack
0x4B080 1 Page of Input Flags (Keys Down etc)
0x4B0C0 Dynamic Memory Begins
## Instructions
All instructions are fixed length.
## Meta Instructions
0x00 - Nop
0x01 - Update Display
0x0F - HLT
## Dynamic Instructions
Prefix 0x1#,0x2#,0x3# are given to dynamin register based commands
- 0x1n STORE(n) $Addr (R(n)) -> Addr)
- 0x2n LOAD(n) $Addr (Addr -> R(n))
- 0x3n LOADI(n) IMM (Immediate -> R(n))
- 0x4n INC(n)
- 0x5n DEC(n)
- 0x6n ISTORE(n)
- 0x7n x LDSTORE Load the Address Stored in n into reg(x)
- 0x8n x Transfer R(n) to R(x)
## Arithmetic
Prefix 0xa# is given to arithmetic functions
- 0xa1 ADD (R2 + R3 -> RAX)
- 0xa2 SUB (R2 - R3 -> RAX)
- 0xa3 MUL (R2 * R3 -> RAX)
- 0xa4 DIV (R2 / R3 -> RAX)
- 0xa5 SHIFT (R2 >> R3 -> RAX)
- 0xa6 AND (R2 & R3 -> RAX)
# Buffers
Buffers are declared in Boo Assembler as `data buffer <label> <length>`
- 0xB0 ADDR (`bclear LABEL`)- Clear the Buffer at Address ADDR.
- 0xB(N) ADDR (`bappend R(X) LABEL`)- Append the word in R(N) to the Buffer at Address ADDR. Safely handles length.
Sets `$4` to `0` on success and `1` on failure.
# Stack
Prefix 0xc# allows call stack manipulation. The machine denotes 64 memory addresses at memoo
- 0xc0 RET
- 0xc1 PUSH Call Stack
# Jumps and Branches (0x5#)
- 0xE0 JMP $Addr - Unconditional jump to $Addr
- 0xE1 JMPEQ $Addr (if R1 == R2 jmp $Addr else )
- 0xE2 JMPNEQ $Addr (if R1 != R2 jmp $Addr else )
- 0xE3 JMPGT $Addr (if R1 > R2 jmp $Addr else )
- 0xE4 JMPLT $Addr (if R1 < R2 jmp $Addr else )
- 0xE5 JMPGEQ $Addr (if R1 >= R2 jmp $Addr else )
- 0xE6 JMPLEQ $Addr (if R1 <= R2 jmp $Addr else )
## Admin Mode Instructions
Instructions prefixed with 0xF are admin instructions
- 0xF0 UNSET_R $Addr (Sets the 64 addresses after $Addr as Not Readable)
- 0xF1 SET_R $Addr (Sets the 64 addresses after $Addr as Readable)
- 0xF2 UNSET_W $Addr (Sets the 64 addresses after $Addr as Not Writable)
- 0xF3 SET_W $Addr (Sets the 64 addresses after $Addr as Writable)
- 0xF4 UNSET_X $Addr (Sets the 64 addresses after $Addr as Not Executable)
- 0xF5 SET_X $Addr (Sets the 64 addresses after $Addr as Executable)
- 0xFF DROP_MODE $Addr - Drops from Admin Mode into User Mode (No access to Admin mode instructions)
0: LOAD_IMM 10
1: NOP
2: DEC(1)
3: JNEQ
##