Files
CAR/README.md
2026-07-16 14:00:39 -05:00

1.4 KiB

Cool ARM Ripoff

A simple (and ridiculous) virtual machine/CPU made for no real reason/purpose.

Written in C, made by David Goeke.

Current features: few to none.

32 general purpose registers
32-bit addresses

Needed features: push/pop call/ret jmp/conditional jmps store high 11 bits of an immediate in memory

instuctions (arithmetic): add sub (subtract) mul (multiply) div (divide) mod (modulus, division remainder) shl (logical shift left) shr (logical shift right) ahr (arithmetic shift right) ror (logical rotate right) and (logical AND) or (logical OR) xor (logical XOR) not (logical NOT/invertion) xchg (exchange registers)

Insutrctions (load/store): ldr (load register with value from memory, using the program counter as the base) lds (load register with value from memory, using the stack pointer as the base) ldb (load register with value from memory, using a specified register as the base) ldi (load register with and immediate value, only low 21 bits) str (store register at memory, using the program counter as the base) sts (store register at memory, using the stack pointer as the base) stb (store register at memory, using the specified register as the base) ldh (load high 11 bits of register with immediate) sti (store a 21-bit immediate at memory, using the program counter as the base) stj (store a 21-bit immediate at memory, using the stack pointer as the base)

Instructions (misc): nop (do nothing)