Files
CAR/README.md

59 lines
2.1 KiB
Markdown
Raw Permalink Normal View History

# Cool ARM Ripoff
2026-07-16 14:03:58 -05:00
*A simple (and ridiculous) virtual machine/CPU made for no real reason/purpose.*
***Written in C, made by David Goeke.***
### Current features:
2026-07-16 14:03:58 -05:00
- few to none.
- 32 general purpose registers
- 32-bit addresses
### Needed features:
- conditional jmps
2026-07-16 14:03:58 -05:00
### Instuctions (arithmetic):
2026-07-16 14:03:58 -05:00
- 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)
- fp_add (add floating point values in registers)
- fp_sub (subtract floating point values in registers)
- fp_mul (multiply floating point values in registers)
- fp_div (divide floating point values in registers)
- fp_mod (modulus (division remainder) floating point values in registers)
2026-07-16 14:03:58 -05:00
### Insutrctions (load/store):
2026-07-16 14:03:58 -05:00
- 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)
- push (push register onto stack)
- pushi (push 21-bit immediate onto stack)
- pop (pop value from stack into register)
- sth (stroe high 11 bits of register to memory, using pc as the base)
- stk (stroe high 11 bits of register to memory, using sp as the base)
2026-07-16 14:03:58 -05:00
### Instructions (misc):
2026-07-16 14:03:58 -05:00
- nop (do nothing)
- call (call subroutine/function)
- ret (return from subroutine/function)
- jmp (jump to memory address)