1
0

ASMQuälcode.txt 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  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
  7. 5x sub sub sub sub sub sub sub sub
  8. 6x
  9. 7x
  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 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 add add add add add add add add
  23. 4x
  24. 5x sub sub sub sub sub sub sub sub
  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 #XX
  90. xx30
  91. ADD AH @x
  92. xx31
  93. ADD AH @(xx,X)
  94. xx32
  95. ADD AH @(xx,y)
  96. xx33
  97. ADD AL #XX
  98. xx34
  99. ADD AL @x
  100. xx35
  101. ADD AL @(xx,X)
  102. xx36
  103. ADD AL @(xx,y)
  104. xx37
  105. ADD X #XX
  106. xx38
  107. ADD X @x
  108. xx39
  109. ADD X @(xx,X)
  110. xx3a
  111. ADD X @(xx,y)
  112. xx3b
  113. ADD Y #XX
  114. xx3c
  115. ADD Y @x
  116. xx3d
  117. ADD Y @(xx,X)
  118. xx3e
  119. ADD Y @(xx,y)
  120. xx3f
  121. sub:
  122. sub AH #XX
  123. xx50
  124. sub AH @x
  125. xx51
  126. sub AH @(xx,X)
  127. xx52
  128. sub AH @(xx,y)
  129. xx53
  130. sub AL #XX
  131. xx54
  132. sub AL @x
  133. xx55
  134. sub AL @(xx,X)
  135. xx56
  136. sub AL @(xx,y)
  137. xx57
  138. sub X #XX
  139. xx58
  140. sub X @x
  141. xx59
  142. sub X @(xx,X)
  143. xx5a
  144. sub X @(xx,y)
  145. xx5b
  146. sub Y #XX
  147. xx5c
  148. sub Y @x
  149. xx5d
  150. sub Y @(xx,X)
  151. xx5e
  152. sub Y @(xx,y)
  153. xx5f
  154. umult:
  155. smult:
  156. umult 0009 (Extensionbyte immer nötig für 09-flag)
  157. smult
  158. xx90
  159. xmult #XX
  160. xx90
  161. xmult @x
  162. xx91
  163. xmult @(xx,X)
  164. xx92
  165. xmult @(xx,y)
  166. xx93
  167. udiv:
  168. 0009 modifier
  169. sdiv:
  170. xdiv #XX
  171. xx94
  172. xdiv @x
  173. xx95
  174. xdiv @(xx,X)
  175. xx96
  176. xdiv @(xx,y)
  177. xx97
  178. LSR:
  179. 0009 Modifier
  180. ASR:
  181. ASR #XX
  182. xxA4
  183. ASR @x
  184. xxA5
  185. ASR @(xx,X)
  186. xxA6
  187. ASR @(xx,y)
  188. xxA7
  189. ASL:
  190. LSL:
  191. ASL #XX
  192. xxA0
  193. ASL @x
  194. xxA1
  195. ASL @(xx,X)
  196. xxA2
  197. ASL @(xx,y)
  198. xxA3
  199. ASL: == LSL, verhalten sich identisch
  200. bra:
  201. bra @x
  202. xxe1
  203. -128=0x80
  204. -1 = xff
  205. +127=7f
  206. bra @(x,Y)
  207. xxe3
  208. -128=0x80
  209. -1 = xff
  210. +127=7f
  211. bra @(x,X)
  212. xxe2
  213. -128=0x80
  214. -1 = xff
  215. +127=7f
  216. bsr:
  217. bsr: @(x,Y)
  218. xx9f
  219. bsr @(x,X)
  220. xx9e
  221. bsr @XX
  222. xx9d
  223. beq:
  224. beq: @(x,Y)
  225. xxf7
  226. beq @(x,X)
  227. xxf6
  228. beq @XX
  229. xxf5
  230. bne:
  231. bne: @(x,Y)
  232. xxf3
  233. bne @(x,X)
  234. xxf2
  235. bne @XX
  236. xxf1
  237. bcs:
  238. bcs: @(x,Y)
  239. xxff
  240. bcs @(x,X)
  241. xxfe
  242. bcs @XX
  243. xxfd
  244. bcc:
  245. bcc: @(x,Y)
  246. xxfb
  247. bcc @(x,X)
  248. xxfa
  249. bcc @XX
  250. xxf9
  251. bcz:
  252. bcz @XX
  253. xx2c
  254. kann nur direkt adressieren
  255. bgt:
  256. bgt @XX
  257. xx20
  258. kann nur direkt adressieren
  259. blt:
  260. blt @XX
  261. xxe5
  262. blt @(xx,x)
  263. xxe6
  264. blt @(xx,Y)
  265. xxe7
  266. --------------------------------------
  267. cmp:
  268. cmp AL #XX
  269. xx84
  270. cmp AL @x
  271. xx85
  272. cmp AL @(xx,X)
  273. xx86
  274. cmp AL @(xx,y)
  275. xx87
  276. cmp AH #XX
  277. xx80
  278. cmp AH @x
  279. xx81
  280. cmp AH @(xx,X)
  281. xx82
  282. cmp AH @(xx,y)
  283. xx83
  284. cmp X #XX
  285. xx88
  286. cmp X @x
  287. xx89
  288. cmp X @(xx,X)
  289. xx8a
  290. cmp X @(xx,y)
  291. xx8b
  292. cmp Y #XX
  293. xx8c
  294. cmp Y @x
  295. xx8d
  296. cmp Y @(xx,X)
  297. xx8e
  298. cmp Y @(xx,y)
  299. xx8f
  300. tst
  301. tst @XX
  302. xx99
  303. tst @(1,x)
  304. xx9a
  305. tst @(1,y)
  306. xx9b
  307. and:
  308. and AH #x
  309. xxc0
  310. and AH @x:
  311. xxc1
  312. and AH @(x,X):
  313. xxc2
  314. and AH @(x,Y):
  315. xxc3
  316. and AL #x
  317. xxc4
  318. and AL @x:
  319. xxc5
  320. and AL @(x,X):
  321. xxc6
  322. and AL @(x,Y):
  323. xxc7
  324. and X #x
  325. xxc8
  326. and X @x:
  327. xxc9
  328. and X @(x,X):
  329. xxca
  330. and X @(x,Y):
  331. xxcb
  332. and AL #x
  333. xxcc
  334. and AL @x:
  335. xxcd
  336. and AL @(x,X):
  337. xxce
  338. and AL @(x,Y):
  339. xxcf
  340. OR:
  341. OR AH #x
  342. xxb0
  343. OR AH @x:
  344. xxb1
  345. OR AH @(x,X):
  346. xxb2
  347. OR AH @(x,Y):
  348. xxb3
  349. OR AL #x
  350. xxb4
  351. OR AL @x:
  352. xxb5
  353. OR AL @(x,X):
  354. xxb6
  355. OR AL @(x,Y):
  356. xxb7
  357. OR X #x
  358. xxb8
  359. OR X @x:
  360. xxb9
  361. OR X @(x,X):
  362. xxba
  363. OR X @(x,Y):
  364. xxbb
  365. OR AL #x
  366. xxbc
  367. OR AL @x:
  368. xxbd
  369. OR AL @(x,X):
  370. xxbe
  371. OR AL @(x,Y):
  372. xxbf
  373. XOR:
  374. XOR AH #x
  375. xxd0
  376. XOR AH @x:
  377. xxd1
  378. XOR AH @(x,X):
  379. xxd2
  380. XOR AH @(x,Y):
  381. xxd3
  382. XOR AL #x
  383. xxd4
  384. XOR AL @x:
  385. xxd5
  386. XOR AL @(x,X):
  387. xxd6
  388. XOR AL @(x,Y):
  389. xxd7
  390. XOR X #x
  391. xxd8
  392. XOR X @x:
  393. xxd9
  394. XOR X @(x,X):
  395. xxda
  396. XOR X @(x,Y):
  397. xxdb
  398. XOR AL #x
  399. xxdc
  400. XOR AL @x:
  401. xxdd
  402. XOR AL @(x,X):
  403. xxde
  404. XOR AL @(x,Y):
  405. xxdf
  406. enterl: begin routine
  407. xx0b
  408. parametercode anders!!!, tabelle bruteforcen...
  409. leavel: end routine
  410. xx0f
  411. parameter gleich wie enterl
  412. rts
  413. 00e2
  414. ???? bra. == bra @(0,x)