ap0 is the latest and greatest cpu. i actually thought about the electrical/logic design this time and in theory i could make this a real thing. the problem is i dont know nothin about electrical design or anything like that.
it has many features that other cpu's dont, such as:
- 256 bytes of ram
- a stack (not stored in ram tho)
- 2 (two) registers, A and B
- math (add, subtract, and, or, xor, shift left, shift right)
- one (1) conditional jump instruction
- subroutines (call and return)
- no carry flag, good luck doing math
it's called the "ap0" because i came up with its design during my leftover time from the AP CSA exam.
please don't. you deserve better.
if you really want to, it works like this:
- write your assembly in
in.s- need assembly documentation? haha good luck. try reading
asm.pyand deciphering my code
- need assembly documentation? haha good luck. try reading
- run
asm.py- it will create
out.h, which is#include'ed inemu.cand contains the C code to set the ram values. isn't it great? (um i just realized it should beout.cbc its code not a header, but i dont car)
- it will create
- do
gcc -o ap0 emu.c - run
ap0 - yuo win!