1
0

ASMQuälcode.txt 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. ## x0 x1 x2 x3 x4 x5 x6 x7
  2. 0x NOP
  3. 1x ld ld ld ld ld ld ld ld
  4. 2x bgt st st st ?? st st st
  5. 3x RECHECK ADD!!
  6. 4x
  7. 5x
  8. 6x
  9. 7x
  10. 8x cmp cmp cmp cmp cmp cmp cmp cmp
  11. 9x RECHECK MULT!!
  12. ax asl;lsl lsr;asr
  13. bx or or or or or or or or
  14. cx and and and and and and and and
  15. dx xor xor xor xor xor xor xor xor
  16. ex BRA BRA;RTS BRA blt blt blt
  17. fx bne bne bne beq beq beq
  18. ## x8 x9 xa xb xc xd xe xf
  19. 0x MDFY ld xh enterl st xh leavel
  20. 1x ld ld ld ld ld ld ld ld
  21. 2x ?? st st st bcz st st st
  22. 3x RECHECK ADD!!
  23. 4x
  24. 5x
  25. 6x
  26. 7x
  27. 8x cmp cmp cmp cmp cmp cmp cmp cmp
  28. 9x tst tst tst bsr bsr bsr
  29. ax
  30. bx or or or or or or or or
  31. cx and and and and and and and and
  32. dx xor xor xor xor xor xor xor xor
  33. ex
  34. fx bcc bcc bcc bcs bcs bcs
  35. nop, ld, st,
  36. add, sub, umult, smult, sdiv, udiv
  37. lsr lsl
  38. asr asl
  39. bra, beq,bne, bcs,bcc,bcz blt bgt
  40. cmp tst
  41. and, or, xor
  42. enterl //begin routine
  43. leavel //end routine
  44. bsr, rts
  45. CHECK: bcs bgt
  46. Kollision mit st
  47. 0 , C belegt. beides sind ungültige immediate-modes für store
  48. asm opcodes:
  49. nop: 0x0000
  50. Zusatzbytes für Opcode: "parameterisiertes NOP"
  51. 0x??0X = specialcase-opcodes
  52. 0009 Modifier für nächsten opcode
  53. 0a load xh
  54. 0e st xh
  55. 0xb enterl
  56. Struktur:
  57. 0009 präfix(optional)
  58. xx00 Zusatzbyte (optional)
  59. xx00 Zusatzbyte (optional), für große parameter
  60. xxYY Opcode
  61. xx der integerparameter
  62. ld:
  63. Load Value into Register
  64. ld AL #CONSTANT: xx14 (0-127)
  65. Values itieriert von -32768-32767 in file.
  66. ld suffixes: AL 14, AH 10, X 18, Y 1C
  67. LSB Or-In
  68. 0x03: (????, Y) Load from Address, (offset based on register Y?)
  69. 0x02: (????, X) Load from Address, (offset based on register X?)
  70. 0x01: (????): Load From Address, absolute
  71. 0x00: Immediate
  72. LD specialcases:
  73. ld xh, @(1,y) = xx0e, Regel rausfinden, Riect nach dem MSByte für die bra-adresse
  74. st:
  75. Selbe Logik wie für ld bei Multibyte-Opcodes
  76. Store Register on Address
  77. st x, @address xx29
  78. st y, @address xx2d
  79. st al, @address xx25
  80. st ah, @address xx21
  81. LSB Or-In
  82. 0x03: (????, Y) Load from Address, (offset based on register Y?)
  83. 0x02: (????, X) Load from Address, (offset based on register X?)
  84. 0x01: (????): Load From Address, absolute
  85. 0x00: Ungültig, Immediate gilt hier nicht
  86. ST specialcases:
  87. st xh, @(1,y) = xx0a
  88. ADD:
  89. add AH #CONSTANT: XX30 (0-127)
  90. LSB OR-In
  91. Indirects Unacceptable
  92. 0x01: (????): Load From Address, absolute
  93. 0x00: Immediate
  94. sub AH #CONSTANT: XX50 (0-127)
  95. umult:
  96. smult:
  97. umult 0009 (Extensionbyte immer nötig für 09-flag)
  98. xx90
  99. smult
  100. xx90
  101. udiv:
  102. 0009
  103. xx94
  104. sdiv:
  105. xx94
  106. LSR:
  107. 0009
  108. xxa4
  109. LSL:
  110. xxa0
  111. ASR:
  112. xxa4
  113. ASL: == LSL, verhalten sich identisch
  114. xxa0
  115. bra:
  116. bra @x
  117. xxe1
  118. -128=0x80
  119. -1 = xff
  120. +127=7f
  121. bra @(x,Y)
  122. xxe3
  123. -128=0x80
  124. -1 = xff
  125. +127=7f
  126. bra @(x,X)
  127. xxe2
  128. -128=0x80
  129. -1 = xff
  130. +127=7f
  131. bsr:
  132. bsr: @(x,Y)
  133. xx9f
  134. bsr @(x,X)
  135. xx9e
  136. bsr @XX
  137. xx9d
  138. beq:
  139. beq: @(x,Y)
  140. xxf7
  141. beq @(x,X)
  142. xxf6
  143. beq @XX
  144. xxf5
  145. bne:
  146. bne: @(x,Y)
  147. xxf3
  148. bne @(x,X)
  149. xxf2
  150. bne @XX
  151. xxf1
  152. bcs:
  153. bcs: @(x,Y)
  154. xxff
  155. bcs @(x,X)
  156. xxfe
  157. bcs @XX
  158. xxfd
  159. bcc:
  160. bcc: @(x,Y)
  161. xxfb
  162. bcc @(x,X)
  163. xxfa
  164. bcc @XX
  165. xxf9
  166. bcz:
  167. bcz @XX
  168. xx2c
  169. kann nur direkt adressieren
  170. bgt:
  171. bgt @XX
  172. xx20
  173. kann nur direkt adressieren
  174. blt:
  175. blt @XX
  176. xxe5
  177. blt @(xx,x)
  178. xxe6
  179. blt @(xx,Y)
  180. xxe7
  181. --------------------------------------
  182. cmp:
  183. cmp AL #XX
  184. xx84
  185. cmp AL @x
  186. xx85
  187. cmp AL @(xx,X)
  188. xx86
  189. cmp AL @(xx,y)
  190. xx87
  191. cmp AH #XX
  192. xx80
  193. cmp AH @x
  194. xx81
  195. cmp AH @(xx,2)
  196. xx82
  197. cmp AH @(xx,y)
  198. xx83
  199. cmp X #XX
  200. xx88
  201. cmp X @x
  202. xx89
  203. cmp X @(xx,2)
  204. xx8a
  205. cmp X @(xx,y)
  206. xx8b
  207. cmp Y #XX
  208. xx8c
  209. cmp Y @x
  210. xx8d
  211. cmp Y @(xx,2)
  212. xx8e
  213. cmp Y @(xx,y)
  214. xx8f
  215. tst
  216. tst @XX
  217. xx99
  218. tst @(1,x)
  219. xx9a
  220. tst @(1,y)
  221. xx9b
  222. and:
  223. and AH #x
  224. xxc0
  225. and AH @x:
  226. xxc1
  227. and AH @(x,X):
  228. xxc2
  229. and AH @(x,Y):
  230. xxc3
  231. and AL #x
  232. xxc4
  233. and AL @x:
  234. xxc5
  235. and AL @(x,X):
  236. xxc6
  237. and AL @(x,Y):
  238. xxc7
  239. and X #x
  240. xxc8
  241. and X @x:
  242. xxc9
  243. and X @(x,X):
  244. xxca
  245. and X @(x,Y):
  246. xxcb
  247. and AL #x
  248. xxcc
  249. and AL @x:
  250. xxcd
  251. and AL @(x,X):
  252. xxce
  253. and AL @(x,Y):
  254. xxcf
  255. OR:
  256. OR AH #x
  257. xxb0
  258. OR AH @x:
  259. xxb1
  260. OR AH @(x,X):
  261. xxb2
  262. OR AH @(x,Y):
  263. xxb3
  264. OR AL #x
  265. xxb4
  266. OR AL @x:
  267. xxb5
  268. OR AL @(x,X):
  269. xxb6
  270. OR AL @(x,Y):
  271. xxb7
  272. OR X #x
  273. xxb8
  274. OR X @x:
  275. xxb9
  276. OR X @(x,X):
  277. xxba
  278. OR X @(x,Y):
  279. xxbb
  280. OR AL #x
  281. xxbc
  282. OR AL @x:
  283. xxbd
  284. OR AL @(x,X):
  285. xxbe
  286. OR AL @(x,Y):
  287. xxbf
  288. XOR:
  289. XOR AH #x
  290. xxd0
  291. XOR AH @x:
  292. xxd1
  293. XOR AH @(x,X):
  294. xxd2
  295. XOR AH @(x,Y):
  296. xxd3
  297. XOR AL #x
  298. xxd4
  299. XOR AL @x:
  300. xxd5
  301. XOR AL @(x,X):
  302. xxd6
  303. XOR AL @(x,Y):
  304. xxd7
  305. XOR X #x
  306. xxd8
  307. XOR X @x:
  308. xxd9
  309. XOR X @(x,X):
  310. xxda
  311. XOR X @(x,Y):
  312. xxdb
  313. XOR AL #x
  314. xxdc
  315. XOR AL @x:
  316. xxdd
  317. XOR AL @(x,X):
  318. xxde
  319. XOR AL @(x,Y):
  320. xxdf
  321. enterl: begin routine
  322. xx0b
  323. parametercode anders!!!, tabelle bruteforcen...
  324. leavel: end routine
  325. xx0f
  326. parameter gleich wie enterl
  327. rts
  328. 00e2
  329. ???? bra. == bra @(0,x)