movl.s 47 KB

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