X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=dsp56k_amode.c;h=bd701ec1c926ed1c4fa3bda15ab35415d88e95a1;hb=5559ac02922836380db93969986836bb004c8b37;hp=161fec99c824a5cc82471c7afa4b6a090c1092e4;hpb=185ee7af01042a4c1cfff64c72c849f2b0448e6c;p=rmac diff --git a/dsp56k_amode.c b/dsp56k_amode.c index 161fec9..bd701ec 100644 --- a/dsp56k_amode.c +++ b/dsp56k_amode.c @@ -1062,7 +1062,7 @@ static inline LONG check_x_y(LONG ea1, LONG S1) if (K_D1 == K_D2) return error("unrecognised X:Y: parallel move syntax: D1 and D2 cannot be the same in 'X:ea,D1 Y:eay,D2'"); - inst = B16(11000000, 00000000) | w; + inst = 0b1100000000000000 | w; inst |= ea1 | D1 | ea2 | D2; return inst; } @@ -1148,7 +1148,7 @@ static inline LONG check_x_y(LONG ea1, LONG S1) ea2 |= eay_temp; //OR eay back from temp - inst = B16(10000000, 00000000) | w; + inst = 0b1000000000000000 | w; inst |= (ea1 & 0x1f) | D1 | S2 | ea2; return inst; } @@ -1210,10 +1210,10 @@ x_checkea_right: if (ea1 == -1) return error("unrecognised X:R parallel move syntax: absolute address not allowed in 'a,X:ea x0,a'"); - if (ea1 == B8(00110100)) + if (ea1 == 0b00110100) return error("unrecognised X:R parallel move syntax: immediate data not allowed in 'a,X:ea x0,a'"); - inst = B16(00001000, 00000000) | ea1 | (0 << 8); + inst = 0b0000100000000000 | ea1 | (0 << 8); return inst; } else if (*tok == KW_X0 && tok[1] == ',' && tok[2] == KW_B) @@ -1228,10 +1228,10 @@ x_checkea_right: if (ea1 == -1) return error("unrecognised X:R parallel move syntax: absolute address not allowed in 'b,X:ea x0,b'"); - if (ea1 == B8(00110100)) + if (ea1 == 0b00110100) return error("unrecognised X:R parallel move syntax: immediate data not allowed in 'b,X:ea x0,b'"); - inst = B16(00001001, 00000000) | ea1 | (1 << 8); + inst = 0b0000100100000000 | ea1 | (1 << 8); return inst; } else if (*tok == KW_A || *tok == KW_B) @@ -1276,7 +1276,7 @@ x_checkea_right: if (*tok != EOL) return error("unrecognised X:R parallel move syntax: unexpected text after 'X:eax,D1 S2,S2'"); - inst = B16(00010000, 00000000) | (0 << 7); + inst = 0b0001000000000000 | (0 << 7); inst |= ea1 | D1 | S2 | D2; return inst; } @@ -1363,7 +1363,7 @@ x_check_immed: if (*tok == EOL) { // 'X:ea,D' - inst = inst | B8(01000000) | (1 << 7); + inst = inst | 0b01000000 | (1 << 7); inst |= ((D1 & 0x18) << (12 - 3)) + ((D1 & 7) << 8); inst |= ea1; @@ -1389,7 +1389,7 @@ x_check_immed: if (*tok != EOL) return error("unrecognised X:R parallel move syntax: expected EOL after X:ea,D1 S2,D2"); - inst = B16(00010000, 00000000) | (1 << 7); + inst = 0b0001000000000000 | (1 << 7); inst |= ((D1 & 0x8) << (12 - 4)) + ((D1 & 1) << 10); inst |= (S2 & 1) << 9; inst |= (D2 & 1) << 8; @@ -1411,7 +1411,7 @@ x_check_immed: if (*tok == EOL) { // 'S,X:ea' - inst = inst | B8(01000000) | (0 << 7); + inst = inst | 0b01000000 | (0 << 7); inst |= ((S1 & 0x18) << (12 - 3)) + ((S1 & 7) << 8); inst |= ea1; @@ -1485,7 +1485,7 @@ x_gotea1: //'X:ea,D' D1 = SDreg(*tok++); - inst = inst | B8(01000000) | (1 << 7); + inst = inst | 0b01000000 | (1 << 7); inst |= ea1; inst |= ((D1 & 0x18) << (12 - 3)) + ((D1 & 7) << 8); return inst; @@ -1496,7 +1496,7 @@ x_gotea1: if (*tok == EOL) { //'S,X:ea' - inst = inst | B8(01000000) | (0 << 7); + inst = inst | 0b01000000 | (0 << 7); inst |= ea1; inst |= ((S1 & 0x18) << (12 - 3)) + ((S1 & 7) << 8); return inst; @@ -1542,7 +1542,7 @@ x_gotea1: if (*tok != EOL) return error("unrecognised X:R parallel move syntax: unexpected text after 'X:eax,D1 S2,S2'"); - inst = B16(00010000, 00000000) | (W << 7); + inst = 0b0001000000000000 | (W << 7); inst |= ea1 | D1 | S2 | D2; return inst; } @@ -1691,7 +1691,7 @@ static inline LONG parse_y(LONG inst, LONG S1, LONG D1, LONG S2) if (*tok == EOL && S1 != 0) { // 'S,Y:aa' - inst = B16(01001000, 00000000); + inst = 0b0100100000000000; inst |= dspImmedEXVAL; inst |= ((S1 & 0x18) << (12 - 3)) + ((S1 & 7) << 8); return inst; @@ -1712,7 +1712,7 @@ static inline LONG parse_y(LONG inst, LONG S1, LONG D1, LONG S2) if (*tok == EOL && S1 != 0) { // 'S,Y:ea' - inst = B16(01001000, 01110000); + inst = 0b0100100001110000; inst |= ea1; inst |= ((S1 & 0x18) << (12 - 3)) + ((S1 & 7) << 8); if (ea1 == DSP_EA_ABS) @@ -1733,7 +1733,7 @@ static inline LONG parse_y(LONG inst, LONG S1, LONG D1, LONG S2) if (*tok != EOL) return error("unrecognised Y: parallel move syntax: expected EOL after 'Y:ea,D'"); - inst |= B16(00000000, 01110000); + inst |= 0b0000000001110000; inst |= ea1; inst |= ((D1 & 0x18) << (12 - 3)) + ((D1 & 7) << 8); if (ea1 == DSP_EA_ABS) @@ -1811,7 +1811,7 @@ static inline LONG parse_y(LONG inst, LONG S1, LONG D1, LONG S2) if (S1 != 0 && *tok == EOL) { // 'S,Y:ea' - inst = B16(01001000, 01000000); + inst = 0b0100100001000000; inst |= ea1; inst |= ((S1 & 0x18) << (12 - 3)) + ((S1 & 7) << 8); return inst; @@ -1845,7 +1845,7 @@ static inline LONG parse_y(LONG inst, LONG S1, LONG D1, LONG S2) default: return error("unrecognised R:Y parallel move syntax: D2 can only be y0, y1, a or b after 'S1,D1 Y:ea'"); } - inst = B16(00010000, 11000000); + inst = 0b0001000011000000; inst |= S1 | D1 | D2; inst |= ea1; return inst; @@ -1861,7 +1861,7 @@ static inline LONG parse_y(LONG inst, LONG S1, LONG D1, LONG S2) { //'Y:ea,D' D1 = SDreg(*tok++); - inst |= B16(00000000, 01000000); + inst |= 0b0000000001000000; inst |= ea1; inst |= ((D1 & 0x18) << (12 - 3)) + ((D1 & 7) << 8); return inst; @@ -2027,7 +2027,7 @@ static inline LONG parse_l(const int W, LONG inst, LONG S1) else S1 &= 7; - inst = B16(01000000, 00000000); + inst = 0b0100000000000000; inst |= dspImmedEXVAL; inst |= ((S1 & 0x4) << (11 - 2)) + ((S1 & 3) << 8); return inst; @@ -2045,7 +2045,7 @@ static inline LONG parse_l(const int W, LONG inst, LONG S1) if (ea1 == DSP_EA_ABS) deposit_extra_ea = DEPOSIT_EXTRA_WORD; - inst |= B16(01000000, 01110000); + inst |= 0b0100000001110000; inst |= ((S1 & 0x4) << (11 - 2)) + ((S1 & 3) << 8); inst |= ea1; return inst; @@ -2076,7 +2076,7 @@ static inline LONG parse_l(const int W, LONG inst, LONG S1) if (*tok != EOL) return error("unrecognised L: parallel move syntax: expected End-Of-Line after L:aa,D"); - inst &= B16(11111111, 10111111); + inst &= 0b1111111110111111; inst |= dspImmedEXVAL; inst |= ((immreg & 0x4) << (11 - 2)) + ((immreg & 3) << 8); return inst; @@ -2103,7 +2103,7 @@ static inline LONG parse_l(const int W, LONG inst, LONG S1) if (*tok != EOL) return error("unrecognised L: parallel move syntax: expected End-Of-Line after L:ea,D"); - inst |= B16(00000000, 00110000); + inst |= 0b0000000000110000; inst |= ((D1 & 0x4) << (11 - 2)) + ((D1 & 3) << 8); return inst; } @@ -2143,7 +2143,7 @@ static inline LONG parse_l(const int W, LONG inst, LONG S1) if (*tok == EOL) { // 'S,L:ea' - inst = B16(01000000, 01000000); + inst = 0b0100000001000000; if (S1 == KW_A) S1 = 4; @@ -2510,7 +2510,7 @@ LONG parmoves(WORD dest) if (*tok == EOL) { // No parallel move - return B16(00100000, 00000000); + return 0b0010000000000000; } if (*tok == '#') @@ -2572,7 +2572,7 @@ LONG parmoves(WORD dest) { // '#xx,D' // value fits in 8 bits - immediate move - inst = B16(00100000, 00000000) + (immreg << 8) + (uint32_t)dspImmedEXVAL; + inst = 0b0010000000000000 + (immreg << 8) + (uint32_t)dspImmedEXVAL; return inst; } else @@ -2597,7 +2597,7 @@ LONG parmoves(WORD dest) // X or Y Data move. I don't think it matters much // which of the two it will be, so let's use X. deposit_immediate_long_with_register: - inst = B16(01000000, 11110100); + inst = 0b0100000011110100; inst |= ((immreg & 0x18) << (12 - 3)) + ((immreg & 7) << 8); deposit_extra_ea = DEPOSIT_EXTRA_WORD; return inst; @@ -2607,7 +2607,7 @@ deposit_immediate_long_with_register: { // value fits in 8 bits - immediate move deposit_immediate_short_with_register: - inst = B16(00100000, 00000000) + (immreg << 8) + (uint32_t)dspImmedEXVAL; + inst = 0b0010000000000000 + (immreg << 8) + (uint32_t)dspImmedEXVAL; return inst; } else @@ -2632,7 +2632,7 @@ deposit_immediate_short_with_register: // '#xx,D' - I mode // No visibility of the number so let's add a fixup for this AddFixup(FU_DSPIMM8, sloc, dspImmedEXPR); - inst = B16(00100000, 00000000); + inst = 0b0010000000000000; inst |= ((immreg & 0x18) << (11 - 3)) + ((immreg & 7) << 8); return inst; } @@ -2703,7 +2703,7 @@ deposit_immediate_short_with_register: { // Just deposit a float fixup AddFixup(FU_DSPIMMFL8, sloc, dspImmedEXPR); - inst = B16(00100000, 00000000); + inst = 0b0010000000000000; inst |= ((immreg & 0x18) << (12 - 3)) + ((immreg & 7) << 8); return inst; } @@ -2742,7 +2742,7 @@ deposit_immediate_short_with_register: if (*tok != EOL) return error("unrecognised X:R parallel move syntax: expected end-of-line after '#xxxxxx,D1 S2,D2'"); - inst = B16(00010000, 10110100) | D1 | S2 | D2; + inst = 0b0001000010110100 | D1 | S2 | D2; deposit_extra_ea = DEPOSIT_EXTRA_WORD; return inst; } @@ -2759,7 +2759,7 @@ deposit_immediate_short_with_register: return error("expected ':' after 'X' in parallel move (i.e. X:)"); // 'X:ea,D' or 'X:aa,D' or 'X:ea,D1 S2,D2' or 'X:eax,D1 Y:eay,D2' or 'X:eax,D1 S2,Y:eay' - return parse_x(1, B16(01000000, 00000000), 0, 1); + return parse_x(1, 0b0100000000000000, 0, 1); } else if (*tok == KW_Y) { @@ -2773,7 +2773,7 @@ deposit_immediate_short_with_register: return error("expected ':' after 'Y' in parallel move (i.e. Y:)"); // 'Y:ea,D' or 'Y:aa,D' - return parse_y(B16(01001000, 10000000), 0, 0, 0); + return parse_y(0b0100100010000000, 0, 0, 0); } else if (*tok == KW_L) { @@ -2782,7 +2782,7 @@ deposit_immediate_short_with_register: if (*tok++ != ':') return error("expected ':' after 'L' in parallel move (i.e. L:)"); - return parse_l(1, B16(01000000, 11000000), 0); + return parse_l(1, 0b0100000011000000, 0); } else if ((*tok >= KW_X0 && *tok <= KW_N7) || (*tok >= KW_R0 && *tok <= KW_R7) || (*tok >= KW_A0 && *tok <= KW_A2) || (*tok >= KW_A10 && *tok <= KW_BA)) { @@ -2810,7 +2810,7 @@ parse_everything_else: if (*tok++ != ':') return error("unrecognised X: parallel move syntax: expected ':' after 'S,X'"); - return parse_x(0, B16(01000000, 00000000), S1, 1); + return parse_x(0, 0b0100000000000000, S1, 1); } else if (*tok == KW_Y) { @@ -2820,7 +2820,7 @@ parse_everything_else: if (*tok++ != ':') return error("unrecognised Y: parallel move syntax: expected ':' after 'S,Y'"); - return parse_y(B16(0000000, 00000000), S1, 0, 0); + return parse_y(0b000000000000000, S1, 0, 0); } else if (*tok == KW_L) { @@ -2830,7 +2830,7 @@ parse_everything_else: if (*tok++ != ':') return error("unrecognised L: parallel move syntax: expected ':' after 'S,L'"); - return parse_l(1, B16(00000000, 00000000), L_S1); + return parse_l(1, 0b0000000000000000, L_S1); } else if ((*tok >= KW_X0 && *tok <= KW_N7) || (*tok >= KW_R0 && *tok <= KW_R7) || (*tok >= KW_A0 && *tok <= KW_A2)) { @@ -2842,7 +2842,7 @@ parse_everything_else: if (*tok == EOL) { // R 'S,D' - inst = B16(00100000, 00000000); + inst = 0b0010000000000000; inst |= (S1 << 5) | (D1); return inst; } @@ -2852,7 +2852,7 @@ parse_everything_else: tok++; if (*tok++ != ':') return error("expected ':' after 'Y' in parallel move (i.e. Y:)"); - return parse_y(B16(00010000, 01000000), S1, D1, 0); + return parse_y(0b0001000001000000, S1, D1, 0); } else if (*tok == KW_A || *tok == KW_B || *tok == KW_Y0 || *tok == KW_Y1) @@ -2877,7 +2877,7 @@ parse_everything_else: if (ea1 == ERROR) return ERROR; - inst = B16(00001000, 10000000); + inst = 0b0000100010000000; inst |= 0 << 8; inst |= ea1; return inst; @@ -2899,7 +2899,7 @@ parse_everything_else: if (ea1 == ERROR) return ERROR; - inst = B16(00001000, 10000000); + inst = 0b0000100010000000; inst |= 1 << 8; inst |= ea1; return inst; @@ -2921,7 +2921,7 @@ parse_everything_else: if (ea1 == ERROR) return ERROR; - inst = B16(00010000, 01000000); + inst = 0b0001000001000000; inst |= (S1 & 1) << 11; inst |= (D1 & 1) << 10; inst |= ((S2 & 8) << (10 - 4)) | ((S2 & 1) << 8); @@ -2970,7 +2970,7 @@ parse_everything_else: { if (D1 == 4 || D1 == 5) { - inst = B16(00010000, 11110100); + inst = 0b0001000011110100; inst |= (S1 & 1) << 11; inst |= (D1 & 1) << 10; inst |= D2; @@ -3049,7 +3049,7 @@ parse_everything_else: } } - inst = B16(00100000, 01000000); + inst = 0b0010000001000000; inst |= ea1; return inst; }