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