movw.s 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956
  1. # Hitachi H8 testcase 'mov.w'
  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 2
  13. word_dst_dec:
  14. .word 0
  15. word_src:
  16. .word 0x7777
  17. word_dst:
  18. .word 0
  19. .text
  20. ;;
  21. ;; Move word from immediate source
  22. ;;
  23. .if (sim_cpu == h8sx)
  24. mov_w_imm3_to_reg16:
  25. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  26. set_ccr_zero
  27. ;; mov.w #xx:3, rd
  28. mov.w #0x3:3, r0 ; Immediate 3-bit operand
  29. ;;; .word 0x0f30
  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 0xa5a50003 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. mov_w_imm16_to_reg16:
  45. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  46. set_ccr_zero
  47. ;; mov.w #xx:16, rd
  48. mov.w #0x1234, r0 ; Immediate 16-bit operand
  49. ;;; .word 0x7900
  50. ;;; .word 0x1234
  51. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  52. test_neg_clear
  53. test_zero_clear
  54. test_ovf_clear
  55. test_carry_clear
  56. test_h_gr32 0xa5a51234 er0
  57. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  58. test_gr_a5a5 2
  59. test_gr_a5a5 3
  60. test_gr_a5a5 4
  61. test_gr_a5a5 5
  62. test_gr_a5a5 6
  63. test_gr_a5a5 7
  64. .if (sim_cpu == h8sx)
  65. mov_w_imm4_to_abs16:
  66. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  67. set_ccr_zero
  68. ;; mov.w #xx:4, @aa:16
  69. mov.w #0xf:4, @word_dst:16 ; 4-bit imm to 16-bit address-direct
  70. ;;; .word 0x6bdf
  71. ;;; .word @word_dst
  72. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  73. test_neg_clear
  74. test_zero_clear
  75. test_ovf_clear
  76. test_carry_clear
  77. test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
  78. test_gr_a5a5 1 ; (first, because on h8/300 we must use one
  79. test_gr_a5a5 2 ; to examine the destination memory).
  80. test_gr_a5a5 3
  81. test_gr_a5a5 4
  82. test_gr_a5a5 5
  83. test_gr_a5a5 6
  84. test_gr_a5a5 7
  85. ;; Now check the result of the move to memory.
  86. cmp.w #0xf, @word_dst
  87. beq .Lnext21
  88. fail
  89. .Lnext21:
  90. mov.w #0, @word_dst ; zero it again for the next use.
  91. mov_w_imm4_to_abs32:
  92. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  93. set_ccr_zero
  94. ;; mov.w #xx:4, @aa:32
  95. mov.w #0xf:4, @word_dst:32 ; 4-bit imm to 32-bit address-direct
  96. ;;; .word 0x6bff
  97. ;;; .long @word_dst
  98. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  99. test_neg_clear
  100. test_zero_clear
  101. test_ovf_clear
  102. test_carry_clear
  103. test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
  104. test_gr_a5a5 1 ; (first, because on h8/300 we must use one
  105. test_gr_a5a5 2 ; to examine the destination memory).
  106. test_gr_a5a5 3
  107. test_gr_a5a5 4
  108. test_gr_a5a5 5
  109. test_gr_a5a5 6
  110. test_gr_a5a5 7
  111. ;; Now check the result of the move to memory.
  112. cmp.w #0xf, @word_dst
  113. beq .Lnext22
  114. fail
  115. .Lnext22:
  116. mov.w #0, @word_dst ; zero it again for the next use.
  117. mov_w_imm8_to_indirect:
  118. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  119. set_ccr_zero
  120. ;; mov.w #xx:8, @erd
  121. mov.l #word_dst, er1
  122. mov.w #0xa5:8, @er1 ; Register indirect operand
  123. ;;; .word 0x015d
  124. ;;; .word 0x01a5
  125. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  126. test_neg_clear
  127. test_zero_clear
  128. test_ovf_clear
  129. test_carry_clear
  130. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  131. test_h_gr32 word_dst, er1
  132. test_gr_a5a5 2
  133. test_gr_a5a5 3
  134. test_gr_a5a5 4
  135. test_gr_a5a5 5
  136. test_gr_a5a5 6
  137. test_gr_a5a5 7
  138. ;; Now check the result of the move to memory.
  139. cmp.w #0xa5, @word_dst
  140. beq .Lnext1
  141. fail
  142. .Lnext1:
  143. mov.w #0, @word_dst ; zero it again for the next use.
  144. mov_w_imm8_to_postinc: ; post-increment from imm8 to mem
  145. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  146. set_ccr_zero
  147. ;; mov.w #xx:8, @erd+
  148. mov.l #word_dst, er1
  149. mov.w #0xa5:8, @er1+ ; Imm8, register post-incr operands.
  150. ;;; .word 0x015d
  151. ;;; .word 0x81a5
  152. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  153. test_neg_clear
  154. test_zero_clear
  155. test_ovf_clear
  156. test_carry_clear
  157. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  158. test_h_gr32 word_dst+2, er1
  159. test_gr_a5a5 2
  160. test_gr_a5a5 3
  161. test_gr_a5a5 4
  162. test_gr_a5a5 5
  163. test_gr_a5a5 6
  164. test_gr_a5a5 7
  165. ;; Now check the result of the move to memory.
  166. cmp.w #0xa5, @word_dst
  167. beq .Lnext2
  168. fail
  169. .Lnext2:
  170. mov.w #0, @word_dst ; zero it again for the next use.
  171. mov_w_imm8_to_postdec: ; post-decrement from imm8 to mem
  172. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  173. set_ccr_zero
  174. ;; mov.w #xx:8, @erd-
  175. mov.l #word_dst, er1
  176. mov.w #0xa5:8, @er1- ; Imm8, register post-decr operands.
  177. ;;; .word 0x015d
  178. ;;; .word 0xa1a5
  179. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  180. test_neg_clear
  181. test_zero_clear
  182. test_ovf_clear
  183. test_carry_clear
  184. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  185. test_h_gr32 word_dst-2, er1
  186. test_gr_a5a5 2
  187. test_gr_a5a5 3
  188. test_gr_a5a5 4
  189. test_gr_a5a5 5
  190. test_gr_a5a5 6
  191. test_gr_a5a5 7
  192. ;; Now check the result of the move to memory.
  193. cmp.w #0xa5, @word_dst
  194. beq .Lnext3
  195. fail
  196. .Lnext3:
  197. mov.w #0, @word_dst ; zero it again for the next use.
  198. mov_w_imm8_to_preinc: ; pre-increment from register to mem
  199. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  200. set_ccr_zero
  201. ;; mov.w #xx:8, @+erd
  202. mov.l #word_dst-2, er1
  203. mov.w #0xa5:8, @+er1 ; Imm8, register pre-incr operands
  204. ;;; .word 0x015d
  205. ;;; .word 0x91a5
  206. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  207. test_neg_clear
  208. test_zero_clear
  209. test_ovf_clear
  210. test_carry_clear
  211. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  212. test_h_gr32 word_dst, er1
  213. test_gr_a5a5 2
  214. test_gr_a5a5 3
  215. test_gr_a5a5 4
  216. test_gr_a5a5 5
  217. test_gr_a5a5 6
  218. test_gr_a5a5 7
  219. ;; Now check the result of the move to memory.
  220. cmp.w #0xa5, @word_dst
  221. beq .Lnext4
  222. fail
  223. .Lnext4:
  224. mov.w #0, @word_dst ; zero it again for the next use.
  225. mov_w_imm8_to_predec: ; pre-decrement from register to mem
  226. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  227. set_ccr_zero
  228. ;; mov.w #xx:8, @-erd
  229. mov.l #word_dst+2, er1
  230. mov.w #0xa5:8, @-er1 ; Imm8, register pre-decr operands
  231. ;;; .word 0x015d
  232. ;;; .word 0xb1a5
  233. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  234. test_neg_clear
  235. test_zero_clear
  236. test_ovf_clear
  237. test_carry_clear
  238. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  239. test_h_gr32 word_dst, er1
  240. test_gr_a5a5 2
  241. test_gr_a5a5 3
  242. test_gr_a5a5 4
  243. test_gr_a5a5 5
  244. test_gr_a5a5 6
  245. test_gr_a5a5 7
  246. ;; Now check the result of the move to memory.
  247. cmp.w #0xa5, @word_dst
  248. beq .Lnext5
  249. fail
  250. .Lnext5:
  251. mov.w #0, @word_dst ; zero it again for the next use.
  252. mov_w_imm8_to_disp2:
  253. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  254. set_ccr_zero
  255. ;; mov.w #xx:8, @(dd:2, erd)
  256. mov.l #word_dst-6, er1
  257. mov.w #0xa5:8, @(6:2, er1) ; Imm8, reg plus 2-bit disp. operand
  258. ;;; .word 0x015d
  259. ;;; .word 0x31a5
  260. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  261. test_neg_clear
  262. test_zero_clear
  263. test_ovf_clear
  264. test_carry_clear
  265. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  266. test_h_gr32 word_dst-6, er1
  267. test_gr_a5a5 2
  268. test_gr_a5a5 3
  269. test_gr_a5a5 4
  270. test_gr_a5a5 5
  271. test_gr_a5a5 6
  272. test_gr_a5a5 7
  273. ;; Now check the result of the move to memory.
  274. cmp.w #0xa5, @word_dst
  275. beq .Lnext6
  276. fail
  277. .Lnext6:
  278. mov.w #0, @word_dst ; zero it again for the next use.
  279. mov_w_imm8_to_disp16:
  280. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  281. set_ccr_zero
  282. ;; mov.w #xx:8, @(dd:16, erd)
  283. mov.l #word_dst-4, er1
  284. mov.w #0xa5:8, @(4:16, er1) ; Register plus 16-bit disp. operand
  285. ;;; .word 0x015d
  286. ;;; .word 0x6f90
  287. ;;; .word 0x0004
  288. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  289. test_neg_clear
  290. test_zero_clear
  291. test_ovf_clear
  292. test_carry_clear
  293. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  294. test_h_gr32 word_dst-4, er1
  295. test_gr_a5a5 2
  296. test_gr_a5a5 3
  297. test_gr_a5a5 4
  298. test_gr_a5a5 5
  299. test_gr_a5a5 6
  300. test_gr_a5a5 7
  301. ;; Now check the result of the move to memory.
  302. cmp.w #0xa5, @word_dst
  303. beq .Lnext7
  304. fail
  305. .Lnext7:
  306. mov.w #0, @word_dst ; zero it again for the next use.
  307. mov_w_imm8_to_disp32:
  308. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  309. set_ccr_zero
  310. ;; mov.w #xx:8, @(dd:32, erd)
  311. mov.l #word_dst-8, er1
  312. mov.w #0xa5:8, @(8:32, er1) ; Register plus 32-bit disp. operand
  313. ;;; .word 0x015d
  314. ;;; .word 0xc9a5
  315. ;;; .long 8
  316. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  317. test_neg_clear
  318. test_zero_clear
  319. test_ovf_clear
  320. test_carry_clear
  321. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  322. test_h_gr32 word_dst-8, er1
  323. test_gr_a5a5 2
  324. test_gr_a5a5 3
  325. test_gr_a5a5 4
  326. test_gr_a5a5 5
  327. test_gr_a5a5 6
  328. test_gr_a5a5 7
  329. ;; Now check the result of the move to memory.
  330. cmp.w #0xa5, @word_dst
  331. beq .Lnext8
  332. fail
  333. .Lnext8:
  334. mov.w #0, @word_dst ; zero it again for the next use.
  335. mov_w_imm8_to_abs16:
  336. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  337. set_ccr_zero
  338. ;; mov.w #xx:8, @aa:16
  339. mov.w #0xa5:8, @word_dst:16 ; 16-bit address-direct operand
  340. ;;; .word 0x015d
  341. ;;; .word 0x40a5
  342. ;;; .word @word_dst
  343. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  344. test_neg_clear
  345. test_zero_clear
  346. test_ovf_clear
  347. test_carry_clear
  348. test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
  349. test_gr_a5a5 1 ; (first, because on h8/300 we must use one
  350. test_gr_a5a5 2 ; to examine the destination memory).
  351. test_gr_a5a5 3
  352. test_gr_a5a5 4
  353. test_gr_a5a5 5
  354. test_gr_a5a5 6
  355. test_gr_a5a5 7
  356. ;; Now check the result of the move to memory.
  357. cmp.w #0xa5, @word_dst
  358. beq .Lnext9
  359. fail
  360. .Lnext9:
  361. mov.w #0, @word_dst ; zero it again for the next use.
  362. mov_w_imm8_to_abs32:
  363. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  364. set_ccr_zero
  365. ;; mov.w #xx:8, @aa:32
  366. mov.w #0xa5:8, @word_dst:32 ; 32-bit address-direct operand
  367. ;;; .word 0x015d
  368. ;;; .word 0x48a5
  369. ;;; .long @word_dst
  370. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  371. test_neg_clear
  372. test_zero_clear
  373. test_ovf_clear
  374. test_carry_clear
  375. test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
  376. test_gr_a5a5 1 ; (first, because on h8/300 we must use one
  377. test_gr_a5a5 2 ; to examine the destination memory).
  378. test_gr_a5a5 3
  379. test_gr_a5a5 4
  380. test_gr_a5a5 5
  381. test_gr_a5a5 6
  382. test_gr_a5a5 7
  383. ;; Now check the result of the move to memory.
  384. cmp.w #0xa5, @word_dst
  385. beq .Lnext10
  386. fail
  387. .Lnext10:
  388. mov.w #0, @word_dst ; zero it again for the next use.
  389. mov_w_imm16_to_indirect:
  390. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  391. set_ccr_zero
  392. ;; mov.w #xx:16, @erd
  393. mov.l #word_dst, er1
  394. mov.w #0xdead:16, @er1 ; Register indirect operand
  395. ;;; .word 0x7974
  396. ;;; .word 0xdead
  397. ;;; .word 0x0100
  398. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  399. test_neg_set
  400. test_zero_clear
  401. test_ovf_clear
  402. test_carry_clear
  403. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  404. test_h_gr32 word_dst, er1
  405. test_gr_a5a5 2
  406. test_gr_a5a5 3
  407. test_gr_a5a5 4
  408. test_gr_a5a5 5
  409. test_gr_a5a5 6
  410. test_gr_a5a5 7
  411. ;; Now check the result of the move to memory.
  412. cmp.w #0xdead, @word_dst
  413. beq .Lnext11
  414. fail
  415. .Lnext11:
  416. mov.w #0, @word_dst ; zero it again for the next use.
  417. mov_w_imm16_to_postinc: ; post-increment from imm16 to mem
  418. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  419. set_ccr_zero
  420. ;; mov.w #xx:16, @erd+
  421. mov.l #word_dst, er1
  422. mov.w #0xdead:16, @er1+ ; Imm16, register post-incr operands.
  423. ;;; .word 0x7974
  424. ;;; .word 0xdead
  425. ;;; .word 0x8100
  426. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  427. test_neg_set
  428. test_zero_clear
  429. test_ovf_clear
  430. test_carry_clear
  431. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  432. test_h_gr32 word_dst+2, er1
  433. test_gr_a5a5 2
  434. test_gr_a5a5 3
  435. test_gr_a5a5 4
  436. test_gr_a5a5 5
  437. test_gr_a5a5 6
  438. test_gr_a5a5 7
  439. ;; Now check the result of the move to memory.
  440. cmp.w #0xdead, @word_dst
  441. beq .Lnext12
  442. fail
  443. .Lnext12:
  444. mov.w #0, @word_dst ; zero it again for the next use.
  445. mov_w_imm16_to_postdec: ; post-decrement from imm16 to mem
  446. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  447. set_ccr_zero
  448. ;; mov.w #xx:16, @erd-
  449. mov.l #word_dst, er1
  450. mov.w #0xdead:16, @er1- ; Imm16, register post-decr operands.
  451. ;;; .word 0x7974
  452. ;;; .word 0xdead
  453. ;;; .word 0xa100
  454. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  455. test_neg_set
  456. test_zero_clear
  457. test_ovf_clear
  458. test_carry_clear
  459. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  460. test_h_gr32 word_dst-2, er1
  461. test_gr_a5a5 2
  462. test_gr_a5a5 3
  463. test_gr_a5a5 4
  464. test_gr_a5a5 5
  465. test_gr_a5a5 6
  466. test_gr_a5a5 7
  467. ;; Now check the result of the move to memory.
  468. cmp.w #0xdead, @word_dst
  469. beq .Lnext13
  470. fail
  471. .Lnext13:
  472. mov.w #0, @word_dst ; zero it again for the next use.
  473. mov_w_imm16_to_preinc: ; pre-increment from register to mem
  474. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  475. set_ccr_zero
  476. ;; mov.w #xx:16, @+erd
  477. mov.l #word_dst-2, er1
  478. mov.w #0xdead:16, @+er1 ; Imm16, register pre-incr operands
  479. ;;; .word 0x7974
  480. ;;; .word 0xdead
  481. ;;; .word 0x9100
  482. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  483. test_neg_set
  484. test_zero_clear
  485. test_ovf_clear
  486. test_carry_clear
  487. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  488. test_h_gr32 word_dst, er1
  489. test_gr_a5a5 2
  490. test_gr_a5a5 3
  491. test_gr_a5a5 4
  492. test_gr_a5a5 5
  493. test_gr_a5a5 6
  494. test_gr_a5a5 7
  495. ;; Now check the result of the move to memory.
  496. cmp.w #0xdead, @word_dst
  497. beq .Lnext14
  498. fail
  499. .Lnext14:
  500. mov.w #0, @word_dst ; zero it again for the next use.
  501. mov_w_imm16_to_predec: ; pre-decrement from register to mem
  502. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  503. set_ccr_zero
  504. ;; mov.w #xx:16, @-erd
  505. mov.l #word_dst+2, er1
  506. mov.w #0xdead:16, @-er1 ; Imm16, register pre-decr operands
  507. ;;; .word 0x7974
  508. ;;; .word 0xdead
  509. ;;; .word 0xb100
  510. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  511. test_neg_set
  512. test_zero_clear
  513. test_ovf_clear
  514. test_carry_clear
  515. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  516. test_h_gr32 word_dst, er1
  517. test_gr_a5a5 2
  518. test_gr_a5a5 3
  519. test_gr_a5a5 4
  520. test_gr_a5a5 5
  521. test_gr_a5a5 6
  522. test_gr_a5a5 7
  523. ;; Now check the result of the move to memory.
  524. cmp.w #0xdead, @word_dst
  525. beq .Lnext15
  526. fail
  527. .Lnext15:
  528. mov.w #0, @word_dst ; zero it again for the next use.
  529. mov_w_imm16_to_disp2:
  530. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  531. set_ccr_zero
  532. ;; mov.w #xx:16, @(dd:2, erd)
  533. mov.l #word_dst-6, er1
  534. mov.w #0xdead:16, @(6:2, er1) ; Imm16, reg plus 2-bit disp. operand
  535. ;;; .word 0x7974
  536. ;;; .word 0xdead
  537. ;;; .word 0x3100
  538. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  539. test_neg_set
  540. test_zero_clear
  541. test_ovf_clear
  542. test_carry_clear
  543. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  544. test_h_gr32 word_dst-6, er1
  545. test_gr_a5a5 2
  546. test_gr_a5a5 3
  547. test_gr_a5a5 4
  548. test_gr_a5a5 5
  549. test_gr_a5a5 6
  550. test_gr_a5a5 7
  551. ;; Now check the result of the move to memory.
  552. cmp.w #0xdead, @word_dst
  553. beq .Lnext16
  554. fail
  555. .Lnext16:
  556. mov.w #0, @word_dst ; zero it again for the next use.
  557. mov_w_imm16_to_disp16:
  558. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  559. set_ccr_zero
  560. ;; mov.w #xx:16, @(dd:16, erd)
  561. mov.l #word_dst-4, er1
  562. mov.w #0xdead:16, @(4:16, er1) ; Register plus 16-bit disp. operand
  563. ;;; .word 0x7974
  564. ;;; .word 0xdead
  565. ;;; .word 0xc100
  566. ;;; .word 0x0004
  567. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  568. test_neg_set
  569. test_zero_clear
  570. test_ovf_clear
  571. test_carry_clear
  572. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  573. test_h_gr32 word_dst-4, er1
  574. test_gr_a5a5 2
  575. test_gr_a5a5 3
  576. test_gr_a5a5 4
  577. test_gr_a5a5 5
  578. test_gr_a5a5 6
  579. test_gr_a5a5 7
  580. ;; Now check the result of the move to memory.
  581. cmp.w #0xdead, @word_dst
  582. beq .Lnext17
  583. fail
  584. .Lnext17:
  585. mov.w #0, @word_dst ; zero it again for the next use.
  586. mov_w_imm16_to_disp32:
  587. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  588. set_ccr_zero
  589. ;; mov.w #xx:16, @(dd:32, erd)
  590. mov.l #word_dst-8, er1
  591. mov.w #0xdead:16, @(8:32, er1) ; Register plus 32-bit disp. operand
  592. ;;; .word 0x7974
  593. ;;; .word 0xdead
  594. ;;; .word 0xc900
  595. ;;; .long 8
  596. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  597. test_neg_set
  598. test_zero_clear
  599. test_ovf_clear
  600. test_carry_clear
  601. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  602. test_h_gr32 word_dst-8, er1
  603. test_gr_a5a5 2
  604. test_gr_a5a5 3
  605. test_gr_a5a5 4
  606. test_gr_a5a5 5
  607. test_gr_a5a5 6
  608. test_gr_a5a5 7
  609. ;; Now check the result of the move to memory.
  610. cmp.w #0xdead, @word_dst
  611. beq .Lnext18
  612. fail
  613. .Lnext18:
  614. mov.w #0, @word_dst ; zero it again for the next use.
  615. mov_w_imm16_to_abs16:
  616. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  617. set_ccr_zero
  618. ;; mov.w #xx:16, @aa:16
  619. mov.w #0xdead:16, @word_dst:16 ; 16-bit address-direct operand
  620. ;;; .word 0x7974
  621. ;;; .word 0xdead
  622. ;;; .word 0x4000
  623. ;;; .word @word_dst
  624. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  625. test_neg_set
  626. test_zero_clear
  627. test_ovf_clear
  628. test_carry_clear
  629. test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
  630. test_gr_a5a5 1 ; (first, because on h8/300 we must use one
  631. test_gr_a5a5 2 ; to examine the destination memory).
  632. test_gr_a5a5 3
  633. test_gr_a5a5 4
  634. test_gr_a5a5 5
  635. test_gr_a5a5 6
  636. test_gr_a5a5 7
  637. ;; Now check the result of the move to memory.
  638. cmp.w #0xdead, @word_dst
  639. beq .Lnext19
  640. fail
  641. .Lnext19:
  642. mov.w #0, @word_dst ; zero it again for the next use.
  643. mov_w_imm16_to_abs32:
  644. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  645. set_ccr_zero
  646. ;; mov.w #xx:16, @aa:32
  647. mov.w #0xdead:16, @word_dst:32 ; 32-bit address-direct operand
  648. ;;; .word 0x7974
  649. ;;; .word 0xdead
  650. ;;; .word 0x4800
  651. ;;; .long @word_dst
  652. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  653. test_neg_set
  654. test_zero_clear
  655. test_ovf_clear
  656. test_carry_clear
  657. test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
  658. test_gr_a5a5 1 ; (first, because on h8/300 we must use one
  659. test_gr_a5a5 2 ; to examine the destination memory).
  660. test_gr_a5a5 3
  661. test_gr_a5a5 4
  662. test_gr_a5a5 5
  663. test_gr_a5a5 6
  664. test_gr_a5a5 7
  665. ;; Now check the result of the move to memory.
  666. cmp.w #0xdead, @word_dst
  667. beq .Lnext20
  668. fail
  669. .Lnext20:
  670. mov.w #0, @word_dst ; zero it again for the next use.
  671. .endif
  672. ;;
  673. ;; Move word from register source
  674. ;;
  675. mov_w_reg16_to_reg16:
  676. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  677. set_ccr_zero
  678. ;; mov.w ers, erd
  679. mov.w #0x1234, r1
  680. mov.w r1, r0 ; Register 16-bit operand
  681. ;;; .word 0x0d10
  682. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  683. test_neg_clear
  684. test_zero_clear
  685. test_ovf_clear
  686. test_carry_clear
  687. test_h_gr16 0x1234 r0
  688. test_h_gr16 0x1234 r1 ; mov src unchanged
  689. .if (sim_cpu)
  690. test_h_gr32 0xa5a51234 er0
  691. test_h_gr32 0xa5a51234 er1 ; mov src unchanged
  692. .endif
  693. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  694. test_gr_a5a5 3
  695. test_gr_a5a5 4
  696. test_gr_a5a5 5
  697. test_gr_a5a5 6
  698. test_gr_a5a5 7
  699. mov_w_reg16_to_indirect:
  700. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  701. set_ccr_zero
  702. ;; mov.w ers, @erd
  703. mov.l #word_dst, er1
  704. mov.w r0, @er1 ; Register indirect operand
  705. ;;; .word 0x6990
  706. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  707. test_neg_set
  708. test_zero_clear
  709. test_ovf_clear
  710. test_carry_clear
  711. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  712. test_h_gr32 word_dst, er1
  713. test_gr_a5a5 2
  714. test_gr_a5a5 3
  715. test_gr_a5a5 4
  716. test_gr_a5a5 5
  717. test_gr_a5a5 6
  718. test_gr_a5a5 7
  719. ;; Now check the result of the move to memory.
  720. mov.w #0, r0
  721. mov.w @word_dst, r0
  722. cmp.w r2, r0
  723. beq .Lnext44
  724. fail
  725. .Lnext44:
  726. mov.w #0, r0
  727. mov.w r0, @word_dst ; zero it again for the next use.
  728. .if (sim_cpu == h8sx)
  729. mov_w_reg16_to_postinc: ; post-increment from register to mem
  730. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  731. set_ccr_zero
  732. ;; mov.w ers, @erd+
  733. mov.l #word_dst, er1
  734. mov.w r0, @er1+ ; Register post-incr operand
  735. ;;; .word 0x0153
  736. ;;; .word 0x6d90
  737. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  738. test_neg_set
  739. test_zero_clear
  740. test_ovf_clear
  741. test_carry_clear
  742. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  743. test_h_gr32 word_dst+2, er1
  744. test_gr_a5a5 2
  745. test_gr_a5a5 3
  746. test_gr_a5a5 4
  747. test_gr_a5a5 5
  748. test_gr_a5a5 6
  749. test_gr_a5a5 7
  750. ;; Now check the result of the move to memory.
  751. cmp.w r2, @word_dst
  752. beq .Lnext49
  753. fail
  754. .Lnext49:
  755. ;; special case same register
  756. mov.l #word_dst, er0
  757. mov.w r0, r1
  758. inc.w #2,r1
  759. mov.w r0, @er0+
  760. mov.w @word_dst, r0
  761. cmp.w r0, r1
  762. beq .Lnext53
  763. fail
  764. .Lnext53:
  765. mov.w #0, @word_dst ; zero it again for the next use.
  766. mov_w_reg16_to_postdec: ; post-decrement from register to mem
  767. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  768. set_ccr_zero
  769. ;; mov.w ers, @erd-
  770. mov.l #word_dst, er1
  771. mov.w r0, @er1- ; Register post-decr operand
  772. ;;; .word 0x0151
  773. ;;; .word 0x6d90
  774. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  775. test_neg_set
  776. test_zero_clear
  777. test_ovf_clear
  778. test_carry_clear
  779. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  780. test_h_gr32 word_dst-2, er1
  781. test_gr_a5a5 2
  782. test_gr_a5a5 3
  783. test_gr_a5a5 4
  784. test_gr_a5a5 5
  785. test_gr_a5a5 6
  786. test_gr_a5a5 7
  787. ;; Now check the result of the move to memory.
  788. cmp.w r2, @word_dst
  789. beq .Lnext50
  790. fail
  791. .Lnext50:
  792. ;; special case same register
  793. mov.l #word_dst, er0
  794. mov.w r0, r1
  795. dec.w #2, r1
  796. mov.w r0, @er0-
  797. mov.w @word_dst, r0
  798. cmp.w r0, r1
  799. beq .Lnext54
  800. fail
  801. .Lnext54:
  802. mov.w #0, @word_dst ; zero it again for the next use.
  803. mov_w_reg16_to_preinc: ; pre-increment from register to mem
  804. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  805. set_ccr_zero
  806. ;; mov.w ers, @+erd
  807. mov.l #word_dst-2, er1
  808. mov.w r0, @+er1 ; Register pre-incr operand
  809. ;;; .word 0x0152
  810. ;;; .word 0x6d90
  811. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  812. test_neg_set
  813. test_zero_clear
  814. test_ovf_clear
  815. test_carry_clear
  816. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  817. test_h_gr32 word_dst, er1
  818. test_gr_a5a5 2
  819. test_gr_a5a5 3
  820. test_gr_a5a5 4
  821. test_gr_a5a5 5
  822. test_gr_a5a5 6
  823. test_gr_a5a5 7
  824. ;; Now check the result of the move to memory.
  825. cmp.w r2, @word_dst
  826. beq .Lnext51
  827. fail
  828. .Lnext51:
  829. ;; special case same register
  830. mov.l #word_dst-2, er0
  831. mov.w r0, r1
  832. inc.w #2, r1
  833. mov.w r0, @+er0
  834. mov.w @word_dst, r0
  835. cmp.w r0, r1
  836. beq .Lnext55
  837. fail
  838. .Lnext55:
  839. mov.w #0, @word_dst ; zero it again for the next use.
  840. .endif
  841. mov_w_reg16_to_predec: ; pre-decrement from register to mem
  842. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  843. set_ccr_zero
  844. ;; mov.w ers, @-erd
  845. mov.l #word_dst+2, er1
  846. mov.w r0, @-er1 ; Register pre-decr operand
  847. ;;; .word 0x6d90
  848. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  849. test_neg_set
  850. test_zero_clear
  851. test_ovf_clear
  852. test_carry_clear
  853. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  854. test_h_gr32 word_dst, er1
  855. test_gr_a5a5 2
  856. test_gr_a5a5 3
  857. test_gr_a5a5 4
  858. test_gr_a5a5 5
  859. test_gr_a5a5 6
  860. test_gr_a5a5 7
  861. ;; Now check the result of the move to memory.
  862. mov.w #0, r0
  863. mov.w @word_dst, r0
  864. cmp.w r2, r0
  865. beq .Lnext48
  866. fail
  867. .Lnext48:
  868. ;; Special case in same register
  869. ;; CCR confirmation omitted
  870. mov.l #word_dst+2, er1
  871. mov.l er1, er0
  872. dec.w #2, r1
  873. mov.w r0, @-er0
  874. mov.w @word_dst, r0
  875. cmp.w r1, r0
  876. beq .Lnext47
  877. fail
  878. .Lnext47:
  879. mov.w #0, r0
  880. mov.w r0, @word_dst ; zero it again for the next use.
  881. .if (sim_cpu == h8sx)
  882. mov_w_reg16_to_disp2:
  883. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  884. set_ccr_zero
  885. ;; mov.w ers, @(dd:2, erd)
  886. mov.l #word_dst-6, er1
  887. mov.w r0, @(6:2, er1) ; Register plus 2-bit disp. operand
  888. ;;; .word 0x0153
  889. ;;; .word 0x6990
  890. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  891. test_neg_set
  892. test_zero_clear
  893. test_ovf_clear
  894. test_carry_clear
  895. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  896. test_h_gr32 word_dst-6, er1
  897. test_gr_a5a5 2
  898. test_gr_a5a5 3
  899. test_gr_a5a5 4
  900. test_gr_a5a5 5
  901. test_gr_a5a5 6
  902. test_gr_a5a5 7
  903. ;; Now check the result of the move to memory.
  904. cmp.w r2, @word_dst
  905. beq .Lnext52
  906. fail
  907. .Lnext52:
  908. mov.w #0, @word_dst ; zero it again for the next use.
  909. .endif
  910. mov_w_reg16_to_disp16:
  911. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  912. set_ccr_zero
  913. ;; mov.w ers, @(dd:16, erd)
  914. mov.l #word_dst-4, er1
  915. mov.w r0, @(4:16, er1) ; Register plus 16-bit disp. operand
  916. ;;; .word 0x6f90
  917. ;;; .word 0x0004
  918. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  919. test_neg_set
  920. test_zero_clear
  921. test_ovf_clear
  922. test_carry_clear
  923. test_h_gr32 word_dst-4, er1
  924. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  925. test_gr_a5a5 2
  926. test_gr_a5a5 3
  927. test_gr_a5a5 4
  928. test_gr_a5a5 5
  929. test_gr_a5a5 6
  930. test_gr_a5a5 7
  931. ;; Now check the result of the move to memory.
  932. mov.w #0, r0
  933. mov.w @word_dst, r0
  934. cmp.w r2, r0
  935. beq .Lnext45
  936. fail
  937. .Lnext45:
  938. mov.w #0, r0
  939. mov.w r0, @word_dst ; zero it again for the next use.
  940. mov_w_reg16_to_disp32:
  941. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  942. set_ccr_zero
  943. ;; mov.w ers, @(dd:32, erd)
  944. mov.l #word_dst-8, er1
  945. mov.w r0, @(8:32, er1) ; Register plus 32-bit disp. operand
  946. ;;; .word 0x7810
  947. ;;; .word 0x6ba0
  948. ;;; .long 8
  949. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  950. test_neg_set
  951. test_zero_clear
  952. test_ovf_clear
  953. test_carry_clear
  954. test_h_gr32 word_dst-8, er1
  955. test_gr_a5a5 0 ; Make sure other general regs not disturbed
  956. test_gr_a5a5 2
  957. test_gr_a5a5 3
  958. test_gr_a5a5 4
  959. test_gr_a5a5 5
  960. test_gr_a5a5 6
  961. test_gr_a5a5 7
  962. ;; Now check the result of the move to memory.
  963. mov.w #0, r0
  964. mov.w @word_dst, r0
  965. cmp.w r2, r0
  966. beq .Lnext46
  967. fail
  968. .Lnext46:
  969. mov.w #0, r0
  970. mov.w r0, @word_dst ; zero it again for the next use.
  971. mov_w_reg16_to_abs16:
  972. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  973. set_ccr_zero
  974. ;; mov.w ers, @aa:16
  975. mov.w r0, @word_dst:16 ; 16-bit address-direct operand
  976. ;;; .word 0x6b80
  977. ;;; .word @word_dst
  978. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  979. test_neg_set
  980. test_zero_clear
  981. test_ovf_clear
  982. test_carry_clear
  983. test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
  984. test_gr_a5a5 1 ; (first, because on h8/300 we must use one
  985. test_gr_a5a5 2 ; to examine the destination memory).
  986. test_gr_a5a5 3
  987. test_gr_a5a5 4
  988. test_gr_a5a5 5
  989. test_gr_a5a5 6
  990. test_gr_a5a5 7
  991. ;; Now check the result of the move to memory.
  992. mov.w #0, r0
  993. mov.w @word_dst, r0
  994. cmp.w r0, r1
  995. beq .Lnext41
  996. fail
  997. .Lnext41:
  998. mov.w #0, r0
  999. mov.w r0, @word_dst ; zero it again for the next use.
  1000. mov_w_reg16_to_abs32:
  1001. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1002. set_ccr_zero
  1003. ;; mov.w ers, @aa:32
  1004. mov.w r0, @word_dst:32 ; 32-bit address-direct operand
  1005. ;;; .word 0x6ba0
  1006. ;;; .long @word_dst
  1007. ;; test ccr ; H=0 N=1 Z=0 V=0 C=0
  1008. test_neg_set
  1009. test_zero_clear
  1010. test_ovf_clear
  1011. test_carry_clear
  1012. test_gr_a5a5 0 ; Make sure _ALL_ general regs not disturbed
  1013. test_gr_a5a5 1 ; (first, because on h8/300 we must use one
  1014. test_gr_a5a5 2 ; to examine the destination memory).
  1015. test_gr_a5a5 3
  1016. test_gr_a5a5 4
  1017. test_gr_a5a5 5
  1018. test_gr_a5a5 6
  1019. test_gr_a5a5 7
  1020. ;; Now check the result of the move to memory.
  1021. mov.w #0, r0
  1022. mov.w @word_dst, r0
  1023. cmp.w r0, r1
  1024. beq .Lnext42
  1025. fail
  1026. .Lnext42:
  1027. mov.w #0, r0
  1028. mov.w r0, @word_dst ; zero it again for the next use.
  1029. ;;
  1030. ;; Move word to register destination.
  1031. ;;
  1032. mov_w_indirect_to_reg16:
  1033. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1034. set_ccr_zero
  1035. ;; mov.w @ers, rd
  1036. mov.l #word_src, er1
  1037. mov.w @er1, r0 ; Register indirect operand
  1038. ;;; .word 0x6910
  1039. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1040. test_neg_clear
  1041. test_zero_clear
  1042. test_ovf_clear
  1043. test_carry_clear
  1044. test_h_gr32 0xa5a57777 er0
  1045. test_h_gr32 word_src, er1
  1046. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1047. test_gr_a5a5 3
  1048. test_gr_a5a5 4
  1049. test_gr_a5a5 5
  1050. test_gr_a5a5 6
  1051. test_gr_a5a5 7
  1052. mov_w_postinc_to_reg16: ; post-increment from mem to register
  1053. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1054. set_ccr_zero
  1055. ;; mov.w @ers+, rd
  1056. mov.l #word_src, er1
  1057. mov.w @er1+, r0 ; Register post-incr operand
  1058. ;;; .word 0x6d10
  1059. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1060. test_neg_clear
  1061. test_zero_clear
  1062. test_ovf_clear
  1063. test_carry_clear
  1064. test_h_gr32 0xa5a57777 er0
  1065. test_h_gr32 word_src+2, er1
  1066. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1067. test_gr_a5a5 3
  1068. test_gr_a5a5 4
  1069. test_gr_a5a5 5
  1070. test_gr_a5a5 6
  1071. test_gr_a5a5 7
  1072. .if (sim_cpu == h8sx)
  1073. mov_w_postdec_to_reg16: ; post-decrement from mem to register
  1074. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1075. set_ccr_zero
  1076. ;; mov.w @ers-, rd
  1077. mov.l #word_src, er1
  1078. mov.w @er1-, r0 ; Register post-decr operand
  1079. ;;; .word 0x0152
  1080. ;;; .word 0x6d10
  1081. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1082. test_neg_clear
  1083. test_zero_clear
  1084. test_ovf_clear
  1085. test_carry_clear
  1086. test_h_gr32 0xa5a57777 er0
  1087. test_h_gr32 word_src-2, er1
  1088. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1089. test_gr_a5a5 3
  1090. test_gr_a5a5 4
  1091. test_gr_a5a5 5
  1092. test_gr_a5a5 6
  1093. test_gr_a5a5 7
  1094. mov_w_preinc_to_reg16: ; pre-increment from mem to register
  1095. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1096. set_ccr_zero
  1097. ;; mov.w @+ers, rd
  1098. mov.l #word_src-2, er1
  1099. mov.w @+er1, r0 ; Register pre-incr operand
  1100. ;;; .word 0x0151
  1101. ;;; .word 0x6d10
  1102. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1103. test_neg_clear
  1104. test_zero_clear
  1105. test_ovf_clear
  1106. test_carry_clear
  1107. test_h_gr32 0xa5a57777 er0
  1108. test_h_gr32 word_src, er1
  1109. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1110. test_gr_a5a5 3
  1111. test_gr_a5a5 4
  1112. test_gr_a5a5 5
  1113. test_gr_a5a5 6
  1114. test_gr_a5a5 7
  1115. mov_w_predec_to_reg16: ; pre-decrement from mem to register
  1116. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1117. set_ccr_zero
  1118. ;; mov.w @-ers, rd
  1119. mov.l #word_src+2, er1
  1120. mov.w @-er1, r0 ; Register pre-decr operand
  1121. ;;; .word 0x0153
  1122. ;;; .word 0x6d10
  1123. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1124. test_neg_clear
  1125. test_zero_clear
  1126. test_ovf_clear
  1127. test_carry_clear
  1128. test_h_gr32 0xa5a57777 er0
  1129. test_h_gr32 word_src, er1
  1130. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1131. test_gr_a5a5 3
  1132. test_gr_a5a5 4
  1133. test_gr_a5a5 5
  1134. test_gr_a5a5 6
  1135. test_gr_a5a5 7
  1136. mov_w_disp2_to_reg16:
  1137. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1138. set_ccr_zero
  1139. ;; mov.w @(dd:2, ers), rd
  1140. mov.l #word_src-2, er1
  1141. mov.w @(2:2, er1), r0 ; Register plus 2-bit disp. operand
  1142. ;;; .word 0x0151
  1143. ;;; .word 0x6910
  1144. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1145. test_neg_clear
  1146. test_zero_clear
  1147. test_ovf_clear
  1148. test_carry_clear
  1149. test_h_gr32 0xa5a57777 er0 ; mov result: a5a5 | 7777
  1150. test_h_gr32 word_src-2, er1
  1151. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1152. test_gr_a5a5 3
  1153. test_gr_a5a5 4
  1154. test_gr_a5a5 5
  1155. test_gr_a5a5 6
  1156. test_gr_a5a5 7
  1157. .endif
  1158. mov_w_disp16_to_reg16:
  1159. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1160. set_ccr_zero
  1161. ;; mov.w @(dd:16, ers), rd
  1162. mov.l #word_src+0x1234, er1
  1163. mov.w @(-0x1234:16, er1), r0 ; Register plus 16-bit disp. operand
  1164. ;;; .word 0x6f10
  1165. ;;; .word -0x1234
  1166. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1167. test_neg_clear
  1168. test_zero_clear
  1169. test_ovf_clear
  1170. test_carry_clear
  1171. test_h_gr32 0xa5a57777 er0 ; mov result: a5a5 | 7777
  1172. test_h_gr32 word_src+0x1234, er1
  1173. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1174. test_gr_a5a5 3
  1175. test_gr_a5a5 4
  1176. test_gr_a5a5 5
  1177. test_gr_a5a5 6
  1178. test_gr_a5a5 7
  1179. mov_w_disp32_to_reg16:
  1180. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1181. set_ccr_zero
  1182. ;; mov.w @(dd:32, ers), rd
  1183. mov.l #word_src+65536, er1
  1184. mov.w @(-65536:32, er1), r0 ; Register plus 32-bit disp. operand
  1185. ;;; .word 0x7810
  1186. ;;; .word 0x6b20
  1187. ;;; .long -65536
  1188. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1189. test_neg_clear
  1190. test_zero_clear
  1191. test_ovf_clear
  1192. test_carry_clear
  1193. test_h_gr32 0xa5a57777 er0 ; mov result: a5a5 | 7777
  1194. test_h_gr32 word_src+65536, er1
  1195. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1196. test_gr_a5a5 3
  1197. test_gr_a5a5 4
  1198. test_gr_a5a5 5
  1199. test_gr_a5a5 6
  1200. test_gr_a5a5 7
  1201. mov_w_abs16_to_reg16:
  1202. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1203. set_ccr_zero
  1204. ;; mov.w @aa:16, rd
  1205. mov.w @word_src:16, r0 ; 16-bit address-direct operand
  1206. ;;; .word 0x6b00
  1207. ;;; .word @word_src
  1208. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1209. test_neg_clear
  1210. test_zero_clear
  1211. test_ovf_clear
  1212. test_carry_clear
  1213. test_h_gr32 0xa5a57777 er0
  1214. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1215. test_gr_a5a5 2
  1216. test_gr_a5a5 3
  1217. test_gr_a5a5 4
  1218. test_gr_a5a5 5
  1219. test_gr_a5a5 6
  1220. test_gr_a5a5 7
  1221. mov_w_abs32_to_reg16:
  1222. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1223. set_ccr_zero
  1224. ;; mov.w @aa:32, rd
  1225. mov.w @word_src:32, r0 ; 32-bit address-direct operand
  1226. ;;; .word 0x6b20
  1227. ;;; .long @word_src
  1228. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1229. test_neg_clear
  1230. test_zero_clear
  1231. test_ovf_clear
  1232. test_carry_clear
  1233. test_h_gr32 0xa5a57777 er0
  1234. test_gr_a5a5 1 ; Make sure other general regs not disturbed
  1235. test_gr_a5a5 2
  1236. test_gr_a5a5 3
  1237. test_gr_a5a5 4
  1238. test_gr_a5a5 5
  1239. test_gr_a5a5 6
  1240. test_gr_a5a5 7
  1241. .if (sim_cpu == h8sx)
  1242. ;;
  1243. ;; Move word from memory to memory
  1244. ;;
  1245. mov_w_indirect_to_indirect: ; reg indirect, memory to memory
  1246. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1247. set_ccr_zero
  1248. ;; mov.w @ers, @erd
  1249. mov.l #word_src, er1
  1250. mov.l #word_dst, er0
  1251. mov.w @er1, @er0
  1252. ;;; .word 0x0158
  1253. ;;; .word 0x0100
  1254. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1255. test_neg_clear
  1256. test_zero_clear
  1257. test_ovf_clear
  1258. test_carry_clear
  1259. ;; Verify the affected registers.
  1260. test_h_gr32 word_dst er0
  1261. test_h_gr32 word_src er1
  1262. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1263. test_gr_a5a5 3
  1264. test_gr_a5a5 4
  1265. test_gr_a5a5 5
  1266. test_gr_a5a5 6
  1267. test_gr_a5a5 7
  1268. ;; Now check the result of the move to memory.
  1269. cmp.w @word_src, @word_dst
  1270. beq .Lnext56
  1271. fail
  1272. .Lnext56:
  1273. ;; Now clear the destination location, and verify that.
  1274. mov.w #0, @word_dst
  1275. cmp.w @word_src, @word_dst
  1276. bne .Lnext57
  1277. fail
  1278. .Lnext57: ; OK, pass on.
  1279. mov_w_postinc_to_postinc: ; reg post-increment, memory to memory
  1280. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1281. set_ccr_zero
  1282. ;; mov.w @ers+, @erd+
  1283. mov.l #word_src, er1
  1284. mov.l #word_dst, er0
  1285. mov.w @er1+, @er0+
  1286. ;;; .word 0x0158
  1287. ;;; .word 0x8180
  1288. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1289. test_neg_clear
  1290. test_zero_clear
  1291. test_ovf_clear
  1292. test_carry_clear
  1293. ;; Verify the affected registers.
  1294. test_h_gr32 word_dst+2 er0
  1295. test_h_gr32 word_src+2 er1
  1296. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1297. test_gr_a5a5 3
  1298. test_gr_a5a5 4
  1299. test_gr_a5a5 5
  1300. test_gr_a5a5 6
  1301. test_gr_a5a5 7
  1302. ;; Now check the result of the move to memory.
  1303. cmp.w @word_src, @word_dst
  1304. beq .Lnext65
  1305. fail
  1306. .Lnext65:
  1307. ;; Now clear the destination location, and verify that.
  1308. mov.w #0, @word_dst
  1309. cmp.w @word_src, @word_dst
  1310. bne .Lnext66
  1311. fail
  1312. .Lnext66: ; OK, pass on.
  1313. ;; special case same register
  1314. mov.l #word_src, er0
  1315. mov.w @er0+, @er0+ ; copying word_src to word_dst
  1316. test_h_gr32 word_src+4 er0
  1317. cmp.w @word_src, @word_dst
  1318. beq .Lnext67
  1319. fail
  1320. .Lnext67:
  1321. ;; Now clear the destination location, and verify that.
  1322. mov.w #0, @word_dst
  1323. cmp.b @word_src, @word_dst
  1324. bne .Lnext68
  1325. fail
  1326. .Lnext68:
  1327. mov_w_postdec_to_postdec: ; reg post-decrement, memory to memory
  1328. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1329. set_ccr_zero
  1330. ;; mov.w @ers-, @erd-
  1331. mov.l #word_src, er1
  1332. mov.l #word_dst, er0
  1333. mov.w @er1-, @er0-
  1334. ;;; .word 0x0158
  1335. ;;; .word 0xa1a0
  1336. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1337. test_neg_clear
  1338. test_zero_clear
  1339. test_ovf_clear
  1340. test_carry_clear
  1341. ;; Verify the affected registers.
  1342. test_h_gr32 word_dst-2 er0
  1343. test_h_gr32 word_src-2 er1
  1344. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1345. test_gr_a5a5 3
  1346. test_gr_a5a5 4
  1347. test_gr_a5a5 5
  1348. test_gr_a5a5 6
  1349. test_gr_a5a5 7
  1350. ;; Now check the result of the move to memory.
  1351. cmp.w @word_src, @word_dst
  1352. beq .Lnext75
  1353. fail
  1354. .Lnext75:
  1355. ;; Now clear the destination location, and verify that.
  1356. mov.w #0, @word_dst
  1357. cmp.w @word_src, @word_dst
  1358. bne .Lnext76
  1359. fail
  1360. .Lnext76: ; OK, pass on.
  1361. ;; special case same register
  1362. mov.l #word_src, er0
  1363. mov.w @er0-, @er0- ; copying word_src to word_dst_dec
  1364. test_h_gr32 word_src-4 er0
  1365. cmp.w @word_src, @word_dst_dec
  1366. beq .Lnext77
  1367. fail
  1368. .Lnext77:
  1369. ;; Now clear the destination location, and verify that.
  1370. mov.w #0, @word_dst_dec
  1371. cmp.w @word_src, @word_dst_dec
  1372. bne .Lnext78
  1373. fail
  1374. .Lnext78:
  1375. mov_w_preinc_to_preinc: ; reg pre-increment, memory to memory
  1376. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1377. set_ccr_zero
  1378. ;; mov.w @+ers, @+erd
  1379. mov.l #word_src-2, er1
  1380. mov.l #word_dst-2, er0
  1381. mov.w @+er1, @+er0
  1382. ;;; .word 0x0158
  1383. ;;; .word 0x9190
  1384. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1385. test_neg_clear
  1386. test_zero_clear
  1387. test_ovf_clear
  1388. test_carry_clear
  1389. ;; Verify the affected registers.
  1390. test_h_gr32 word_dst er0
  1391. test_h_gr32 word_src er1
  1392. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1393. test_gr_a5a5 3
  1394. test_gr_a5a5 4
  1395. test_gr_a5a5 5
  1396. test_gr_a5a5 6
  1397. test_gr_a5a5 7
  1398. ;; Now check the result of the move to memory.
  1399. cmp.w @word_src, @word_dst
  1400. beq .Lnext85
  1401. fail
  1402. .Lnext85:
  1403. ;; Now clear the destination location, and verify that.
  1404. mov.w #0, @word_dst
  1405. cmp.w @word_src, @word_dst
  1406. bne .Lnext86
  1407. fail
  1408. .Lnext86: ; OK, pass on.
  1409. ;; special case same register
  1410. mov.l #word_src-2, er0
  1411. mov.w @+er0, @+er0 ; copying word_src to word_dst
  1412. test_h_gr32 word_src+2 er0
  1413. cmp.w @word_src, @word_dst
  1414. beq .Lnext87
  1415. fail
  1416. .Lnext87:
  1417. ;; Now clear the destination location, and verify that.
  1418. mov.w #0, @word_dst
  1419. cmp.w @word_src, @word_dst
  1420. bne .Lnext88
  1421. fail
  1422. .Lnext88:
  1423. mov_w_predec_to_predec: ; reg pre-decrement, memory to memory
  1424. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1425. set_ccr_zero
  1426. ;; mov.w @-ers, @-erd
  1427. mov.l #word_src+2, er1
  1428. mov.l #word_dst+2, er0
  1429. mov.w @-er1, @-er0
  1430. ;;; .word 0x0158
  1431. ;;; .word 0xb1b0
  1432. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1433. test_neg_clear
  1434. test_zero_clear
  1435. test_ovf_clear
  1436. test_carry_clear
  1437. ;; Verify the affected registers.
  1438. test_h_gr32 word_dst er0
  1439. test_h_gr32 word_src er1
  1440. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1441. test_gr_a5a5 3
  1442. test_gr_a5a5 4
  1443. test_gr_a5a5 5
  1444. test_gr_a5a5 6
  1445. test_gr_a5a5 7
  1446. ;; Now check the result of the move to memory.
  1447. cmp.w @word_src, @word_dst
  1448. beq .Lnext95
  1449. fail
  1450. .Lnext95:
  1451. ;; Now clear the destination location, and verify that.
  1452. mov.w #0, @word_dst
  1453. cmp.w @word_src, @word_dst
  1454. bne .Lnext96
  1455. fail
  1456. .Lnext96: ; OK, pass on.
  1457. ;; special case same register
  1458. mov.l #word_src+2, er0
  1459. mov.w @-er0, @-er0 ; copying word_src to word_dst_dec
  1460. test_h_gr32 word_src-2 er0
  1461. cmp.w @word_src, @word_dst_dec
  1462. beq .Lnext97
  1463. fail
  1464. .Lnext97:
  1465. ;; Now clear the destination location, and verify that.
  1466. mov.w #0, @word_dst_dec
  1467. cmp.w @word_src, @word_dst_dec
  1468. bne .Lnext98
  1469. fail
  1470. .Lnext98:
  1471. mov_w_disp2_to_disp2: ; reg 2-bit disp, memory to memory
  1472. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1473. set_ccr_zero
  1474. ;; mov.w @(dd:2, ers), @(dd:2, erd)
  1475. mov.l #word_src-2, er1
  1476. mov.l #word_dst-4, er0
  1477. mov.w @(2:2, er1), @(4:2, er0)
  1478. ;;; .word 0x0158
  1479. ;;; .word 0x1120
  1480. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1481. test_neg_clear
  1482. test_zero_clear
  1483. test_ovf_clear
  1484. test_carry_clear
  1485. ;; Verify the affected registers.
  1486. test_h_gr32 word_dst-4 er0
  1487. test_h_gr32 word_src-2 er1
  1488. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1489. test_gr_a5a5 3
  1490. test_gr_a5a5 4
  1491. test_gr_a5a5 5
  1492. test_gr_a5a5 6
  1493. test_gr_a5a5 7
  1494. ;; Now check the result of the move to memory.
  1495. cmp.w @word_src, @word_dst
  1496. beq .Lnext105
  1497. fail
  1498. .Lnext105:
  1499. ;; Now clear the destination location, and verify that.
  1500. mov.w #0, @word_dst
  1501. cmp.w @word_src, @word_dst
  1502. bne .Lnext106
  1503. fail
  1504. .Lnext106: ; OK, pass on.
  1505. mov_w_disp16_to_disp16: ; reg 16-bit disp, memory to memory
  1506. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1507. set_ccr_zero
  1508. ;; mov.w @(dd:16, ers), @(dd:16, erd)
  1509. mov.l #word_src-1, er1
  1510. mov.l #word_dst-2, er0
  1511. mov.w @(1:16, er1), @(2:16, er0)
  1512. ;;; .word 0x0158
  1513. ;;; .word 0xc1c0
  1514. ;;; .word 0x0001
  1515. ;;; .word 0x0002
  1516. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1517. test_neg_clear
  1518. test_zero_clear
  1519. test_ovf_clear
  1520. test_carry_clear
  1521. ;; Verify the affected registers.
  1522. test_h_gr32 word_dst-2 er0
  1523. test_h_gr32 word_src-1 er1
  1524. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1525. test_gr_a5a5 3
  1526. test_gr_a5a5 4
  1527. test_gr_a5a5 5
  1528. test_gr_a5a5 6
  1529. test_gr_a5a5 7
  1530. ;; Now check the result of the move to memory.
  1531. cmp.w @word_src, @word_dst
  1532. beq .Lnext115
  1533. fail
  1534. .Lnext115:
  1535. ;; Now clear the destination location, and verify that.
  1536. mov.w #0, @word_dst
  1537. cmp.w @word_src, @word_dst
  1538. bne .Lnext116
  1539. fail
  1540. .Lnext116: ; OK, pass on.
  1541. mov_w_disp32_to_disp32: ; reg 32-bit disp, memory to memory
  1542. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1543. set_ccr_zero
  1544. ;; mov.w @(dd:32, ers), @(dd:32, erd)
  1545. mov.l #word_src-1, er1
  1546. mov.l #word_dst-2, er0
  1547. mov.w @(1:32, er1), @(2:32, er0)
  1548. ;;; .word 0x0158
  1549. ;;; .word 0xc9c8
  1550. ;;; .long 1
  1551. ;;; .long 2
  1552. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1553. test_neg_clear
  1554. test_zero_clear
  1555. test_ovf_clear
  1556. test_carry_clear
  1557. ;; Verify the affected registers.
  1558. test_h_gr32 word_dst-2 er0
  1559. test_h_gr32 word_src-1 er1
  1560. test_gr_a5a5 2 ; Make sure other general regs not disturbed
  1561. test_gr_a5a5 3
  1562. test_gr_a5a5 4
  1563. test_gr_a5a5 5
  1564. test_gr_a5a5 6
  1565. test_gr_a5a5 7
  1566. ;; Now check the result of the move to memory.
  1567. cmp.w @word_src, @word_dst
  1568. beq .Lnext125
  1569. fail
  1570. .Lnext125:
  1571. ;; Now clear the destination location, and verify that.
  1572. mov.w #0, @word_dst
  1573. cmp.w @word_src, @word_dst
  1574. bne .Lnext126
  1575. fail
  1576. .Lnext126: ; OK, pass on.
  1577. mov_w_abs16_to_abs16: ; 16-bit absolute addr, memory to memory
  1578. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1579. set_ccr_zero
  1580. ;; mov.w @aa:16, @aa:16
  1581. mov.w @word_src:16, @word_dst:16
  1582. ;;; .word 0x0158
  1583. ;;; .word 0x4040
  1584. ;;; .word @word_src
  1585. ;;; .word @word_dst
  1586. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1587. test_neg_clear
  1588. test_zero_clear
  1589. test_ovf_clear
  1590. test_carry_clear
  1591. test_gr_a5a5 0 ; Make sure *NO* general registers are changed
  1592. test_gr_a5a5 1
  1593. test_gr_a5a5 2
  1594. test_gr_a5a5 3
  1595. test_gr_a5a5 4
  1596. test_gr_a5a5 5
  1597. test_gr_a5a5 6
  1598. test_gr_a5a5 7
  1599. ;; Now check the result of the move to memory.
  1600. cmp.w @word_src, @word_dst
  1601. beq .Lnext135
  1602. fail
  1603. .Lnext135:
  1604. ;; Now clear the destination location, and verify that.
  1605. mov.w #0, @word_dst
  1606. cmp.w @word_src, @word_dst
  1607. bne .Lnext136
  1608. fail
  1609. .Lnext136: ; OK, pass on.
  1610. mov_w_abs32_to_abs32: ; 32-bit absolute addr, memory to memory
  1611. set_grs_a5a5 ; Fill all general regs with a fixed pattern
  1612. set_ccr_zero
  1613. ;; mov.w @aa:32, @aa:32
  1614. mov.w @word_src:32, @word_dst:32
  1615. ;;; .word 0x0158
  1616. ;;; .word 0x4848
  1617. ;;; .long @word_src
  1618. ;;; .long @word_dst
  1619. ;; test ccr ; H=0 N=0 Z=0 V=0 C=0
  1620. test_neg_clear
  1621. test_zero_clear
  1622. test_ovf_clear
  1623. test_carry_clear
  1624. test_gr_a5a5 0 ; Make sure *NO* general registers are changed
  1625. test_gr_a5a5 1
  1626. test_gr_a5a5 2
  1627. test_gr_a5a5 3
  1628. test_gr_a5a5 4
  1629. test_gr_a5a5 5
  1630. test_gr_a5a5 6
  1631. test_gr_a5a5 7
  1632. ;; Now check the result of the move to memory.
  1633. cmp.w @word_src, @word_dst
  1634. beq .Lnext145
  1635. fail
  1636. .Lnext145:
  1637. ;; Now clear the destination location, and verify that.
  1638. mov.w #0, @word_dst
  1639. cmp.w @word_src, @word_dst
  1640. bne .Lnext146
  1641. fail
  1642. .Lnext146: ; OK, pass on.
  1643. .endif
  1644. pass
  1645. exit 0