movb.s 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319
  1. # Hitachi H8 testcase 'mov.b'
  2. # mach(): h8300h h8300s h8sx
  3. # as(h8300h): --defsym sim_cpu=1
  4. # as(h8300s): --defsym sim_cpu=2
  5. # as(h8sx): --defsym sim_cpu=3
  6. # ld(h8300h): -m h8300helf
  7. # ld(h8300s): -m h8300self
  8. # ld(h8sx): -m h8300sxelf
  9. .include "testutils.inc"
  10. start
  11. .data
  12. .align 4
  13. byte_dst_dec:
  14. .byte 0
  15. byte_src:
  16. .byte 0x77
  17. byte_dst:
  18. .byte 0
  19. .text
  20. ;;
  21. ;; Move byte from immediate source
  22. ;;
  23. .if (sim_cpu == h8sx)
  24. mov_b_imm8_to_reg8:
  25. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  26. set_ccr_zero
  27. ;; mov.b #xx:8, rd
  28. mov.b #0x77:8, r0l ; Immediate 3-bit operand
  29. ;;; .word 0xf877
  30. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  31. test_neg_clear
  32. test_zero_clear
  33. test_ovf_clear
  34. test_carry_clear
  35. test_h_gr32 0xa5a5a577 er0
  36. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  37. test_gr_a5a5 2
  38. test_gr_a5a5 3
  39. test_gr_a5a5 4
  40. test_gr_a5a5 5
  41. test_gr_a5a5 6
  42. test_gr_a5a5 7
  43. .endif
  44. .if (sim_cpu == h8sx)
  45. mov_b_imm4_to_abs16:
  46. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  47. set_ccr_zero
  48. ;; mov.b #xx:4, @aa:16
  49. mov.b #0xf:4, @byte_dst:16 ; 16-bit address-direct operand
  50. ;;; .word 0x6adf
  51. ;;; .word @byte_dst
  52. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  53. test_neg_clear
  54. test_zero_clear
  55. test_ovf_clear
  56. test_carry_clear
  57. test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
  58. test_gr_a5a5 1 ; (first, because on h8/300 we must use one
  59. test_gr_a5a5 2 ; to examine the destination memory).
  60. test_gr_a5a5 3
  61. test_gr_a5a5 4
  62. test_gr_a5a5 5
  63. test_gr_a5a5 6
  64. test_gr_a5a5 7
  65. ;; Now check the result of the move to memory.
  66. cmp.b #0xf, @byte_dst
  67. beq .Lnext21
  68. fail
  69. .Lnext21:
  70. mov.b #0, @byte_dst ; zero it again for the next use.
  71. mov_b_imm4_to_abs32:
  72. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  73. set_ccr_zero
  74. ;; mov.b #xx:4, @aa:32
  75. mov.b #0xf:4, @byte_dst:32 ; 32-bit address-direct operand
  76. ;;; .word 0x6aff
  77. ;;; .long @byte_dst
  78. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  79. test_neg_clear
  80. test_zero_clear
  81. test_ovf_clear
  82. test_carry_clear
  83. test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
  84. test_gr_a5a5 1 ; (first, because on h8/300 we must use one
  85. test_gr_a5a5 2 ; to examine the destination memory).
  86. test_gr_a5a5 3
  87. test_gr_a5a5 4
  88. test_gr_a5a5 5
  89. test_gr_a5a5 6
  90. test_gr_a5a5 7
  91. ;; Now check the result of the move to memory.
  92. cmp.b #0xf, @byte_dst
  93. beq .Lnext22
  94. fail
  95. .Lnext22:
  96. mov.b #0, @byte_dst ; zero it again for the next use.
  97. mov_b_imm8_to_indirect:
  98. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  99. set_ccr_zero
  100. ;; mov.b #xx:8, @erd
  101. mov.l #byte_dst, er1
  102. mov.b #0xa5:8, @er1 ; Register indirect operand
  103. ;;; .word 0x017d
  104. ;;; .word 0x01a5
  105. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  106. test_neg_set
  107. test_zero_clear
  108. test_ovf_clear
  109. test_carry_clear
  110. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  111. test_h_gr32 byte_dst, er1
  112. test_gr_a5a5 2
  113. test_gr_a5a5 3
  114. test_gr_a5a5 4
  115. test_gr_a5a5 5
  116. test_gr_a5a5 6
  117. test_gr_a5a5 7
  118. ;; Now check the result of the move to memory.
  119. cmp.b #0xa5, @byte_dst
  120. beq .Lnext1
  121. fail
  122. .Lnext1:
  123. mov.b #0, @byte_dst ; zero it again for the next use.
  124. mov_b_imm8_to_postinc: ; post-increment from imm8 to mem
  125. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  126. set_ccr_zero
  127. ;; mov.b #xx:8, @erd+
  128. mov.l #byte_dst, er1
  129. mov.b #0xa5:8, @er1+ ; Imm8, register post-incr operands.
  130. ;;; .word 0x017d
  131. ;;; .word 0x81a5
  132. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  133. test_neg_set
  134. test_zero_clear
  135. test_ovf_clear
  136. test_carry_clear
  137. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  138. test_h_gr32 byte_dst+1, er1
  139. test_gr_a5a5 2
  140. test_gr_a5a5 3
  141. test_gr_a5a5 4
  142. test_gr_a5a5 5
  143. test_gr_a5a5 6
  144. test_gr_a5a5 7
  145. ;; Now check the result of the move to memory.
  146. cmp.b #0xa5, @byte_dst
  147. beq .Lnext2
  148. fail
  149. .Lnext2:
  150. mov.b #0, @byte_dst ; zero it again for the next use.
  151. mov_b_imm8_to_postdec: ; post-decrement from imm8 to mem
  152. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  153. set_ccr_zero
  154. ;; mov.b #xx:8, @erd-
  155. mov.l #byte_dst, er1
  156. mov.b #0xa5:8, @er1- ; Imm8, register post-decr operands.
  157. ;;; .word 0x017d
  158. ;;; .word 0xa1a5
  159. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  160. test_neg_set
  161. test_zero_clear
  162. test_ovf_clear
  163. test_carry_clear
  164. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  165. test_h_gr32 byte_dst-1, er1
  166. test_gr_a5a5 2
  167. test_gr_a5a5 3
  168. test_gr_a5a5 4
  169. test_gr_a5a5 5
  170. test_gr_a5a5 6
  171. test_gr_a5a5 7
  172. ;; Now check the result of the move to memory.
  173. cmp.b #0xa5, @byte_dst
  174. beq .Lnext3
  175. fail
  176. .Lnext3:
  177. mov.b #0, @byte_dst ; zero it again for the next use.
  178. mov_b_imm8_to_preinc: ; pre-increment from register to mem
  179. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  180. set_ccr_zero
  181. ;; mov.b #xx:8, @+erd
  182. mov.l #byte_dst-1, er1
  183. mov.b #0xa5:8, @+er1 ; Imm8, register pre-incr operands
  184. ;;; .word 0x017d
  185. ;;; .word 0x91a5
  186. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  187. test_neg_set
  188. test_zero_clear
  189. test_ovf_clear
  190. test_carry_clear
  191. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  192. test_h_gr32 byte_dst, er1
  193. test_gr_a5a5 2
  194. test_gr_a5a5 3
  195. test_gr_a5a5 4
  196. test_gr_a5a5 5
  197. test_gr_a5a5 6
  198. test_gr_a5a5 7
  199. ;; Now check the result of the move to memory.
  200. cmp.b #0xa5, @byte_dst
  201. beq .Lnext4
  202. fail
  203. .Lnext4:
  204. mov.b #0, @byte_dst ; zero it again for the next use.
  205. mov_b_imm8_to_predec: ; pre-decrement from register to mem
  206. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  207. set_ccr_zero
  208. ;; mov.b #xx:8, @-erd
  209. mov.l #byte_dst+1, er1
  210. mov.b #0xa5:8, @-er1 ; Imm8, register pre-decr operands
  211. ;;; .word 0x017d
  212. ;;; .word 0xb1a5
  213. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  214. test_neg_set
  215. test_zero_clear
  216. test_ovf_clear
  217. test_carry_clear
  218. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  219. test_h_gr32 byte_dst, er1
  220. test_gr_a5a5 2
  221. test_gr_a5a5 3
  222. test_gr_a5a5 4
  223. test_gr_a5a5 5
  224. test_gr_a5a5 6
  225. test_gr_a5a5 7
  226. ;; Now check the result of the move to memory.
  227. cmp.b #0xa5, @byte_dst
  228. beq .Lnext5
  229. fail
  230. .Lnext5:
  231. mov.b #0, @byte_dst ; zero it again for the next use.
  232. mov_b_imm8_to_disp2:
  233. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  234. set_ccr_zero
  235. ;; mov.b #xx:8, @(dd:2, erd)
  236. mov.l #byte_dst-3, er1
  237. mov.b #0xa5:8, @(3:2, er1) ; Imm8, reg plus 2-bit disp. operand
  238. ;;; .word 0x017d
  239. ;;; .word 0x31a5
  240. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  241. test_neg_set
  242. test_zero_clear
  243. test_ovf_clear
  244. test_carry_clear
  245. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  246. test_h_gr32 byte_dst-3, er1
  247. test_gr_a5a5 2
  248. test_gr_a5a5 3
  249. test_gr_a5a5 4
  250. test_gr_a5a5 5
  251. test_gr_a5a5 6
  252. test_gr_a5a5 7
  253. ;; Now check the result of the move to memory.
  254. cmp.b #0xa5, @byte_dst
  255. beq .Lnext6
  256. fail
  257. .Lnext6:
  258. mov.b #0, @byte_dst ; zero it again for the next use.
  259. mov_b_imm8_to_disp16:
  260. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  261. set_ccr_zero
  262. ;; mov.b #xx:8, @(dd:16, erd)
  263. mov.l #byte_dst-4, er1
  264. mov.b #0xa5:8, @(4:16, er1) ; Register plus 16-bit disp. operand
  265. ;;; .word 0x017d
  266. ;;; .word 0x6f90
  267. ;;; .word 0x0004
  268. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  269. test_neg_set
  270. test_zero_clear
  271. test_ovf_clear
  272. test_carry_clear
  273. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  274. test_h_gr32 byte_dst-4, er1
  275. test_gr_a5a5 2
  276. test_gr_a5a5 3
  277. test_gr_a5a5 4
  278. test_gr_a5a5 5
  279. test_gr_a5a5 6
  280. test_gr_a5a5 7
  281. ;; Now check the result of the move to memory.
  282. cmp.b #0xa5, @byte_dst
  283. beq .Lnext7
  284. fail
  285. .Lnext7:
  286. mov.b #0, @byte_dst ; zero it again for the next use.
  287. mov_b_imm8_to_disp32:
  288. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  289. set_ccr_zero
  290. ;; mov.b #xx:8, @(dd:32, erd)
  291. mov.l #byte_dst-8, er1
  292. mov.b #0xa5:8, @(8:32, er1) ; Register plus 32-bit disp. operand
  293. ;;; .word 0x017d
  294. ;;; .word 0xc9a5
  295. ;;; .long 8
  296. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  297. test_neg_set
  298. test_zero_clear
  299. test_ovf_clear
  300. test_carry_clear
  301. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  302. test_h_gr32 byte_dst-8, er1
  303. test_gr_a5a5 2
  304. test_gr_a5a5 3
  305. test_gr_a5a5 4
  306. test_gr_a5a5 5
  307. test_gr_a5a5 6
  308. test_gr_a5a5 7
  309. ;; Now check the result of the move to memory.
  310. cmp.b #0xa5, @byte_dst
  311. beq .Lnext8
  312. fail
  313. .Lnext8:
  314. mov.b #0, @byte_dst ; zero it again for the next use.
  315. mov_b_imm8_to_indexb16:
  316. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  317. mov.l #0xffffff01, er1
  318. set_ccr_zero
  319. ;; mov.b #xx:8, @(dd:16, rd.b)
  320. mov.b #0xa5:8, @(byte_dst-1:16, r1.b) ; byte indexed operand
  321. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  322. test_neg_set
  323. test_zero_clear
  324. test_ovf_clear
  325. test_carry_clear
  326. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  327. test_h_gr32 0xffffff01, er1
  328. test_gr_a5a5 2
  329. test_gr_a5a5 3
  330. test_gr_a5a5 4
  331. test_gr_a5a5 5
  332. test_gr_a5a5 6
  333. test_gr_a5a5 7
  334. ;; Now check the result of the move to memory.
  335. cmp.b #0xa5, @byte_dst
  336. bne fail1
  337. mov.b #0, @byte_dst ; zero it again for the next use.
  338. mov_b_imm8_to_indexw16:
  339. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  340. mov.l #0xffff0002, er1
  341. set_ccr_zero
  342. ;; mov.b #xx:8, @(dd:16, rd.w)
  343. mov.b #0xa5:8, @(byte_dst-2:16, r1.w) ; byte indexed operand
  344. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  345. test_neg_set
  346. test_zero_clear
  347. test_ovf_clear
  348. test_carry_clear
  349. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  350. test_h_gr32 0xffff0002, er1
  351. test_gr_a5a5 2
  352. test_gr_a5a5 3
  353. test_gr_a5a5 4
  354. test_gr_a5a5 5
  355. test_gr_a5a5 6
  356. test_gr_a5a5 7
  357. ;; Now check the result of the move to memory.
  358. cmp.b #0xa5, @byte_dst
  359. bne fail1
  360. mov.b #0, @byte_dst ; zero it again for the next use.
  361. mov_b_imm8_to_indexl16:
  362. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  363. mov.l #0x00000003, er1
  364. set_ccr_zero
  365. ;; mov.b #xx:8, @(dd:16, erd.l)
  366. mov.b #0xa5:8, @(byte_dst-3:16, er1.l) ; byte indexed operand
  367. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  368. test_neg_set
  369. test_zero_clear
  370. test_ovf_clear
  371. test_carry_clear
  372. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  373. test_h_gr32 0x00000003, er1
  374. test_gr_a5a5 2
  375. test_gr_a5a5 3
  376. test_gr_a5a5 4
  377. test_gr_a5a5 5
  378. test_gr_a5a5 6
  379. test_gr_a5a5 7
  380. ;; Now check the result of the move to memory.
  381. cmp.b #0xa5, @byte_dst
  382. bne fail1
  383. mov.b #0, @byte_dst ; zero it again for the next use.
  384. mov_b_imm8_to_indexb32:
  385. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  386. mov.l #0xffffff04, er1
  387. set_ccr_zero
  388. ;; mov.b #xx:8, @(dd:32, rd.b)
  389. mov.b #0xa5:8, @(byte_dst-4:32, r1.b) ; byte indexed operand
  390. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  391. test_neg_set
  392. test_zero_clear
  393. test_ovf_clear
  394. test_carry_clear
  395. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  396. test_h_gr32 0xffffff04 er1
  397. test_gr_a5a5 2
  398. test_gr_a5a5 3
  399. test_gr_a5a5 4
  400. test_gr_a5a5 5
  401. test_gr_a5a5 6
  402. test_gr_a5a5 7
  403. ;; Now check the result of the move to memory.
  404. cmp.b #0xa5, @byte_dst
  405. bne fail1
  406. mov.b #0, @byte_dst ; zero it again for the next use.
  407. mov_b_imm8_to_indexw32:
  408. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  409. mov.l #0xffff0005, er1
  410. set_ccr_zero
  411. ;; mov.b #xx:8, @(dd:32, rd.w)
  412. mov.b #0xa5:8, @(byte_dst-5:32, r1.w) ; byte indexed operand
  413. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  414. test_neg_set
  415. test_zero_clear
  416. test_ovf_clear
  417. test_carry_clear
  418. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  419. test_h_gr32 0xffff0005 er1
  420. test_gr_a5a5 2
  421. test_gr_a5a5 3
  422. test_gr_a5a5 4
  423. test_gr_a5a5 5
  424. test_gr_a5a5 6
  425. test_gr_a5a5 7
  426. ;; Now check the result of the move to memory.
  427. cmp.b #0xa5, @byte_dst
  428. bne fail1
  429. mov.b #0, @byte_dst ; zero it again for the next use.
  430. mov_b_imm8_to_indexl32:
  431. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  432. mov.l #0x00000006, er1
  433. set_ccr_zero
  434. ;; mov.b #xx:8, @(dd:32, erd.l)
  435. mov.b #0xa5:8, @(byte_dst-6:32, er1.l) ; byte indexed operand
  436. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  437. test_neg_set
  438. test_zero_clear
  439. test_ovf_clear
  440. test_carry_clear
  441. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  442. test_h_gr32 0x00000006 er1
  443. test_gr_a5a5 2
  444. test_gr_a5a5 3
  445. test_gr_a5a5 4
  446. test_gr_a5a5 5
  447. test_gr_a5a5 6
  448. test_gr_a5a5 7
  449. ;; Now check the result of the move to memory.
  450. cmp.b #0xa5, @byte_dst
  451. bne fail1
  452. mov.b #0, @byte_dst ; zero it again for the next use.
  453. mov_b_imm8_to_abs16:
  454. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  455. set_ccr_zero
  456. ;; mov.b #xx:8, @aa:16
  457. mov.b #0xa5:8, @byte_dst:16 ; 16-bit address-direct operand
  458. ;;; .word 0x017d
  459. ;;; .word 0x40a5
  460. ;;; .word @byte_dst
  461. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  462. test_neg_set
  463. test_zero_clear
  464. test_ovf_clear
  465. test_carry_clear
  466. test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
  467. test_gr_a5a5 1 ; (first, because on h8/300 we must use one
  468. test_gr_a5a5 2 ; to examine the destination memory).
  469. test_gr_a5a5 3
  470. test_gr_a5a5 4
  471. test_gr_a5a5 5
  472. test_gr_a5a5 6
  473. test_gr_a5a5 7
  474. ;; Now check the result of the move to memory.
  475. cmp.b #0xa5, @byte_dst
  476. beq .Lnext9
  477. fail
  478. .Lnext9:
  479. mov.b #0, @byte_dst ; zero it again for the next use.
  480. mov_b_imm8_to_abs32:
  481. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  482. set_ccr_zero
  483. ;; mov.b #xx:8, @aa:32
  484. mov.b #0xa5:8, @byte_dst:32 ; 32-bit address-direct operand
  485. ;;; .word 0x017d
  486. ;;; .word 0x48a5
  487. ;;; .long @byte_dst
  488. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  489. test_neg_set
  490. test_zero_clear
  491. test_ovf_clear
  492. test_carry_clear
  493. test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
  494. test_gr_a5a5 1 ; (first, because on h8/300 we must use one
  495. test_gr_a5a5 2 ; to examine the destination memory).
  496. test_gr_a5a5 3
  497. test_gr_a5a5 4
  498. test_gr_a5a5 5
  499. test_gr_a5a5 6
  500. test_gr_a5a5 7
  501. ;; Now check the result of the move to memory.
  502. cmp.b #0xa5, @byte_dst
  503. beq .Lnext10
  504. fail
  505. .Lnext10:
  506. mov.b #0, @byte_dst ; zero it again for the next use.
  507. .endif
  508. ;;
  509. ;; Move byte from register source
  510. ;;
  511. mov_b_reg8_to_reg8:
  512. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  513. set_ccr_zero
  514. ;; mov.b ers, erd
  515. mov.b #0x12, r1l
  516. mov.b r1l, r0l ; Register 8-bit operand
  517. ;;; .word 0x0c98
  518. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  519. test_neg_clear
  520. test_zero_clear
  521. test_ovf_clear
  522. test_carry_clear
  523. test_h_gr16 0xa512 r0
  524. test_h_gr16 0xa512 r1 ; mov src unchanged
  525. .if (sim_cpu)
  526. test_h_gr32 0xa5a5a512 er0
  527. test_h_gr32 0xa5a5a512 er1 ; mov src unchanged
  528. .endif
  529. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  530. test_gr_a5a5 3
  531. test_gr_a5a5 4
  532. test_gr_a5a5 5
  533. test_gr_a5a5 6
  534. test_gr_a5a5 7
  535. mov_b_reg8_to_indirect:
  536. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  537. set_ccr_zero
  538. ;; mov.b ers, @erd
  539. mov.l #byte_dst, er1
  540. mov.b r0l, @er1 ; Register indirect operand
  541. ;;; .word 0x6898
  542. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  543. test_neg_set
  544. test_zero_clear
  545. test_ovf_clear
  546. test_carry_clear
  547. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  548. test_h_gr32 byte_dst, er1
  549. test_gr_a5a5 2
  550. test_gr_a5a5 3
  551. test_gr_a5a5 4
  552. test_gr_a5a5 5
  553. test_gr_a5a5 6
  554. test_gr_a5a5 7
  555. ;; Now check the result of the move to memory.
  556. mov.b @byte_dst, r0l
  557. cmp.b r2l, r0l
  558. beq .Lnext44
  559. fail
  560. .Lnext44:
  561. mov.b #0, r0l
  562. mov.b r0l, @byte_dst ; zero it again for the next use.
  563. .if (sim_cpu == h8sx)
  564. mov_b_reg8_to_postinc: ; post-increment from register to mem
  565. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  566. set_ccr_zero
  567. ;; mov.b ers, @erd+
  568. mov.l #byte_dst, er1
  569. mov.b r0l, @er1+ ; Register post-incr operand
  570. ;;; .word 0x0173
  571. ;;; .word 0x6c98
  572. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  573. test_neg_set
  574. test_zero_clear
  575. test_ovf_clear
  576. test_carry_clear
  577. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  578. test_h_gr32 byte_dst+1, er1
  579. test_gr_a5a5 2
  580. test_gr_a5a5 3
  581. test_gr_a5a5 4
  582. test_gr_a5a5 5
  583. test_gr_a5a5 6
  584. test_gr_a5a5 7
  585. ;; Now check the result of the move to memory.
  586. cmp.b r2l, @byte_dst
  587. beq .Lnext49
  588. fail
  589. .Lnext49:
  590. ;; special case same register
  591. mov.l #byte_dst, er0
  592. mov.b r0l, r1l
  593. inc.b r1l
  594. mov.b r0l, @er0+
  595. mov.b @byte_dst, r0l
  596. cmp.b r0l, r1l
  597. beq .Lnext53
  598. fail
  599. .Lnext53:
  600. mov.b #0, @byte_dst ; zero it again for the next use.
  601. mov_b_reg8_to_postdec: ; post-decrement from register to mem
  602. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  603. set_ccr_zero
  604. ;; mov.b ers, @erd-
  605. mov.l #byte_dst, er1
  606. mov.b r0l, @er1- ; Register post-decr operand
  607. ;;; .word 0x0171
  608. ;;; .word 0x6c98
  609. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  610. test_neg_set
  611. test_zero_clear
  612. test_ovf_clear
  613. test_carry_clear
  614. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  615. test_h_gr32 byte_dst-1, er1
  616. test_gr_a5a5 2
  617. test_gr_a5a5 3
  618. test_gr_a5a5 4
  619. test_gr_a5a5 5
  620. test_gr_a5a5 6
  621. test_gr_a5a5 7
  622. ;; Now check the result of the move to memory.
  623. cmp.b r2l, @byte_dst
  624. beq .Lnext50
  625. fail
  626. .Lnext50:
  627. ;; special case same register
  628. mov.l #byte_dst, er0
  629. mov.b r0l, r1l
  630. dec.b r1l
  631. mov.b r0l, @er0-
  632. mov.b @byte_dst, r0l
  633. cmp.b r0l, r1l
  634. beq .Lnext54
  635. fail
  636. .Lnext54:
  637. mov.b #0, @byte_dst ; zero it again for the next use.
  638. mov_b_reg8_to_preinc: ; pre-increment from register to mem
  639. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  640. set_ccr_zero
  641. ;; mov.b ers, @+erd
  642. mov.l #byte_dst-1, er1
  643. mov.b r0l, @+er1 ; Register pre-incr operand
  644. ;;; .word 0x0172
  645. ;;; .word 0x6c98
  646. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  647. test_neg_set
  648. test_zero_clear
  649. test_ovf_clear
  650. test_carry_clear
  651. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  652. test_h_gr32 byte_dst, er1
  653. test_gr_a5a5 2
  654. test_gr_a5a5 3
  655. test_gr_a5a5 4
  656. test_gr_a5a5 5
  657. test_gr_a5a5 6
  658. test_gr_a5a5 7
  659. ;; Now check the result of the move to memory.
  660. cmp.b r2l, @byte_dst
  661. beq .Lnext51
  662. fail
  663. .Lnext51:
  664. ;; special case same register
  665. mov.l #byte_dst-1, er0
  666. mov.b r0l, r1l
  667. inc.b r1l
  668. mov.b r0l, @+er0
  669. mov.b @byte_dst, r0l
  670. cmp.b r0l, r1l
  671. beq .Lnext55
  672. fail
  673. .Lnext55:
  674. mov.b #0, @byte_dst ; zero it again for the next use.
  675. .endif
  676. mov_b_reg8_to_predec: ; pre-decrement from register to mem
  677. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  678. set_ccr_zero
  679. ;; mov.b ers, @-erd
  680. mov.l #byte_dst+1, er1
  681. mov.b r0l, @-er1 ; Register pre-decr operand
  682. ;;; .word 0x6c98
  683. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  684. test_neg_set
  685. test_zero_clear
  686. test_ovf_clear
  687. test_carry_clear
  688. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  689. test_h_gr32 byte_dst, er1
  690. test_gr_a5a5 2
  691. test_gr_a5a5 3
  692. test_gr_a5a5 4
  693. test_gr_a5a5 5
  694. test_gr_a5a5 6
  695. test_gr_a5a5 7
  696. ;; Now check the result of the move to memory.
  697. mov.b @byte_dst, r0l
  698. cmp.b r2l, r0l
  699. beq .Lnext48
  700. fail
  701. .Lnext48:
  702. ;; Special case in same register
  703. ;; CCR confirmation omitted
  704. mov.l #byte_dst+1, er1
  705. mov.l er1, er0
  706. dec.b r1l
  707. mov.b r0l, @-er0
  708. mov.b @byte_dst, r0l
  709. cmp.b r1l, r0l
  710. beq .Lnext47
  711. fail
  712. .Lnext47:
  713. mov.b #0, r0l
  714. mov.b r0l, @byte_dst ; zero it again for the next use.
  715. .if (sim_cpu == h8sx)
  716. mov_b_reg8_to_disp2:
  717. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  718. set_ccr_zero
  719. ;; mov.b ers, @(dd:2, erd)
  720. mov.l #byte_dst-3, er1
  721. mov.b r0l, @(3:2, er1) ; Register plus 2-bit disp. operand
  722. ;;; .word 0x0173
  723. ;;; .word 0x6898
  724. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  725. test_neg_set
  726. test_zero_clear
  727. test_ovf_clear
  728. test_carry_clear
  729. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  730. test_h_gr32 byte_dst-3, er1
  731. test_gr_a5a5 2
  732. test_gr_a5a5 3
  733. test_gr_a5a5 4
  734. test_gr_a5a5 5
  735. test_gr_a5a5 6
  736. test_gr_a5a5 7
  737. ;; Now check the result of the move to memory.
  738. cmp.b r2l, @byte_dst
  739. beq .Lnext52
  740. fail
  741. .Lnext52:
  742. mov.b #0, @byte_dst ; zero it again for the next use.
  743. .endif
  744. mov_b_reg8_to_disp16:
  745. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  746. set_ccr_zero
  747. ;; mov.b ers, @(dd:16, erd)
  748. mov.l #byte_dst-4, er1
  749. mov.b r0l, @(4:16, er1) ; Register plus 16-bit disp. operand
  750. ;;; .word 0x6e98
  751. ;;; .word 0x0004
  752. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  753. test_neg_set
  754. test_zero_clear
  755. test_ovf_clear
  756. test_carry_clear
  757. test_h_gr32 byte_dst-4, er1
  758. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  759. test_gr_a5a5 2
  760. test_gr_a5a5 3
  761. test_gr_a5a5 4
  762. test_gr_a5a5 5
  763. test_gr_a5a5 6
  764. test_gr_a5a5 7
  765. ;; Now check the result of the move to memory.
  766. mov.b @byte_dst, r0l
  767. cmp.b r2l, r0l
  768. beq .Lnext45
  769. fail
  770. .Lnext45:
  771. mov.b #0, r0l
  772. mov.b r0l, @byte_dst ; zero it again for the next use.
  773. mov_b_reg8_to_disp32:
  774. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  775. set_ccr_zero
  776. ;; mov.b ers, @(dd:32, erd)
  777. mov.l #byte_dst-8, er1
  778. mov.b r0l, @(8:32, er1) ; Register plus 32-bit disp. operand
  779. ;;; .word 0x7810
  780. ;;; .word 0x6aa8
  781. ;;; .long 8
  782. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  783. test_neg_set
  784. test_zero_clear
  785. test_ovf_clear
  786. test_carry_clear
  787. test_h_gr32 byte_dst-8, er1
  788. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  789. test_gr_a5a5 2
  790. test_gr_a5a5 3
  791. test_gr_a5a5 4
  792. test_gr_a5a5 5
  793. test_gr_a5a5 6
  794. test_gr_a5a5 7
  795. ;; Now check the result of the move to memory.
  796. mov.b @byte_dst, r0l
  797. cmp.b r2l, r0l
  798. beq .Lnext46
  799. fail
  800. .Lnext46:
  801. mov.b #0, r0l
  802. mov.b r0l, @byte_dst ; zero it again for the next use.
  803. .if (sim_cpu == h8sx)
  804. mov_b_reg8_to_indexb16:
  805. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  806. mov.l #0xffffff01, er1
  807. set_ccr_zero
  808. ;; mov.b ers, @(dd:16, rd.b)
  809. mov.b r0l, @(byte_dst-1:16, r1.b) ; byte indexed operand
  810. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  811. test_neg_set
  812. test_zero_clear
  813. test_ovf_clear
  814. test_carry_clear
  815. test_h_gr32 0xffffff01 er1
  816. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  817. test_gr_a5a5 2
  818. test_gr_a5a5 3
  819. test_gr_a5a5 4
  820. test_gr_a5a5 5
  821. test_gr_a5a5 6
  822. test_gr_a5a5 7
  823. ;; Now check the result of the move to memory.
  824. cmp.b @byte_dst, r0l
  825. bne fail1
  826. mov.b #0, @byte_dst ; zero it again for the next use.
  827. mov_b_reg8_to_indexw16:
  828. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  829. mov.l #0xffff0002, er1
  830. set_ccr_zero
  831. ;; mov.b ers, @(dd:16, rd.w)
  832. mov.b r0l, @(byte_dst-2:16, r1.w) ; byte indexed operand
  833. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  834. test_neg_set
  835. test_zero_clear
  836. test_ovf_clear
  837. test_carry_clear
  838. test_h_gr32 0xffff0002 er1
  839. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  840. test_gr_a5a5 2
  841. test_gr_a5a5 3
  842. test_gr_a5a5 4
  843. test_gr_a5a5 5
  844. test_gr_a5a5 6
  845. test_gr_a5a5 7
  846. ;; Now check the result of the move to memory.
  847. cmp.b @byte_dst, r0l
  848. bne fail1
  849. mov.b #0, @byte_dst ; zero it again for the next use.
  850. mov_b_reg8_to_indexl16:
  851. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  852. mov.l #0x00000003, er1
  853. set_ccr_zero
  854. ;; mov.b ers, @(dd:16, erd.l)
  855. mov.b r0l, @(byte_dst-3:16, er1.l) ; byte indexed operand
  856. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  857. test_neg_set
  858. test_zero_clear
  859. test_ovf_clear
  860. test_carry_clear
  861. test_h_gr32 0x00000003 er1
  862. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  863. test_gr_a5a5 2
  864. test_gr_a5a5 3
  865. test_gr_a5a5 4
  866. test_gr_a5a5 5
  867. test_gr_a5a5 6
  868. test_gr_a5a5 7
  869. ;; Now check the result of the move to memory.
  870. cmp.b @byte_dst, r0l
  871. bne fail1
  872. mov.b #0, @byte_dst ; zero it again for the next use.
  873. mov_b_reg8_to_indexb32:
  874. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  875. mov.l #0xffffff04 er1
  876. set_ccr_zero
  877. ;; mov.b ers, @(dd:32, rd.b)
  878. mov.b r0l, @(byte_dst-4:32, r1.b) ; byte indexed operand
  879. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  880. test_neg_set
  881. test_zero_clear
  882. test_ovf_clear
  883. test_carry_clear
  884. test_h_gr32 0xffffff04, er1
  885. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  886. test_gr_a5a5 2
  887. test_gr_a5a5 3
  888. test_gr_a5a5 4
  889. test_gr_a5a5 5
  890. test_gr_a5a5 6
  891. test_gr_a5a5 7
  892. ;; Now check the result of the move to memory.
  893. cmp.b @byte_dst, r0l
  894. bne fail1
  895. mov.b #0, @byte_dst ; zero it again for the next use.
  896. mov_b_reg8_to_indexw32:
  897. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  898. mov.l #0xffff0005 er1
  899. set_ccr_zero
  900. ;; mov.b ers, @(dd:32, rd.w)
  901. mov.b r0l, @(byte_dst-5:32, r1.w) ; byte indexed operand
  902. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  903. test_neg_set
  904. test_zero_clear
  905. test_ovf_clear
  906. test_carry_clear
  907. test_h_gr32 0xffff0005, er1
  908. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  909. test_gr_a5a5 2
  910. test_gr_a5a5 3
  911. test_gr_a5a5 4
  912. test_gr_a5a5 5
  913. test_gr_a5a5 6
  914. test_gr_a5a5 7
  915. ;; Now check the result of the move to memory.
  916. cmp.b @byte_dst, r0l
  917. bne fail1
  918. mov.b #0, @byte_dst ; zero it again for the next use.
  919. mov_b_reg8_to_indexl32:
  920. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  921. mov.l #0x00000006 er1
  922. set_ccr_zero
  923. ;; mov.b ers, @(dd:32, erd.l)
  924. mov.b r0l, @(byte_dst-6:32, er1.l) ; byte indexed operand
  925. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  926. test_neg_set
  927. test_zero_clear
  928. test_ovf_clear
  929. test_carry_clear
  930. test_h_gr32 0x00000006, er1
  931. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  932. test_gr_a5a5 2
  933. test_gr_a5a5 3
  934. test_gr_a5a5 4
  935. test_gr_a5a5 5
  936. test_gr_a5a5 6
  937. test_gr_a5a5 7
  938. ;; Now check the result of the move to memory.
  939. cmp.b @byte_dst, r0l
  940. bne fail1
  941. mov.b #0, @byte_dst ; zero it again for the next use.
  942. .endif
  943. .if (sim_cpu == h8sx)
  944. mov_b_reg8_to_abs8:
  945. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  946. mov.l #byte_dst-20, er0
  947. ldc er0, sbr
  948. set_ccr_zero
  949. ;; mov.b ers, @aa:8
  950. mov.b r1l, @20:8 ; 8-bit address-direct (sbr-relative) operand
  951. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  952. test_neg_set
  953. test_zero_clear
  954. test_ovf_clear
  955. test_carry_clear
  956. test_h_gr32 byte_dst-20, er0
  957. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  958. test_gr_a5a5 2
  959. test_gr_a5a5 3
  960. test_gr_a5a5 4
  961. test_gr_a5a5 5
  962. test_gr_a5a5 6
  963. test_gr_a5a5 7
  964. ;; Now check the result of the move to memory.
  965. cmp.b @byte_dst, r1l
  966. bne fail1
  967. mov.b #0, @byte_dst ; zero it again for the next use.
  968. .endif
  969. mov_b_reg8_to_abs16:
  970. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  971. set_ccr_zero
  972. ;; mov.b ers, @aa:16
  973. mov.b r0l, @byte_dst:16 ; 16-bit address-direct operand
  974. ;;; .word 0x6a88
  975. ;;; .word @byte_dst
  976. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  977. test_neg_set
  978. test_zero_clear
  979. test_ovf_clear
  980. test_carry_clear
  981. test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
  982. test_gr_a5a5 1 ; (first, because on h8/300 we must use one
  983. test_gr_a5a5 2 ; to examine the destination memory).
  984. test_gr_a5a5 3
  985. test_gr_a5a5 4
  986. test_gr_a5a5 5
  987. test_gr_a5a5 6
  988. test_gr_a5a5 7
  989. ;; Now check the result of the move to memory.
  990. mov.b @byte_dst, r0l
  991. cmp.b r0l, r1l
  992. beq .Lnext41
  993. fail
  994. .Lnext41:
  995. mov.b #0, r0l
  996. mov.b r0l, @byte_dst ; zero it again for the next use.
  997. mov_b_reg8_to_abs32:
  998. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  999. set_ccr_zero
  1000. ;; mov.b ers, @aa:32
  1001. mov.b r0l, @byte_dst:32 ; 32-bit address-direct operand
  1002. ;;; .word 0x6aa8
  1003. ;;; .long @byte_dst
  1004. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  1005. test_neg_set
  1006. test_zero_clear
  1007. test_ovf_clear
  1008. test_carry_clear
  1009. test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
  1010. test_gr_a5a5 1 ; (first, because on h8/300 we must use one
  1011. test_gr_a5a5 2 ; to examine the destination memory).
  1012. test_gr_a5a5 3
  1013. test_gr_a5a5 4
  1014. test_gr_a5a5 5
  1015. test_gr_a5a5 6
  1016. test_gr_a5a5 7
  1017. ;; Now check the result of the move to memory.
  1018. mov.b @byte_dst, r0l
  1019. cmp.b r0l, r1l
  1020. beq .Lnext42
  1021. fail
  1022. .Lnext42:
  1023. mov.b #0, r0l
  1024. mov.b r0l, @byte_dst ; zero it again for the next use.
  1025. ;;
  1026. ;; Move byte to register destination.
  1027. ;;
  1028. mov_b_indirect_to_reg8:
  1029. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1030. set_ccr_zero
  1031. ;; mov.b @ers, rd
  1032. mov.l #byte_src, er1
  1033. mov.b @er1, r0l ; Register indirect operand
  1034. ;;; .word 0x6818
  1035. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1036. test_neg_clear
  1037. test_zero_clear
  1038. test_ovf_clear
  1039. test_carry_clear
  1040. test_h_gr32 0xa5a5a577 er0
  1041. test_h_gr32 byte_src, er1
  1042. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1043. test_gr_a5a5 3
  1044. test_gr_a5a5 4
  1045. test_gr_a5a5 5
  1046. test_gr_a5a5 6
  1047. test_gr_a5a5 7
  1048. mov_b_postinc_to_reg8: ; post-increment from mem to register
  1049. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1050. set_ccr_zero
  1051. ;; mov.b @ers+, rd
  1052. mov.l #byte_src, er1
  1053. mov.b @er1+, r0l ; Register post-incr operand
  1054. ;;; .word 0x6c18
  1055. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1056. test_neg_clear
  1057. test_zero_clear
  1058. test_ovf_clear
  1059. test_carry_clear
  1060. test_h_gr32 0xa5a5a577 er0
  1061. test_h_gr32 byte_src+1, er1
  1062. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1063. test_gr_a5a5 3
  1064. test_gr_a5a5 4
  1065. test_gr_a5a5 5
  1066. test_gr_a5a5 6
  1067. test_gr_a5a5 7
  1068. .if (sim_cpu == h8sx)
  1069. mov_b_postdec_to_reg8: ; post-decrement from mem to register
  1070. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1071. set_ccr_zero
  1072. ;; mov.b @ers-, rd
  1073. mov.l #byte_src, er1
  1074. mov.b @er1-, r0l ; Register post-decr operand
  1075. ;;; .word 0x0172
  1076. ;;; .word 0x6c18
  1077. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1078. test_neg_clear
  1079. test_zero_clear
  1080. test_ovf_clear
  1081. test_carry_clear
  1082. test_h_gr32 0xa5a5a577 er0
  1083. test_h_gr32 byte_src-1, er1
  1084. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1085. test_gr_a5a5 3
  1086. test_gr_a5a5 4
  1087. test_gr_a5a5 5
  1088. test_gr_a5a5 6
  1089. test_gr_a5a5 7
  1090. mov_b_preinc_to_reg8: ; pre-increment from mem to register
  1091. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1092. set_ccr_zero
  1093. ;; mov.b @+ers, rd
  1094. mov.l #byte_src-1, er1
  1095. mov.b @+er1, r0l ; Register pre-incr operand
  1096. ;;; .word 0x0171
  1097. ;;; .word 0x6c18
  1098. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1099. test_neg_clear
  1100. test_zero_clear
  1101. test_ovf_clear
  1102. test_carry_clear
  1103. test_h_gr32 0xa5a5a577 er0
  1104. test_h_gr32 byte_src, er1
  1105. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1106. test_gr_a5a5 3
  1107. test_gr_a5a5 4
  1108. test_gr_a5a5 5
  1109. test_gr_a5a5 6
  1110. test_gr_a5a5 7
  1111. mov_b_predec_to_reg8: ; pre-decrement from mem to register
  1112. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1113. set_ccr_zero
  1114. ;; mov.b @-ers, rd
  1115. mov.l #byte_src+1, er1
  1116. mov.b @-er1, r0l ; Register pre-decr operand
  1117. ;;; .word 0x0173
  1118. ;;; .word 0x6c18
  1119. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1120. test_neg_clear
  1121. test_zero_clear
  1122. test_ovf_clear
  1123. test_carry_clear
  1124. test_h_gr32 0xa5a5a577 er0
  1125. test_h_gr32 byte_src, er1
  1126. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1127. test_gr_a5a5 3
  1128. test_gr_a5a5 4
  1129. test_gr_a5a5 5
  1130. test_gr_a5a5 6
  1131. test_gr_a5a5 7
  1132. mov_b_disp2_to_reg8:
  1133. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1134. set_ccr_zero
  1135. ;; mov.b @(dd:2, ers), rd
  1136. mov.l #byte_src-1, er1
  1137. mov.b @(1:2, er1), r0l ; Register plus 2-bit disp. operand
  1138. ;;; .word 0x0171
  1139. ;;; .word 0x6818
  1140. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1141. test_neg_clear
  1142. test_zero_clear
  1143. test_ovf_clear
  1144. test_carry_clear
  1145. test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5 | 7777
  1146. test_h_gr32 byte_src-1, er1
  1147. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1148. test_gr_a5a5 3
  1149. test_gr_a5a5 4
  1150. test_gr_a5a5 5
  1151. test_gr_a5a5 6
  1152. test_gr_a5a5 7
  1153. .endif
  1154. mov_b_disp16_to_reg8:
  1155. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1156. set_ccr_zero
  1157. ;; mov.b @(dd:16, ers), rd
  1158. mov.l #byte_src+0x1234, er1
  1159. mov.b @(-0x1234:16, er1), r0l ; Register plus 16-bit disp. operand
  1160. ;;; .word 0x6e18
  1161. ;;; .word -0x1234
  1162. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1163. test_neg_clear
  1164. test_zero_clear
  1165. test_ovf_clear
  1166. test_carry_clear
  1167. test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5 | 7777
  1168. test_h_gr32 byte_src+0x1234, er1
  1169. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1170. test_gr_a5a5 3
  1171. test_gr_a5a5 4
  1172. test_gr_a5a5 5
  1173. test_gr_a5a5 6
  1174. test_gr_a5a5 7
  1175. mov_b_disp32_to_reg8:
  1176. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1177. set_ccr_zero
  1178. ;; mov.b @(dd:32, ers), rd
  1179. mov.l #byte_src+65536, er1
  1180. mov.b @(-65536:32, er1), r0l ; Register plus 32-bit disp. operand
  1181. ;;; .word 0x7810
  1182. ;;; .word 0x6a28
  1183. ;;; .long -65536
  1184. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1185. test_neg_clear
  1186. test_zero_clear
  1187. test_ovf_clear
  1188. test_carry_clear
  1189. test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5 | 7777
  1190. test_h_gr32 byte_src+65536, er1
  1191. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1192. test_gr_a5a5 3
  1193. test_gr_a5a5 4
  1194. test_gr_a5a5 5
  1195. test_gr_a5a5 6
  1196. test_gr_a5a5 7
  1197. .if (sim_cpu == h8sx)
  1198. mov_b_indexb16_to_reg8:
  1199. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1200. mov.l #0xffffff01, er1
  1201. set_ccr_zero
  1202. ;; mov.b @(dd:16, rs.b), rd
  1203. mov.b @(byte_src-1:16, r1.b), r0l ; indexed byte operand
  1204. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1205. test_neg_clear
  1206. test_zero_clear
  1207. test_ovf_clear
  1208. test_carry_clear
  1209. test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5a5 | 77
  1210. test_h_gr32 0xffffff01, er1
  1211. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1212. test_gr_a5a5 3
  1213. test_gr_a5a5 4
  1214. test_gr_a5a5 5
  1215. test_gr_a5a5 6
  1216. test_gr_a5a5 7
  1217. mov_b_indexw16_to_reg8:
  1218. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1219. mov.l #0xffff0002, er1
  1220. set_ccr_zero
  1221. ;; mov.b @(dd:16, rs.w), rd
  1222. mov.b @(byte_src-2:16, r1.w), r0l ; indexed byte operand
  1223. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1224. test_neg_clear
  1225. test_zero_clear
  1226. test_ovf_clear
  1227. test_carry_clear
  1228. test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5a5 | 77
  1229. test_h_gr32 0xffff0002, er1
  1230. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1231. test_gr_a5a5 3
  1232. test_gr_a5a5 4
  1233. test_gr_a5a5 5
  1234. test_gr_a5a5 6
  1235. test_gr_a5a5 7
  1236. mov_b_indexl16_to_reg8:
  1237. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1238. mov.l #0x00000003, er1
  1239. set_ccr_zero
  1240. ;; mov.b @(dd:16, ers.l), rd
  1241. mov.b @(byte_src-3:16, er1.l), r0l ; indexed byte operand
  1242. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1243. test_neg_clear
  1244. test_zero_clear
  1245. test_ovf_clear
  1246. test_carry_clear
  1247. test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5a5 | 77
  1248. test_h_gr32 0x00000003, er1
  1249. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1250. test_gr_a5a5 3
  1251. test_gr_a5a5 4
  1252. test_gr_a5a5 5
  1253. test_gr_a5a5 6
  1254. test_gr_a5a5 7
  1255. mov_b_indexb32_to_reg8:
  1256. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1257. mov.l #0xffffff04, er1
  1258. set_ccr_zero
  1259. ;; mov.b @(dd:32, rs.b), rd
  1260. mov.b @(byte_src-4:32, r1.b), r0l ; indexed byte operand
  1261. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1262. test_neg_clear
  1263. test_zero_clear
  1264. test_ovf_clear
  1265. test_carry_clear
  1266. test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5 | 7777
  1267. test_h_gr32 0xffffff04 er1
  1268. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1269. test_gr_a5a5 3
  1270. test_gr_a5a5 4
  1271. test_gr_a5a5 5
  1272. test_gr_a5a5 6
  1273. test_gr_a5a5 7
  1274. mov_b_indexw32_to_reg8:
  1275. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1276. mov.l #0xffff0005, er1
  1277. set_ccr_zero
  1278. ;; mov.b @(dd:32, rs.w), rd
  1279. mov.b @(byte_src-5:32, r1.w), r0l ; indexed byte operand
  1280. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1281. test_neg_clear
  1282. test_zero_clear
  1283. test_ovf_clear
  1284. test_carry_clear
  1285. test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5 | 7777
  1286. test_h_gr32 0xffff0005 er1
  1287. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1288. test_gr_a5a5 3
  1289. test_gr_a5a5 4
  1290. test_gr_a5a5 5
  1291. test_gr_a5a5 6
  1292. test_gr_a5a5 7
  1293. mov_b_indexl32_to_reg8:
  1294. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1295. mov.l #0x00000006, er1
  1296. set_ccr_zero
  1297. ;; mov.b @(dd:32, ers.l), rd
  1298. mov.b @(byte_src-6:32, er1.l), r0l ; indexed byte operand
  1299. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1300. test_neg_clear
  1301. test_zero_clear
  1302. test_ovf_clear
  1303. test_carry_clear
  1304. test_h_gr32 0xa5a5a577 er0 ; mov result: a5a5 | 7777
  1305. test_h_gr32 0x00000006 er1
  1306. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1307. test_gr_a5a5 3
  1308. test_gr_a5a5 4
  1309. test_gr_a5a5 5
  1310. test_gr_a5a5 6
  1311. test_gr_a5a5 7
  1312. .endif
  1313. .if (sim_cpu == h8sx)
  1314. mov_b_abs8_to_reg8:
  1315. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1316. mov.l #byte_src-255, er1
  1317. ldc er1, sbr
  1318. set_ccr_zero
  1319. ;; mov.b @aa:8, rd
  1320. mov.b @0xff:8, r0l ; 8-bit (sbr relative) address-direct operand
  1321. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1322. test_neg_clear
  1323. test_zero_clear
  1324. test_ovf_clear
  1325. test_carry_clear
  1326. test_h_gr32 0xa5a5a577 er0
  1327. test_h_gr32 byte_src-255, er1
  1328. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1329. test_gr_a5a5 3
  1330. test_gr_a5a5 4
  1331. test_gr_a5a5 5
  1332. test_gr_a5a5 6
  1333. test_gr_a5a5 7
  1334. .endif
  1335. mov_b_abs16_to_reg8:
  1336. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1337. set_ccr_zero
  1338. ;; mov.b @aa:16, rd
  1339. mov.b @byte_src:16, r0l ; 16-bit address-direct operand
  1340. ;;; .word 0x6a08
  1341. ;;; .word @byte_src
  1342. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1343. test_neg_clear
  1344. test_zero_clear
  1345. test_ovf_clear
  1346. test_carry_clear
  1347. test_h_gr32 0xa5a5a577 er0
  1348. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1349. test_gr_a5a5 2
  1350. test_gr_a5a5 3
  1351. test_gr_a5a5 4
  1352. test_gr_a5a5 5
  1353. test_gr_a5a5 6
  1354. test_gr_a5a5 7
  1355. mov_b_abs32_to_reg8:
  1356. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1357. set_ccr_zero
  1358. ;; mov.b @aa:32, rd
  1359. mov.b @byte_src:32, r0l ; 32-bit address-direct operand
  1360. ;;; .word 0x6a28
  1361. ;;; .long @byte_src
  1362. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1363. test_neg_clear
  1364. test_zero_clear
  1365. test_ovf_clear
  1366. test_carry_clear
  1367. test_h_gr32 0xa5a5a577 er0
  1368. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1369. test_gr_a5a5 2
  1370. test_gr_a5a5 3
  1371. test_gr_a5a5 4
  1372. test_gr_a5a5 5
  1373. test_gr_a5a5 6
  1374. test_gr_a5a5 7
  1375. .if (sim_cpu == h8sx)
  1376. ;;
  1377. ;; Move byte from memory to memory
  1378. ;;
  1379. mov_b_indirect_to_indirect: ; reg indirect, memory to memory
  1380. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1381. set_ccr_zero
  1382. ;; mov.b @ers, @erd
  1383. mov.l #byte_src, er1
  1384. mov.l #byte_dst, er0
  1385. mov.b @er1, @er0
  1386. ;;; .word 0x0178
  1387. ;;; .word 0x0100
  1388. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1389. test_neg_clear
  1390. test_zero_clear
  1391. test_ovf_clear
  1392. test_carry_clear
  1393. ;; Verify the affected registers.
  1394. test_h_gr32 byte_dst er0
  1395. test_h_gr32 byte_src er1
  1396. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1397. test_gr_a5a5 3
  1398. test_gr_a5a5 4
  1399. test_gr_a5a5 5
  1400. test_gr_a5a5 6
  1401. test_gr_a5a5 7
  1402. ;; Now check the result of the move to memory.
  1403. cmp.b @byte_src, @byte_dst
  1404. beq .Lnext56
  1405. fail
  1406. .Lnext56:
  1407. ;; Now clear the destination location, and verify that.
  1408. mov.b #0, @byte_dst
  1409. cmp.b @byte_src, @byte_dst
  1410. bne .Lnext57
  1411. fail
  1412. .Lnext57: ; OK, pass on.
  1413. mov_b_postinc_to_postinc: ; reg post-increment, memory to memory
  1414. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1415. set_ccr_zero
  1416. ;; mov.b @ers+, @erd+
  1417. mov.l #byte_src, er1
  1418. mov.l #byte_dst, er0
  1419. mov.b @er1+, @er0+
  1420. ;;; .word 0x0178
  1421. ;;; .word 0x8180
  1422. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1423. test_neg_clear
  1424. test_zero_clear
  1425. test_ovf_clear
  1426. test_carry_clear
  1427. ;; Verify the affected registers.
  1428. test_h_gr32 byte_dst+1 er0
  1429. test_h_gr32 byte_src+1 er1
  1430. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1431. test_gr_a5a5 3
  1432. test_gr_a5a5 4
  1433. test_gr_a5a5 5
  1434. test_gr_a5a5 6
  1435. test_gr_a5a5 7
  1436. ;; Now check the result of the move to memory.
  1437. cmp.b @byte_src, @byte_dst
  1438. beq .Lnext65
  1439. fail
  1440. .Lnext65:
  1441. ;; Now clear the destination location, and verify that.
  1442. mov.b #0, @byte_dst
  1443. cmp.b @byte_src, @byte_dst
  1444. bne .Lnext66
  1445. fail
  1446. .Lnext66: ; OK, pass on.
  1447. ;; special case same register
  1448. mov.l #byte_src, er0
  1449. mov.b @er0+, @er0+ ; copying byte_src to byte_dst
  1450. test_h_gr32 byte_src+2 er0
  1451. cmp.b @byte_src, @byte_dst
  1452. beq .Lnext67
  1453. fail
  1454. .Lnext67:
  1455. ;; Now clear the destination location, and verify that.
  1456. mov.b #0, @byte_dst
  1457. cmp.b @byte_src, @byte_dst
  1458. bne .Lnext68
  1459. fail
  1460. .Lnext68:
  1461. mov_b_postdec_to_postdec: ; reg post-decrement, memory to memory
  1462. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1463. set_ccr_zero
  1464. ;; mov.b @ers-, @erd-
  1465. mov.l #byte_src, er1
  1466. mov.l #byte_dst, er0
  1467. mov.b @er1-, @er0-
  1468. ;;; .word 0x0178
  1469. ;;; .word 0xa1a0
  1470. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1471. test_neg_clear
  1472. test_zero_clear
  1473. test_ovf_clear
  1474. test_carry_clear
  1475. ;; Verify the affected registers.
  1476. test_h_gr32 byte_dst-1 er0
  1477. test_h_gr32 byte_src-1 er1
  1478. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1479. test_gr_a5a5 3
  1480. test_gr_a5a5 4
  1481. test_gr_a5a5 5
  1482. test_gr_a5a5 6
  1483. test_gr_a5a5 7
  1484. ;; Now check the result of the move to memory.
  1485. cmp.b @byte_src, @byte_dst
  1486. beq .Lnext75
  1487. fail
  1488. .Lnext75:
  1489. ;; Now clear the destination location, and verify that.
  1490. mov.b #0, @byte_dst
  1491. cmp.b @byte_src, @byte_dst
  1492. bne .Lnext76
  1493. fail
  1494. .Lnext76: ; OK, pass on.
  1495. ;; special case same register
  1496. mov.l #byte_src, er0
  1497. mov.b @er0-, @er0- ; copying byte_src to byte_dst_dec
  1498. test_h_gr32 byte_src-2 er0
  1499. cmp.b @byte_src, @byte_dst_dec
  1500. beq .Lnext77
  1501. fail
  1502. .Lnext77:
  1503. ;; Now clear the destination location, and verify that.
  1504. mov.b #0, @byte_dst_dec
  1505. cmp.b @byte_src, @byte_dst_dec
  1506. bne .Lnext78
  1507. fail
  1508. .Lnext78:
  1509. mov_b_preinc_to_preinc: ; reg pre-increment, memory to memory
  1510. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1511. set_ccr_zero
  1512. ;; mov.b @+ers, @+erd
  1513. mov.l #byte_src-1, er1
  1514. mov.l #byte_dst-1, er0
  1515. mov.b @+er1, @+er0
  1516. ;;; .word 0x0178
  1517. ;;; .word 0x9190
  1518. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1519. test_neg_clear
  1520. test_zero_clear
  1521. test_ovf_clear
  1522. test_carry_clear
  1523. ;; Verify the affected registers.
  1524. test_h_gr32 byte_dst er0
  1525. test_h_gr32 byte_src er1
  1526. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1527. test_gr_a5a5 3
  1528. test_gr_a5a5 4
  1529. test_gr_a5a5 5
  1530. test_gr_a5a5 6
  1531. test_gr_a5a5 7
  1532. ;; Now check the result of the move to memory.
  1533. cmp.b @byte_src, @byte_dst
  1534. beq .Lnext85
  1535. fail
  1536. .Lnext85:
  1537. ;; Now clear the destination location, and verify that.
  1538. mov.b #0, @byte_dst
  1539. cmp.b @byte_src, @byte_dst
  1540. bne .Lnext86
  1541. fail
  1542. .Lnext86: ; OK, pass on.
  1543. ;; special case same register
  1544. mov.l #byte_src-1, er0
  1545. mov.b @+er0, @+er0 ; copying byte_src to byte_dst
  1546. test_h_gr32 byte_src+1 er0
  1547. cmp.b @byte_src, @byte_dst
  1548. beq .Lnext87
  1549. fail
  1550. .Lnext87:
  1551. ;; Now clear the destination location, and verify that.
  1552. mov.b #0, @byte_dst
  1553. cmp.b @byte_src, @byte_dst
  1554. bne .Lnext88
  1555. fail
  1556. .Lnext88:
  1557. mov_b_predec_to_predec: ; reg pre-decrement, memory to memory
  1558. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1559. set_ccr_zero
  1560. ;; mov.b @-ers, @-erd
  1561. mov.l #byte_src+1, er1
  1562. mov.l #byte_dst+1, er0
  1563. mov.b @-er1, @-er0
  1564. ;;; .word 0x0178
  1565. ;;; .word 0xb1b0
  1566. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1567. test_neg_clear
  1568. test_zero_clear
  1569. test_ovf_clear
  1570. test_carry_clear
  1571. ;; Verify the affected registers.
  1572. test_h_gr32 byte_dst er0
  1573. test_h_gr32 byte_src er1
  1574. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1575. test_gr_a5a5 3
  1576. test_gr_a5a5 4
  1577. test_gr_a5a5 5
  1578. test_gr_a5a5 6
  1579. test_gr_a5a5 7
  1580. ;; Now check the result of the move to memory.
  1581. cmp.b @byte_src, @byte_dst
  1582. beq .Lnext95
  1583. fail
  1584. .Lnext95:
  1585. ;; Now clear the destination location, and verify that.
  1586. mov.b #0, @byte_dst
  1587. cmp.b @byte_src, @byte_dst
  1588. bne .Lnext96
  1589. fail
  1590. .Lnext96: ; OK, pass on.
  1591. ;; special case same register
  1592. mov.l #byte_src+1, er0
  1593. mov.b @-er0, @-er0 ; copying byte_src to byte_dst_dec
  1594. test_h_gr32 byte_src-1 er0
  1595. cmp.b @byte_src, @byte_dst_dec
  1596. beq .Lnext97
  1597. fail
  1598. .Lnext97:
  1599. ;; Now clear the destination location, and verify that.
  1600. mov.b #0, @byte_dst_dec
  1601. cmp.b @byte_src, @byte_dst_dec
  1602. bne .Lnext98
  1603. fail
  1604. .Lnext98:
  1605. mov_b_disp2_to_disp2: ; reg 2-bit disp, memory to memory
  1606. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1607. set_ccr_zero
  1608. ;; mov.b @(dd:2, ers), @(dd:2, erd)
  1609. mov.l #byte_src-1, er1
  1610. mov.l #byte_dst-2, er0
  1611. mov.b @(1:2, er1), @(2:2, er0)
  1612. ;;; .word 0x0178
  1613. ;;; .word 0x1120
  1614. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1615. test_neg_clear
  1616. test_zero_clear
  1617. test_ovf_clear
  1618. test_carry_clear
  1619. ;; Verify the affected registers.
  1620. test_h_gr32 byte_dst-2 er0
  1621. test_h_gr32 byte_src-1 er1
  1622. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1623. test_gr_a5a5 3
  1624. test_gr_a5a5 4
  1625. test_gr_a5a5 5
  1626. test_gr_a5a5 6
  1627. test_gr_a5a5 7
  1628. ;; Now check the result of the move to memory.
  1629. cmp.b @byte_src, @byte_dst
  1630. beq .Lnext105
  1631. fail
  1632. .Lnext105:
  1633. ;; Now clear the destination location, and verify that.
  1634. mov.b #0, @byte_dst
  1635. cmp.b @byte_src, @byte_dst
  1636. bne .Lnext106
  1637. fail
  1638. .Lnext106: ; OK, pass on.
  1639. mov_b_disp16_to_disp16: ; reg 16-bit disp, memory to memory
  1640. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1641. set_ccr_zero
  1642. ;; mov.b @(dd:16, ers), @(dd:16, erd)
  1643. mov.l #byte_src-1, er1
  1644. mov.l #byte_dst-2, er0
  1645. mov.b @(1:16, er1), @(2:16, er0)
  1646. ;;; .word 0x0178
  1647. ;;; .word 0xc1c0
  1648. ;;; .word 0x0001
  1649. ;;; .word 0x0002
  1650. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1651. test_neg_clear
  1652. test_zero_clear
  1653. test_ovf_clear
  1654. test_carry_clear
  1655. ;; Verify the affected registers.
  1656. test_h_gr32 byte_dst-2 er0
  1657. test_h_gr32 byte_src-1 er1
  1658. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1659. test_gr_a5a5 3
  1660. test_gr_a5a5 4
  1661. test_gr_a5a5 5
  1662. test_gr_a5a5 6
  1663. test_gr_a5a5 7
  1664. ;; Now check the result of the move to memory.
  1665. cmp.b @byte_src, @byte_dst
  1666. beq .Lnext115
  1667. fail
  1668. .Lnext115:
  1669. ;; Now clear the destination location, and verify that.
  1670. mov.b #0, @byte_dst
  1671. cmp.b @byte_src, @byte_dst
  1672. bne .Lnext116
  1673. fail
  1674. .Lnext116: ; OK, pass on.
  1675. mov_b_disp32_to_disp32: ; reg 32-bit disp, memory to memory
  1676. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1677. set_ccr_zero
  1678. ;; mov.b @(dd:32, ers), @(dd:32, erd)
  1679. mov.l #byte_src-1, er1
  1680. mov.l #byte_dst-2, er0
  1681. mov.b @(1:32, er1), @(2:32, er0)
  1682. ;;; .word 0x0178
  1683. ;;; .word 0xc9c8
  1684. ;;; .long 1
  1685. ;;; .long 2
  1686. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1687. test_neg_clear
  1688. test_zero_clear
  1689. test_ovf_clear
  1690. test_carry_clear
  1691. ;; Verify the affected registers.
  1692. test_h_gr32 byte_dst-2 er0
  1693. test_h_gr32 byte_src-1 er1
  1694. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1695. test_gr_a5a5 3
  1696. test_gr_a5a5 4
  1697. test_gr_a5a5 5
  1698. test_gr_a5a5 6
  1699. test_gr_a5a5 7
  1700. ;; Now check the result of the move to memory.
  1701. cmp.b @byte_src, @byte_dst
  1702. beq .Lnext125
  1703. fail
  1704. .Lnext125:
  1705. ;; Now clear the destination location, and verify that.
  1706. mov.b #0, @byte_dst
  1707. cmp.b @byte_src, @byte_dst
  1708. bne .Lnext126
  1709. fail
  1710. .Lnext126: ; OK, pass on.
  1711. mov_b_indexb16_to_indexb16: ; reg 16-bit indexed, memory to memory
  1712. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1713. mov.l #0xffffff01, er1
  1714. mov.l #0xffffff02, er0
  1715. ;; mov.b @(dd:16, rs.b), @(dd:16, rd.b)
  1716. set_ccr_zero
  1717. mov.b @(byte_src-1:16, r1.b), @(byte_dst-2:16, r0.b)
  1718. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1719. test_neg_clear
  1720. test_zero_clear
  1721. test_ovf_clear
  1722. test_carry_clear
  1723. ;; Verify the affected registers.
  1724. test_h_gr32 0xffffff02 er0
  1725. test_h_gr32 0xffffff01 er1
  1726. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1727. test_gr_a5a5 3
  1728. test_gr_a5a5 4
  1729. test_gr_a5a5 5
  1730. test_gr_a5a5 6
  1731. test_gr_a5a5 7
  1732. ;; Now check the result of the move to memory.
  1733. cmp.b @byte_src, @byte_dst
  1734. bne fail1
  1735. ;; Now clear the destination location, and verify that.
  1736. mov.b #0, @byte_dst
  1737. cmp.b @byte_src, @byte_dst
  1738. beq fail1
  1739. mov_b_indexw16_to_indewb16: ; reg 16-bit indexed, memory to memory
  1740. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1741. mov.l #0xffff0003, er1
  1742. mov.l #0xffff0004, er0
  1743. ;; mov.b @(dd:16, rs.w), @(dd:16, rd.w)
  1744. set_ccr_zero
  1745. mov.b @(byte_src-3:16, r1.w), @(byte_dst-4:16, r0.w)
  1746. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1747. test_neg_clear
  1748. test_zero_clear
  1749. test_ovf_clear
  1750. test_carry_clear
  1751. ;; Verify the affected registers.
  1752. test_h_gr32 0xffff0004 er0
  1753. test_h_gr32 0xffff0003 er1
  1754. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1755. test_gr_a5a5 3
  1756. test_gr_a5a5 4
  1757. test_gr_a5a5 5
  1758. test_gr_a5a5 6
  1759. test_gr_a5a5 7
  1760. ;; Now check the result of the move to memory.
  1761. cmp.b @byte_src, @byte_dst
  1762. bne fail1
  1763. ;; Now clear the destination location, and verify that.
  1764. mov.b #0, @byte_dst
  1765. cmp.b @byte_src, @byte_dst
  1766. beq fail1
  1767. mov_b_indexl16_to_indexl16: ; reg 16-bit indexed, memory to memory
  1768. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1769. mov.l #0x00000005, er1
  1770. mov.l #0x00000006, er0
  1771. ;; mov.b @(dd:16, ers.l), @(dd:16, erd.l)
  1772. set_ccr_zero
  1773. mov.b @(byte_src-5:16, er1.l), @(byte_dst-6:16, er0.l)
  1774. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1775. test_neg_clear
  1776. test_zero_clear
  1777. test_ovf_clear
  1778. test_carry_clear
  1779. ;; Verify the affected registers.
  1780. test_h_gr32 0x00000006 er0
  1781. test_h_gr32 0x00000005 er1
  1782. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1783. test_gr_a5a5 3
  1784. test_gr_a5a5 4
  1785. test_gr_a5a5 5
  1786. test_gr_a5a5 6
  1787. test_gr_a5a5 7
  1788. ;; Now check the result of the move to memory.
  1789. cmp.b @byte_src, @byte_dst
  1790. bne fail1
  1791. ;; Now clear the destination location, and verify that.
  1792. mov.b #0, @byte_dst
  1793. cmp.b @byte_src, @byte_dst
  1794. beq fail1
  1795. mov_b_indexb32_to_indexb32: ; reg 32-bit indexed, memory to memory
  1796. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1797. mov.l #0xffffff01, er1
  1798. mov.l #0xffffff02, er0
  1799. set_ccr_zero
  1800. ;; mov.b @(dd:32, rs.b), @(dd:32, rd.b)
  1801. mov.b @(byte_src-1:32, r1.b), @(byte_dst-2:32, r0.b)
  1802. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1803. test_neg_clear
  1804. test_zero_clear
  1805. test_ovf_clear
  1806. test_carry_clear
  1807. ;; Verify the affected registers.
  1808. test_h_gr32 0xffffff02 er0
  1809. test_h_gr32 0xffffff01 er1
  1810. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1811. test_gr_a5a5 3
  1812. test_gr_a5a5 4
  1813. test_gr_a5a5 5
  1814. test_gr_a5a5 6
  1815. test_gr_a5a5 7
  1816. ;; Now check the result of the move to memory.
  1817. cmp.b @byte_src, @byte_dst
  1818. bne fail1
  1819. ;; Now clear the destination location, and verify that.
  1820. mov.b #0, @byte_dst
  1821. cmp.b @byte_src, @byte_dst
  1822. beq fail1
  1823. mov_b_indexw32_to_indexw32: ; reg 32-bit indexed, memory to memory
  1824. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1825. mov.l #0xffff0003, er1
  1826. mov.l #0xffff0004, er0
  1827. set_ccr_zero
  1828. ;; mov.b @(dd:32, rs.w), @(dd:32, rd.w)
  1829. mov.b @(byte_src-3:32, r1.w), @(byte_dst-4:32, r0.w)
  1830. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1831. test_neg_clear
  1832. test_zero_clear
  1833. test_ovf_clear
  1834. test_carry_clear
  1835. ;; Verify the affected registers.
  1836. test_h_gr32 0xffff0004 er0
  1837. test_h_gr32 0xffff0003 er1
  1838. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1839. test_gr_a5a5 3
  1840. test_gr_a5a5 4
  1841. test_gr_a5a5 5
  1842. test_gr_a5a5 6
  1843. test_gr_a5a5 7
  1844. ;; Now check the result of the move to memory.
  1845. cmp.b @byte_src, @byte_dst
  1846. bne fail1
  1847. ;; Now clear the destination location, and verify that.
  1848. mov.b #0, @byte_dst
  1849. cmp.b @byte_src, @byte_dst
  1850. beq fail1
  1851. mov_b_indexl32_to_indexl32: ; reg 32-bit indexed, memory to memory
  1852. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1853. mov.l #0x00000005, er1
  1854. mov.l #0x00000006, er0
  1855. set_ccr_zero
  1856. ;; mov.b @(dd:32, rs.w), @(dd:32, rd.w)
  1857. mov.b @(byte_src-5:32, er1.l), @(byte_dst-6:32, er0.l)
  1858. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1859. test_neg_clear
  1860. test_zero_clear
  1861. test_ovf_clear
  1862. test_carry_clear
  1863. ;; Verify the affected registers.
  1864. test_h_gr32 0x00000006 er0
  1865. test_h_gr32 0x00000005 er1
  1866. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1867. test_gr_a5a5 3
  1868. test_gr_a5a5 4
  1869. test_gr_a5a5 5
  1870. test_gr_a5a5 6
  1871. test_gr_a5a5 7
  1872. ;; Now check the result of the move to memory.
  1873. cmp.b @byte_src, @byte_dst
  1874. bne fail1
  1875. ;; Now clear the destination location, and verify that.
  1876. mov.b #0, @byte_dst
  1877. cmp.b @byte_src, @byte_dst
  1878. beq fail1
  1879. mov_b_abs16_to_abs16: ; 16-bit absolute addr, memory to memory
  1880. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1881. set_ccr_zero
  1882. ;; mov.b @aa:16, @aa:16
  1883. mov.b @byte_src:16, @byte_dst:16
  1884. ;;; .word 0x0178
  1885. ;;; .word 0x4040
  1886. ;;; .word @byte_src
  1887. ;;; .word @byte_dst
  1888. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1889. test_neg_clear
  1890. test_zero_clear
  1891. test_ovf_clear
  1892. test_carry_clear
  1893. test_gr_a5a5 0 ; Make sure *NO* general registers are changed
  1894. test_gr_a5a5 1
  1895. test_gr_a5a5 2
  1896. test_gr_a5a5 3
  1897. test_gr_a5a5 4
  1898. test_gr_a5a5 5
  1899. test_gr_a5a5 6
  1900. test_gr_a5a5 7
  1901. ;; Now check the result of the move to memory.
  1902. cmp.b @byte_src, @byte_dst
  1903. beq .Lnext135
  1904. fail
  1905. .Lnext135:
  1906. ;; Now clear the destination location, and verify that.
  1907. mov.b #0, @byte_dst
  1908. cmp.b @byte_src, @byte_dst
  1909. bne .Lnext136
  1910. fail
  1911. .Lnext136: ; OK, pass on.
  1912. mov_b_abs32_to_abs32: ; 32-bit absolute addr, memory to memory
  1913. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1914. set_ccr_zero
  1915. ;; mov.b @aa:32, @aa:32
  1916. mov.b @byte_src:32, @byte_dst:32
  1917. ;;; .word 0x0178
  1918. ;;; .word 0x4848
  1919. ;;; .long @byte_src
  1920. ;;; .long @byte_dst
  1921. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1922. test_neg_clear
  1923. test_zero_clear
  1924. test_ovf_clear
  1925. test_carry_clear
  1926. test_gr_a5a5 0 ; Make sure *NO* general registers are changed
  1927. test_gr_a5a5 1
  1928. test_gr_a5a5 2
  1929. test_gr_a5a5 3
  1930. test_gr_a5a5 4
  1931. test_gr_a5a5 5
  1932. test_gr_a5a5 6
  1933. test_gr_a5a5 7
  1934. ;; Now check the result of the move to memory.
  1935. cmp.b @byte_src, @byte_dst
  1936. beq .Lnext145
  1937. fail
  1938. .Lnext145:
  1939. ;; Now clear the destination location, and verify that.
  1940. mov.b #0, @byte_dst
  1941. cmp.b @byte_src, @byte_dst
  1942. bne .Lnext146
  1943. fail
  1944. .Lnext146: ; OK, pass on.
  1945. .endif
  1946. pass
  1947. exit 0
  1948. fail1:
  1949. fail