Advertisement
NovaYoshi

complex nybble CPU

Dec 7th, 2013
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. registers 0 to 7 mapped to memory 0 to 7,
  2.  
  3. opcodes
  4. 0 nop
  5. 1xy set *x,y
  6. 2xy set *x,*y
  7. 2xy swap *x,*y
  8. 3x jmp x jumping to 0-7 jumps to the value of register 0 to 7
  9. 4x jsr x uses register 7 as stack pointer, and same rule as above
  10. 50 rts return
  11. 51x rts x return and pop X words
  12. 52 skip
  13. 53x ifez skip if x !=0
  14. 54x ifnz skip if x ==0
  15. 55xy ifne skip if x == y
  16. 56xy ifeq skip if x != y
  17. 57xy ifle skip if x > y
  18. 58xy iflt skip if x >= y
  19. 59
  20. 5a
  21. 5b
  22. 5c
  23. 5d
  24. 5e
  25. 5f
  26. 6
  27. 7
  28. 8
  29. 9
  30. a
  31. b
  32. c
  33. d
  34. e
  35. f
  36.  
  37. params
  38. 0 constant 0
  39. 1 constant 1
  40. 2 constant 2
  41. 3 constant 3
  42. 4 constant 4
  43. 5 constant 5
  44. 6 constant 6
  45. 7 constant 7
  46. 8 *(x)
  47. 9xy add x,y
  48. axx constant (register size)
  49. b0x negate x
  50. b1x complement x
  51. b2xy mul x,y
  52. b3xy div x,y
  53. b4xy mod x,y
  54. b5xy and x,y
  55. b6xy or x,y
  56. b7xy xor x,y
  57. b8xy adc x,y
  58. b9xy sub x,y
  59. baxy sbc x,y
  60. bbx shift left 1
  61. bcx shift left 2
  62. bdx shift left 3
  63. bexy shift X by amount Y
  64. bf reserved
  65. cx constant x as 4-bit positive integer
  66. d0x *(*(x)) register indirect
  67. d1x *(*(x)++) push register (the ++ adds register size, probably 2)
  68. d2x *(--*(x)) pop register (the -- subtracts register size, probably 2)
  69. d3xy *(*(x)+y) register indirect plus index
  70. d4xy *(*(x+y)) ???
  71. d5 *(*(r7)++) push stack
  72. d6 *(--*(r7)) pop stack
  73. d7
  74. d8
  75. d9
  76. da
  77. db
  78. dc
  79. dd
  80. de
  81. df
  82. e unused
  83. f unused
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement