Advertisement
Guest User

simple cpu #17

a guest
Dec 10th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. 16 x 32-bit registers
  2. R0 : Zero Register. Reads as zero. Writes do nothing
  3. R1 : Unit Register. Reads as one. Writes do nothing
  4. R2 : Program Counter R3 : Accumulator R4: Program Counter
  5. R5 : Flags Register (Implementation-dependent)
  6. R6-R15 : No special meaning
  7. assembler opcode Meaning
  8. jalc r | 0000rrrr | If (Rr==0): Rr <- PC+1, PC <- Accumulator
  9. jal r | 0001rrrr | Rr <- PC+1, PC <- Accumulator
  10. add r | 0010rrrr | Accumulator <- Accumulator + Rr, PC <- PC+1 [ unsigned 32-bit add ]
  11. sub r | 0011rrrr | Accumulator <- Accumulator - Rr, PC <- PC+1 [ unsigned 32-bit subtract ]
  12. rmem r | 0100rrrr | Accumulator <- Memory_Byte_At[Rr], PC <- PC+1
  13. wmem r | 0101rrrr | Memory_Byte_At[Rr] <- Accumulator, PC <- PC+1
  14. rreg r | 0110rrrr | Accumulator <- Rr, PC <- PC+1
  15. wreg r | 0111rrrr | Rr <- Accumulator, PC <- PC+1
  16. nand r | 1000rrrr | Accumulator <- NOT( Accumulator AND Rr ), PC <- PC+1
  17. and r | 1001rrrr | Accumulator <- (Accumulator AND Rr), PC <- PC+1
  18. or r | 1010rrrr | Accumulator <- (Accumulator OR Rr), PC <- PC+1
  19. xor r | 1011rrrr | Accumulator <- (Accumulator XOR Rr), PC <- PC+1
  20. pfix n | 1100nnnn | Accumulator <- ( (Accumulator << 4) OR n ), PC <- PC+1
  21. nfix n | 1101nnnn | Accumulator <- ( ( (NOT Accumulator) << 4) OR n ), PC <- PC+1
  22. rol n | 1110nnnn | Accumulator <- Accumulator ROTATED_LEFT_BY n bits, PC <- PC+1
  23. ror n | 1111nnnn | Accumulator <- Accumulator ROTATED_RIGHT_BY n bits, PC <- PC+1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement