ASMQuälcode.txt 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  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 add add add add add add add add
  6. 4x addc addc addc addc addc addc addc addc
  7. 5x sub sub sub sub sub sub sub sub
  8. 6x subc subc subc subc subc subc subc subc
  9. 7x nadd nadd nadd nadd nadd nadd nadd nadd
  10. 8x cmp cmp cmp cmp cmp cmp cmp cmp
  11. 9x xmult xmult xmult xmult xdiv xdiv xdiv xdiv
  12. ax asl;lsl asl;lsl asl;lsl asl;lsl lsr;asr lsr;asr lsr;asr 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 st xh enterl ld xh leavel
  20. 1x ld ld ld ld ld ld ld ld
  21. 2x blt st st st bcz st st st
  22. 3x add add add add add add add add
  23. 4x addc addc addc addc addc addc addc addc
  24. 5x sub sub sub sub sub sub sub sub
  25. 6x subc subc subc subc subc subc subc subc
  26. 7x nadd nadd nadd nadd nadd nadd nadd nadd
  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 bpl
  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. 0e load xh
  54. 0a st xh
  55. 0xb enterl
  56. Struktur:
  57. 0009 präfix(optional)
  58. fe09: brxl: branch for switchtable, muss dazu data dereferenzieren
  59. xx00 Zusatzbyte (optional)
  60. xx00 Zusatzbyte (optional), für große parameter
  61. xxYY Opcode
  62. xx der integerparameter
  63. ld:
  64. Load Value into Register
  65. ld AL #CONSTANT: xx14 (0-127)
  66. Values itieriert von -32768-32767 in file.
  67. ld suffixes: AL 14, AH 10, X 18, Y 1C
  68. LSB Or-In
  69. 0x03: (????, Y) Load from Address, (offset based on register Y?)
  70. 0x02: (????, X) Load from Address, (offset based on register X?)
  71. 0x01: (????): Load From Address, absolute
  72. 0x00: Immediate
  73. LD specialcases:
  74. ld xh, @(1,y) = xx0e, Regel rausfinden, Riect nach dem MSByte für die bra-adresse
  75. st:
  76. Selbe Logik wie für ld bei Multibyte-Opcodes
  77. Store Register on Address
  78. st x, @address xx29
  79. st y, @address xx2d
  80. st al, @address xx25
  81. st ah, @address xx21
  82. LSB Or-In
  83. 0x03: (????, Y) Load from Address, (offset based on register Y?)
  84. 0x02: (????, X) Load from Address, (offset based on register X?)
  85. 0x01: (????): Load From Address, absolute
  86. 0x00: Ungültig, Immediate gilt hier nicht
  87. ST specialcases:
  88. st xh, @(1,y) = xx0a
  89. ADD:
  90. ADD AH #XX
  91. xx30
  92. ADD AH @x
  93. xx31
  94. ADD AH @(xx,X)
  95. xx32
  96. ADD AH @(xx,y)
  97. xx33
  98. ADD AL #XX
  99. xx34
  100. ADD AL @x
  101. xx35
  102. ADD AL @(xx,X)
  103. xx36
  104. ADD AL @(xx,y)
  105. xx37
  106. ADD X #XX
  107. xx38
  108. ADD X @x
  109. xx39
  110. ADD X @(xx,X)
  111. xx3a
  112. ADD X @(xx,y)
  113. xx3b
  114. ADD Y #XX
  115. xx3c
  116. ADD Y @x
  117. xx3d
  118. ADD Y @(xx,X)
  119. xx3e
  120. ADD Y @(xx,y)
  121. xx3f
  122. sub:
  123. sub AH #XX
  124. xx50
  125. sub AH @x
  126. xx51
  127. sub AH @(xx,X)
  128. xx52
  129. sub AH @(xx,y)
  130. xx53
  131. sub AL #XX
  132. xx54
  133. sub AL @x
  134. xx55
  135. sub AL @(xx,X)
  136. xx56
  137. sub AL @(xx,y)
  138. xx57
  139. sub X #XX
  140. xx58
  141. sub X @x
  142. xx59
  143. sub X @(xx,X)
  144. xx5a
  145. sub X @(xx,y)
  146. xx5b
  147. sub Y #XX
  148. xx5c
  149. sub Y @x
  150. xx5d
  151. sub Y @(xx,X)
  152. xx5e
  153. sub Y @(xx,y)
  154. xx5f
  155. umult:
  156. smult:
  157. umult 0009 (Extensionbyte immer nötig für 09-flag)
  158. smult
  159. xx90
  160. xmult #XX
  161. xx90
  162. xmult @x
  163. xx91
  164. xmult @(xx,X)
  165. xx92
  166. xmult @(xx,y)
  167. xx93
  168. udiv:
  169. 0009 modifier
  170. sdiv:
  171. xdiv #XX
  172. xx94
  173. xdiv @x
  174. xx95
  175. xdiv @(xx,X)
  176. xx96
  177. xdiv @(xx,y)
  178. xx97
  179. LSR:
  180. 0009 Modifier
  181. ASR:
  182. ASR #XX
  183. xxA4
  184. ASR @x
  185. xxA5
  186. ASR @(xx,X)
  187. xxA6
  188. ASR @(xx,y)
  189. xxA7
  190. ASL:
  191. LSL:
  192. ASL #XX
  193. xxA0
  194. ASL @x
  195. xxA1
  196. ASL @(xx,X)
  197. xxA2
  198. ASL @(xx,y)
  199. xxA3
  200. ASL: == LSL, verhalten sich identisch
  201. bra:
  202. bra @x
  203. xxe1
  204. -128=0x80
  205. -1 = xff
  206. +127=7f
  207. bra @(x,Y)
  208. xxe3
  209. -128=0x80
  210. -1 = xff
  211. +127=7f
  212. bra @(x,X)
  213. xxe2
  214. -128=0x80
  215. -1 = xff
  216. +127=7f
  217. bsr:
  218. bsr: @(x,Y)
  219. xx9f
  220. bsr @(x,X)
  221. xx9e
  222. bsr @XX
  223. xx9d
  224. beq:
  225. beq: @(x,Y)
  226. xxf7
  227. beq @(x,X)
  228. xxf6
  229. beq @XX
  230. xxf5
  231. bne:
  232. bne: @(x,Y)
  233. xxf3
  234. bne @(x,X)
  235. xxf2
  236. bne @XX
  237. xxf1
  238. bcs:
  239. bcs: @(x,Y)
  240. xxff
  241. bcs @(x,X)
  242. xxfe
  243. bcs @XX
  244. xxfd
  245. bcc:
  246. bcc: @(x,Y)
  247. xxfb
  248. bcc @(x,X)
  249. xxfa
  250. bcc @XX
  251. xxf9
  252. bcz:
  253. bcz @XX
  254. xx2c
  255. kann nur direkt adressieren
  256. bgt:
  257. bgt @XX
  258. xx20
  259. kann nur direkt adressieren
  260. blt:
  261. blt @XX
  262. xxe5
  263. blt @(xx,x)
  264. xxe6
  265. blt @(xx,Y)
  266. xxe7
  267. --------------------------------------
  268. cmp:
  269. cmp AL #XX
  270. xx84
  271. cmp AL @x
  272. xx85
  273. cmp AL @(xx,X)
  274. xx86
  275. cmp AL @(xx,y)
  276. xx87
  277. cmp AH #XX
  278. xx80
  279. cmp AH @x
  280. xx81
  281. cmp AH @(xx,X)
  282. xx82
  283. cmp AH @(xx,y)
  284. xx83
  285. cmp X #XX
  286. xx88
  287. cmp X @x
  288. xx89
  289. cmp X @(xx,X)
  290. xx8a
  291. cmp X @(xx,y)
  292. xx8b
  293. cmp Y #XX
  294. xx8c
  295. cmp Y @x
  296. xx8d
  297. cmp Y @(xx,X)
  298. xx8e
  299. cmp Y @(xx,y)
  300. xx8f
  301. tst
  302. tst @XX
  303. xx99
  304. tst @(1,x)
  305. xx9a
  306. tst @(1,y)
  307. xx9b
  308. and:
  309. and AH #x
  310. xxc0
  311. and AH @x:
  312. xxc1
  313. and AH @(x,X):
  314. xxc2
  315. and AH @(x,Y):
  316. xxc3
  317. and AL #x
  318. xxc4
  319. and AL @x:
  320. xxc5
  321. and AL @(x,X):
  322. xxc6
  323. and AL @(x,Y):
  324. xxc7
  325. and X #x
  326. xxc8
  327. and X @x:
  328. xxc9
  329. and X @(x,X):
  330. xxca
  331. and X @(x,Y):
  332. xxcb
  333. and AL #x
  334. xxcc
  335. and AL @x:
  336. xxcd
  337. and AL @(x,X):
  338. xxce
  339. and AL @(x,Y):
  340. xxcf
  341. OR:
  342. OR AH #x
  343. xxb0
  344. OR AH @x:
  345. xxb1
  346. OR AH @(x,X):
  347. xxb2
  348. OR AH @(x,Y):
  349. xxb3
  350. OR AL #x
  351. xxb4
  352. OR AL @x:
  353. xxb5
  354. OR AL @(x,X):
  355. xxb6
  356. OR AL @(x,Y):
  357. xxb7
  358. OR X #x
  359. xxb8
  360. OR X @x:
  361. xxb9
  362. OR X @(x,X):
  363. xxba
  364. OR X @(x,Y):
  365. xxbb
  366. OR AL #x
  367. xxbc
  368. OR AL @x:
  369. xxbd
  370. OR AL @(x,X):
  371. xxbe
  372. OR AL @(x,Y):
  373. xxbf
  374. XOR:
  375. XOR AH #x
  376. xxd0
  377. XOR AH @x:
  378. xxd1
  379. XOR AH @(x,X):
  380. xxd2
  381. XOR AH @(x,Y):
  382. xxd3
  383. XOR AL #x
  384. xxd4
  385. XOR AL @x:
  386. xxd5
  387. XOR AL @(x,X):
  388. xxd6
  389. XOR AL @(x,Y):
  390. xxd7
  391. XOR X #x
  392. xxd8
  393. XOR X @x:
  394. xxd9
  395. XOR X @(x,X):
  396. xxda
  397. XOR X @(x,Y):
  398. xxdb
  399. XOR AL #x
  400. xxdc
  401. XOR AL @x:
  402. xxdd
  403. XOR AL @(x,X):
  404. xxde
  405. XOR AL @(x,Y):
  406. xxdf
  407. enterl: begin routine
  408. xx0b
  409. parametercode anders!!!, tabelle bruteforcen...
  410. leavel: end routine
  411. xx0f
  412. parameter gleich wie enterl
  413. rts
  414. 00e2
  415. ???? bra. == bra @(0,x)