Advertisement
Kitomas

kit-32 wip

Jul 19th, 2024
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. |FEDCBA9876543210|FEDCBA98-76543210|
  2. /----------------------------------\
  3. |IIIIIIIIIIIIIIII|DDDDSSSS-NTTOOOOO|
  4. \----------------------------------/
  5. I: if applicable, and T < 2, operand will be stored here
  6. instead of in the next word (32-bits)
  7. D: destination; 13 = stack ptr, 14 = imm, 15 = mem
  8. S: source; 13 = stack ptr, 14 = imm, 15 = mem
  9. N: 'data is signed?'
  10. T: data type; 0,1,2,3 = char,short,int,float
  11. O: operation type
  12. (D and S cannot be the same value)
  13.  
  14.  
  15.  
  16.  
  17.  
  18. brk: ?
  19. sys: system call
  20. mov: move data
  21. sld: load from stack offset
  22. sst: store to stack offset
  23. sph: push to stack
  24. spl: pull from stack
  25. jmp: unconditional jump
  26. cmp: compare data
  27.  
  28. inc: ++D (does not alter carry at all)
  29. dec: --D (does not alter carry at all)
  30. add: D += S (automatically sets carry)
  31. sub: D -= S (automatically unsets carry)
  32. mul: D *= S
  33. neg: D = -D
  34. i2f: int-to-float cast
  35. f2i: float-to-int cast
  36.  
  37. ior: inclusive or
  38. xor: exclusive or
  39. and: bitwise and
  40. shl: shift left
  41. shr: shift right
  42. ???
  43. ror: rotate right
  44.  
  45. bcc: branch on !carry
  46. bcs: branch on carry
  47. bnc: branch on !negative
  48. bns: branch on negative
  49. bzc: branch on !zero (AKA bne, !=)
  50. bzs: branch on zero (AKA beq, ==)
  51. clc: clear carry flag
  52. sec: set carry flag
  53.  
  54.  
  55.  
  56.  
  57.  
  58. comparisons:
  59. un/signed !=: !zero
  60. un/signed ==: zero
  61.  
  62. unsigned < : !carry
  63. unsigned > : !zero && carry
  64. unsigned <=: !carry || zero
  65. unsigned >=: carry
  66.  
  67. signed < : negative
  68. signed > : !zero && !negative
  69. signed <=: negative || zero
  70. signed >=: !negative
  71.  
  72. keyboard input should be:
  73. low byte is the character, high byte are the key modifiers
  74.  
  75. sys calls:
  76. cpuid (check for floats, trig functions, interrupts,
  77. make and model, self-modifiable code, etc.)
  78. trig functions
  79. draw point(s)
  80. draw box(es)
  81. bcd conversions (for floats too)
  82. create texture out of bitmap
  83. create texture out of rle bitmap
  84. create texture out of qoi data
  85. blit single texture
  86. blit single texture Ex
  87. render geometry
  88. memcpy
  89. memset
  90. rand
  91. set canvas resolution
  92. set window resolution
  93. set audio routine address
  94.  
  95. misc notes:
  96. make sure data is aligned to 4 bytes
  97. audio routine should not alter hardware stack or its data
  98. (or make sure only 1 routine is going at once)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement