trunk/src/emu/cpu/arcompact/arcompactdasm_ops.c
| r242420 | r242421 | |
| 195 | 195 | |
| 196 | 196 | |
| 197 | 197 | |
| 198 | | int arcompact_01_01_00_helper(char *output, offs_t pc, UINT32 op, const UINT8* oprom, const char* optext) |
| 199 | | { |
| 200 | | int size = 4; |
| 201 | | |
| 202 | | // Branch on Compare / Bit Test - Register-Register |
| 203 | | // 00001 bbb sssssss 1 S BBB CCCCCC N 0 iiii |
| 204 | | INT32 address = (op & 0x00fe0000) >> 17; |
| 205 | | address |= ((op & 0x00008000) >> 15) << 7; |
| 206 | | if (address & 0x80) address = -(address & 0x7f); |
| 207 | | |
| 208 | | int c = (op & 0x00000fc0) >> 6; |
| 209 | | int b = (op & 0x07000000) >> 24; |
| 210 | | b |= ((op & 0x00007000) >> 12) << 3; |
| 211 | | int n = (op & 0x00000020) >> 5; op &= ~0x00000020; |
| 212 | | |
| 213 | | op &= ~0x07007fe0; |
| 214 | | |
| 215 | | if ((b != LIMM_REG) && (c != LIMM_REG)) |
| 216 | | { |
| 217 | | print("%s%s (r%d) (r%d) %08x (%08x)", optext, delaybit[n], b, c, pc + (address * 2) + 4, op & ~0xf8fe800f); |
| 218 | | } |
| 219 | | else |
| 220 | | { |
| 221 | | UINT32 limm; |
| 222 | | GET_LIMM_32; |
| 223 | | size = 8; |
| 224 | | |
| 225 | | if ((b == LIMM_REG) && (c != LIMM_REG)) |
| 226 | | { |
| 227 | | print("%s%s (%08x) (r%d) %08x (%08x)", optext, delaybit[n], limm, c, pc + (address * 2) + 4, op & ~0xf8fe800f); |
| 228 | | } |
| 229 | | else if ((c == LIMM_REG) && (b != LIMM_REG)) |
| 230 | | { |
| 231 | | print("%s%s (r%d) (%08x) %08x (%08x)", optext, delaybit[n], b, limm, pc + (address * 2) + 4, op & ~0xf8fe800f); |
| 232 | | } |
| 233 | | else |
| 234 | | { |
| 235 | | // b and c are LIMM? invalid?? |
| 236 | | print("%s%s (%08x) (%08x) (illegal?) %08x (%08x)", optext, delaybit[n], limm, limm, pc + (address * 2) + 4, op & ~0xf8fe800f); |
| 237 | | |
| 238 | | } |
| 239 | | } |
| 240 | | |
| 241 | | return size; |
| 242 | | } |
| 243 | | |
| 244 | 198 | #define GET_01_01_01_BRANCH_ADDR \ |
| 245 | 199 | INT32 address = (op & 0x00fe0000) >> 17; \ |
| 246 | 200 | address |= ((op & 0x00008000) >> 15) << 7; \ |
| r242420 | r242421 | |
| 251 | 205 | #define GROUP_0e_GET_h \ |
| 252 | 206 | h = ((op & 0x0007) << 3); \ |
| 253 | 207 | h |= ((op & 0x00e0) >> 5); \ |
| 208 | op &= ~0x00e7; \ |
| 254 | 209 | |
| 210 | #define COMMON16_GET_breg \ |
| 211 | breg = ((op & 0x0700) >>8); \ |
| 212 | op &= ~0x0700; \ |
| 213 | |
| 214 | #define COMMON16_GET_creg \ |
| 215 | creg = ((op & 0x00e0) >>5); \ |
| 216 | op &= ~0x00e0; \ |
| 217 | |
| 218 | #define COMMON16_GET_u5 \ |
| 219 | u = ((op & 0x001f) >>0); \ |
| 220 | op &= ~0x001f; \ |
| 221 | |
| 222 | #define COMMON16_GET_u8 \ |
| 223 | u = ((op & 0x00ff) >>0); \ |
| 224 | op &= ~0x00ff; \ |
| 225 | |
| 226 | #define COMMON16_GET_u7 \ |
| 227 | u = ((op & 0x007f) >>0); \ |
| 228 | op &= ~0x007f; \ |
| 229 | |
| 230 | // registers used in 16-bit opcodes hae a limited range |
| 231 | // and can only address registers r0-r3 and r12-r15 |
| 232 | |
| 233 | #define REG_16BIT_RANGE(_reg_) \ |
| 234 | if (_reg_>3) _reg_+= 8; \ |
| 235 | |
| 236 | |
| 255 | 237 | // this is as messed up as the rest of the 16-bit alignment in LE mode... |
| 256 | 238 | |
| 257 | 239 | #define GET_LIMM \ |
| r242420 | r242421 | |
| 269 | 251 | { |
| 270 | 252 | int size = 4; |
| 271 | 253 | // Branch Conditionally |
| 272 | | // 00000 ssssssssss 0 SSSSSSSSSS N QQQQQ |
| 254 | // 0000 0sss ssss sss0 SSSS SSSS SSNQ QQQQ |
| 273 | 255 | INT32 address = (op & 0x07fe0000) >> 17; |
| 274 | 256 | address |= ((op & 0x0000ffc0) >> 6) << 10; |
| 275 | 257 | if (address & 0x800000) address = -(address & 0x7fffff); |
| r242420 | r242421 | |
| 284 | 266 | { |
| 285 | 267 | int size = 4; |
| 286 | 268 | // Branch Unconditionally Far |
| 287 | | // 00000 ssssssssss 1 SSSSSSSSSS N R TTTT |
| 269 | // 0000 0sss ssss sss1 SSSS SSSS SSNR TTTT |
| 288 | 270 | INT32 address = (op & 0x07fe0000) >> 17; |
| 289 | 271 | address |= ((op & 0x0000ffc0) >> 6) << 10; |
| 290 | 272 | address |= ((op & 0x0000000f) >> 0) << 20; |
| r242420 | r242421 | |
| 333 | 315 | return size; |
| 334 | 316 | } |
| 335 | 317 | |
| 336 | | int arcompact_handle01_01_00_00_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BREQ b - c"); } |
| 337 | | int arcompact_handle01_01_00_01_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BRNE b - c"); } |
| 338 | | int arcompact_handle01_01_00_02_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BRLT b - c"); } |
| 339 | | int arcompact_handle01_01_00_03_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BRGE b - c"); } |
| 340 | | int arcompact_handle01_01_00_04_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BRLO b - c"); } |
| 341 | | int arcompact_handle01_01_00_05_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BRHS b - c"); } |
| 342 | | int arcompact_handle01_01_00_0e_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BBIT0 (b & 1<<c) == 0"); } |
| 343 | | int arcompact_handle01_01_00_0f_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BBIT1 (b & 1<<c) != 0"); } |
| 344 | 318 | |
| 345 | 319 | |
| 346 | | int arcompact_handle01_01_01_00_dasm(DASM_OPS_32) { GET_01_01_01_BRANCH_ADDR; print("BREQ b - u6 (dst %08x) (%08x)", pc + (address * 2) + 4, op); return 4; } |
| 347 | | int arcompact_handle01_01_01_01_dasm(DASM_OPS_32) { GET_01_01_01_BRANCH_ADDR; print("BRNE b - u6 (dst %08x) (%08x)", pc + (address * 2) + 4, op); return 4; } |
| 348 | | int arcompact_handle01_01_01_02_dasm(DASM_OPS_32) { GET_01_01_01_BRANCH_ADDR; print("BRLT b - u6 (dst %08x) (%08x)", pc + (address * 2) + 4, op); return 4; } |
| 349 | | int arcompact_handle01_01_01_03_dasm(DASM_OPS_32) { GET_01_01_01_BRANCH_ADDR; print("BRGE b - u6 (dst %08x) (%08x)", pc + (address * 2) + 4, op); return 4; } |
| 350 | | int arcompact_handle01_01_01_04_dasm(DASM_OPS_32) { GET_01_01_01_BRANCH_ADDR; print("BRLO b - u6 (dst %08x) (%08x)", pc + (address * 2) + 4, op); return 4; } |
| 351 | | int arcompact_handle01_01_01_05_dasm(DASM_OPS_32) { GET_01_01_01_BRANCH_ADDR; print("BRHS b - u6 (dst %08x) (%08x)", pc + (address * 2) + 4, op); return 4; } |
| 320 | int arcompact_01_01_00_helper(char *output, offs_t pc, UINT32 op, const UINT8* oprom, const char* optext) |
| 321 | { |
| 322 | int size = 4; |
| 352 | 323 | |
| 324 | // Branch on Compare / Bit Test - Register-Register |
| 325 | // 00001 bbb sssssss 1 S BBB CCCCCC N 0 iiii |
| 326 | GET_01_01_01_BRANCH_ADDR |
| 353 | 327 | |
| 354 | | int arcompact_handle01_01_01_0e_dasm(DASM_OPS_32) { GET_01_01_01_BRANCH_ADDR; print("BBIT0 (b & 1<<u6) == 0 (dst %08x) (%08x)", pc + (address * 2) + 4, op); return 4; } |
| 355 | | int arcompact_handle01_01_01_0f_dasm(DASM_OPS_32) { GET_01_01_01_BRANCH_ADDR; print("BBIT1 (b & 1<<u6) != 0 (dst %08x) (%08x)", pc + (address * 2) + 4, op); return 4; } |
| 356 | 328 | |
| 329 | int c = (op & 0x00000fc0) >> 6; |
| 330 | int b = (op & 0x07000000) >> 24; |
| 331 | b |= ((op & 0x00007000) >> 12) << 3; |
| 332 | int n = (op & 0x00000020) >> 5; op &= ~0x00000020; |
| 357 | 333 | |
| 334 | op &= ~0x07007fe0; |
| 335 | |
| 336 | if ((b != LIMM_REG) && (c != LIMM_REG)) |
| 337 | { |
| 338 | print("%s%s %s %s %08x (%08x)", optext, delaybit[n], regnames[b], regnames[c], pc + (address * 2) + 4, op & ~0xf8fe800f); |
| 339 | } |
| 340 | else |
| 341 | { |
| 342 | UINT32 limm; |
| 343 | GET_LIMM_32; |
| 344 | size = 8; |
| 345 | |
| 346 | if ((b == LIMM_REG) && (c != LIMM_REG)) |
| 347 | { |
| 348 | print("%s%s (%08x) %s %08x (%08x)", optext, delaybit[n], limm, regnames[b], pc + (address * 2) + 4, op & ~0xf8fe800f); |
| 349 | } |
| 350 | else if ((c == LIMM_REG) && (b != LIMM_REG)) |
| 351 | { |
| 352 | print("%s%s %s (%08x) %08x (%08x)", optext, delaybit[n], regnames[b], limm, pc + (address * 2) + 4, op & ~0xf8fe800f); |
| 353 | } |
| 354 | else |
| 355 | { |
| 356 | // b and c are LIMM? invalid?? |
| 357 | print("%s%s (%08x) (%08x) (illegal?) %08x (%08x)", optext, delaybit[n], limm, limm, pc + (address * 2) + 4, op & ~0xf8fe800f); |
| 358 | |
| 359 | } |
| 360 | } |
| 361 | |
| 362 | return size; |
| 363 | } |
| 364 | |
| 365 | |
| 366 | // register - register cases |
| 367 | int arcompact_handle01_01_00_00_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BREQ"); } |
| 368 | int arcompact_handle01_01_00_01_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BRNE"); } |
| 369 | int arcompact_handle01_01_00_02_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BRLT"); } |
| 370 | int arcompact_handle01_01_00_03_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BRGE"); } |
| 371 | int arcompact_handle01_01_00_04_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BRLO"); } |
| 372 | int arcompact_handle01_01_00_05_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BRHS"); } |
| 373 | int arcompact_handle01_01_00_0e_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BBIT0");} |
| 374 | int arcompact_handle01_01_00_0f_dasm(DASM_OPS_32) { return arcompact_01_01_00_helper( output, pc, op, oprom, "BBIT1");} |
| 375 | |
| 376 | int arcompact_01_01_01_helper(char *output, offs_t pc, UINT32 op, const UINT8* oprom, const char* optext) |
| 377 | { |
| 378 | int size = 4; |
| 379 | |
| 380 | // using 'b' as limm here makes no sense (comparing a long immediate against a short immediate) so I assume it isn't |
| 381 | // valid? |
| 382 | |
| 383 | // Branch on Compare / Bit Test - Register-Immediate |
| 384 | // 0000 1bbb ssss sss1 SBBB uuuu uuN1 iiii |
| 385 | GET_01_01_01_BRANCH_ADDR |
| 386 | |
| 387 | int u = (op & 0x00000fc0) >> 6; |
| 388 | int b = (op & 0x07000000) >> 24; |
| 389 | b |= ((op & 0x00007000) >> 12) << 3; |
| 390 | int n = (op & 0x00000020) >> 5; op &= ~0x00000020; |
| 391 | |
| 392 | op &= ~0x07007fe0; |
| 393 | |
| 394 | print("%s%s %s %02x %08x (%08x)", optext, delaybit[n], regnames[b], u, pc + (address * 2) + 4, op & ~0xf8fe800f); |
| 395 | |
| 396 | return size; |
| 397 | } |
| 398 | |
| 399 | // register -immediate cases |
| 400 | int arcompact_handle01_01_01_00_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(output, pc, op, oprom, "BREQ"); } |
| 401 | int arcompact_handle01_01_01_01_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(output, pc, op, oprom, "BRNE"); } |
| 402 | int arcompact_handle01_01_01_02_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(output, pc, op, oprom, "BRLT"); } |
| 403 | int arcompact_handle01_01_01_03_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(output, pc, op, oprom, "BRGE"); } |
| 404 | int arcompact_handle01_01_01_04_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(output, pc, op, oprom, "BRLO"); } |
| 405 | int arcompact_handle01_01_01_05_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(output, pc, op, oprom, "BRHS"); } |
| 406 | int arcompact_handle01_01_01_0e_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(output, pc, op, oprom, "BBIT0"); } |
| 407 | int arcompact_handle01_01_01_0f_dasm(DASM_OPS_32) { return arcompact_01_01_01_helper(output, pc, op, oprom, "BBIT1"); } |
| 408 | |
| 409 | |
| 358 | 410 | int arcompact_handle02_dasm(DASM_OPS_32) |
| 359 | 411 | { |
| 360 | 412 | // bitpos |
| r242420 | r242421 | |
| 989 | 1041 | |
| 990 | 1042 | |
| 991 | 1043 | |
| 992 | | |
| 993 | | |
| 994 | | |
| 995 | | int arcompact_handle0e_00_dasm(DASM_OPS_16) |
| 1044 | int arcompact_handle0e_0x_helper_dasm(char *output, offs_t pc, UINT16 op, const UINT8* oprom, const char* optext, int revop) |
| 996 | 1045 | { |
| 997 | | int h; |
| 1046 | int h,breg; |
| 998 | 1047 | int size = 2; |
| 999 | 1048 | |
| 1000 | 1049 | GROUP_0e_GET_h; |
| 1001 | | |
| 1050 | COMMON16_GET_breg; |
| 1051 | REG_16BIT_RANGE(breg); |
| 1052 | |
| 1002 | 1053 | if (h == LIMM_REG) |
| 1003 | 1054 | { |
| 1004 | 1055 | UINT32 limm; |
| 1005 | 1056 | GET_LIMM; |
| 1006 | 1057 | size = 6; |
| 1007 | | print("ADD_S b <- b + (%08x) (%04x)", limm, op); |
| 1058 | if (!revop) print("%s %s, (%08x) (%04x)", optext, regnames[breg], limm, op); |
| 1059 | else print("%s (%08x), %s (%04x)", optext, limm, regnames[breg], op); |
| 1008 | 1060 | } |
| 1009 | 1061 | else |
| 1010 | 1062 | { |
| 1063 | if (!revop) print("%s %s, %s (%04x)", optext, regnames[breg], regnames[h], op); |
| 1064 | else print("%s %s, %s (%04x)", optext, regnames[h], regnames[breg], op); |
| 1011 | 1065 | |
| 1012 | | print("ADD_S b <- b + (r%d) (%04x)", h, op); |
| 1013 | 1066 | } |
| 1014 | 1067 | |
| 1015 | 1068 | return size; |
| 1069 | |
| 1016 | 1070 | } |
| 1017 | 1071 | |
| 1072 | int arcompact_handle0e_00_dasm(DASM_OPS_16) |
| 1073 | { |
| 1074 | return arcompact_handle0e_0x_helper_dasm(output, pc, op, oprom, "ADD_S", 0); |
| 1075 | } |
| 1076 | |
| 1018 | 1077 | int arcompact_handle0e_01_dasm(DASM_OPS_16) |
| 1019 | 1078 | { |
| 1020 | | int h; |
| 1021 | | int size = 2; |
| 1022 | | GROUP_0e_GET_h; |
| 1023 | | |
| 1024 | | if (h == LIMM_REG) |
| 1025 | | { |
| 1026 | | UINT32 limm; |
| 1027 | | GET_LIMM; |
| 1028 | | size = 6; |
| 1029 | | print("MOV_S b <- (%08x) (%04x)", limm, op); |
| 1030 | | } |
| 1031 | | else |
| 1032 | | { |
| 1033 | | print("MOV_S b <- (r%d) (%04x)", h, op); |
| 1034 | | } |
| 1035 | | return size; |
| 1079 | return arcompact_handle0e_0x_helper_dasm(output, pc, op, oprom, "MOV_S", 0); |
| 1036 | 1080 | } |
| 1037 | 1081 | |
| 1038 | 1082 | int arcompact_handle0e_02_dasm(DASM_OPS_16) |
| 1039 | 1083 | { |
| 1040 | | int h; |
| 1041 | | int size = 2; |
| 1042 | | GROUP_0e_GET_h; |
| 1043 | | |
| 1044 | | if (h == LIMM_REG) |
| 1045 | | { |
| 1046 | | UINT32 limm; |
| 1047 | | GET_LIMM; |
| 1048 | | size = 6; |
| 1049 | | print("CMP_S b - (%08x) (%04x)", limm, op); |
| 1050 | | } |
| 1051 | | else |
| 1052 | | { |
| 1053 | | print("CMP_S b - (r%d) (%04x)", h, op); |
| 1054 | | } |
| 1055 | | return size; |
| 1084 | return arcompact_handle0e_0x_helper_dasm(output, pc, op, oprom, "CMP_S", 0); |
| 1056 | 1085 | } |
| 1057 | 1086 | |
| 1058 | 1087 | int arcompact_handle0e_03_dasm(DASM_OPS_16) |
| 1059 | 1088 | { |
| 1060 | | int h; |
| 1061 | | int size = 2; |
| 1062 | | GROUP_0e_GET_h; |
| 1063 | | |
| 1064 | | if (h == LIMM_REG) |
| 1065 | | { |
| 1066 | | UINT32 limm; |
| 1067 | | GET_LIMM; |
| 1068 | | size = 6; |
| 1069 | | print("MOV_S (%08x) <- b (%04x)", limm, op); |
| 1070 | | } |
| 1071 | | else |
| 1072 | | { |
| 1073 | | print("MOV_S (r%d) <- b (%04x)", h, op); |
| 1074 | | } |
| 1075 | | |
| 1076 | | return size; |
| 1089 | return arcompact_handle0e_0x_helper_dasm(output, pc, op, oprom, "MOV_S", 1); |
| 1077 | 1090 | } |
| 1078 | 1091 | |
| 1079 | 1092 | |
| r242420 | r242421 | |
| 1134 | 1147 | int arcompact_handle0f_1f_dasm(DASM_OPS_16) { print("BRK_S (%08x)", op); return 2;} |
| 1135 | 1148 | |
| 1136 | 1149 | |
| 1137 | | int arcompact_handle10_dasm(DASM_OPS_16) |
| 1150 | int arcompact_handle_ld_helper_dasm(char *output, offs_t pc, UINT16 op, const UINT8* oprom, const char* optext, int shift, int swap) |
| 1138 | 1151 | { |
| 1139 | | print("LD_S (%04x)", op); |
| 1152 | int breg, creg, u; |
| 1153 | |
| 1154 | COMMON16_GET_breg; |
| 1155 | COMMON16_GET_creg; |
| 1156 | COMMON16_GET_u5; |
| 1157 | |
| 1158 | REG_16BIT_RANGE(breg); |
| 1159 | REG_16BIT_RANGE(creg); |
| 1160 | |
| 1161 | u <<= shift; |
| 1162 | |
| 1163 | if (!swap) print("%s %s, [%s, 0x%02x] (%04x)", optext, regnames[creg], regnames[breg], u, op); |
| 1164 | else print("%s [%s, 0x%02x], %s (%04x)", optext, regnames[breg], u, regnames[creg], op); |
| 1140 | 1165 | return 2; |
| 1166 | |
| 1141 | 1167 | } |
| 1142 | 1168 | |
| 1169 | |
| 1170 | int arcompact_handle10_dasm(DASM_OPS_16) |
| 1171 | { |
| 1172 | return arcompact_handle_ld_helper_dasm(output, pc, op, oprom, "LD_S", 2, 0); |
| 1173 | } |
| 1174 | |
| 1143 | 1175 | int arcompact_handle11_dasm(DASM_OPS_16) |
| 1144 | 1176 | { |
| 1145 | | print("LDB_S (%04x)", op); |
| 1146 | | return 2; |
| 1177 | return arcompact_handle_ld_helper_dasm(output, pc, op, oprom, "LDB_S", 0, 0); |
| 1147 | 1178 | } |
| 1148 | 1179 | |
| 1149 | 1180 | int arcompact_handle12_dasm(DASM_OPS_16) |
| 1150 | 1181 | { |
| 1151 | | print("LDW_S (%04x)", op); |
| 1152 | | return 2; |
| 1182 | return arcompact_handle_ld_helper_dasm(output, pc, op, oprom, "LDW_S", 1, 0); |
| 1153 | 1183 | } |
| 1154 | 1184 | |
| 1155 | 1185 | int arcompact_handle13_dasm(DASM_OPS_16) |
| 1156 | 1186 | { |
| 1157 | | print("LSW_S.X (%04x)", op); |
| 1158 | | return 2; |
| 1187 | return arcompact_handle_ld_helper_dasm(output, pc, op, oprom, "LDW_S.X", 1, 0); |
| 1159 | 1188 | } |
| 1160 | 1189 | |
| 1161 | 1190 | int arcompact_handle14_dasm(DASM_OPS_16) |
| 1162 | 1191 | { |
| 1163 | | print("ST_S (%04x)", op); |
| 1164 | | return 2; |
| 1192 | return arcompact_handle_ld_helper_dasm(output, pc, op, oprom, "ST_S", 2, 1); |
| 1165 | 1193 | } |
| 1166 | 1194 | |
| 1167 | 1195 | int arcompact_handle15_dasm(DASM_OPS_16) |
| 1168 | 1196 | { |
| 1169 | | print("STB_S (%04x)", op); |
| 1170 | | return 2; |
| 1197 | return arcompact_handle_ld_helper_dasm(output, pc, op, oprom, "STB_S", 0, 1); |
| 1171 | 1198 | } |
| 1172 | 1199 | |
| 1173 | 1200 | int arcompact_handle16_dasm(DASM_OPS_16) |
| 1174 | 1201 | { |
| 1175 | | print("STW_S (%04x)", op); |
| 1176 | | return 2; |
| 1202 | return arcompact_handle_ld_helper_dasm(output, pc, op, oprom, "STW_S", 1, 1); |
| 1177 | 1203 | } |
| 1178 | 1204 | |
| 1179 | 1205 | |
| r242420 | r242421 | |
| 1289 | 1315 | // op bits remaining for 0x18_06_xx subgroups 0x0700 |
| 1290 | 1316 | int arcompact_handle18_06_01_dasm(DASM_OPS_16) |
| 1291 | 1317 | { |
| 1292 | | int b = (op & 0x0700) >> 8; |
| 1318 | int breg = (op & 0x0700) >> 8; |
| 1293 | 1319 | op &= ~0x0700; // all bits now used |
| 1320 | REG_16BIT_RANGE(breg) |
| 1294 | 1321 | |
| 1295 | | print("POP_S [%02x]", b); |
| 1322 | print("POP_S %s", regnames[breg]); |
| 1296 | 1323 | |
| 1297 | 1324 | return 2; |
| 1298 | 1325 | } |
| r242420 | r242421 | |
| 1313 | 1340 | // op bits remaining for 0x18_07_xx subgroups 0x0700 |
| 1314 | 1341 | int arcompact_handle18_07_01_dasm(DASM_OPS_16) |
| 1315 | 1342 | { |
| 1316 | | int b = (op & 0x0700) >> 8; |
| 1343 | int breg = (op & 0x0700) >> 8; |
| 1317 | 1344 | op &= ~0x0700; // all bits now used |
| 1345 | REG_16BIT_RANGE(breg) |
| 1318 | 1346 | |
| 1319 | | print("PUSH_S [%02x]", b); |
| 1347 | print("PUSH_S %s", regnames[breg]); |
| 1320 | 1348 | |
| 1321 | 1349 | return 2; |
| 1322 | 1350 | } |
| r242420 | r242421 | |
| 1348 | 1376 | |
| 1349 | 1377 | int arcompact_handle1b_dasm(DASM_OPS_16) |
| 1350 | 1378 | { |
| 1351 | | print("MOV_S (%04x)", op); |
| 1379 | int breg, u; |
| 1380 | COMMON16_GET_breg; |
| 1381 | COMMON16_GET_u8; |
| 1382 | REG_16BIT_RANGE(breg); |
| 1383 | |
| 1384 | print("MOV_S %s, %02x", regnames[breg], u); |
| 1352 | 1385 | return 2; |
| 1353 | 1386 | } |
| 1354 | 1387 | |
| 1355 | | int arcompact_handle1c_00_dasm(DASM_OPS_16) { print("ADD_S b <- b + u7 (%04x)", op); return 2;} |
| 1356 | | int arcompact_handle1c_01_dasm(DASM_OPS_16) { print("CMP_S b - u7 (%04x)", op); return 2;} |
| 1388 | int arcompact_handle1c_00_dasm(DASM_OPS_16) |
| 1389 | { |
| 1390 | int breg, u; |
| 1391 | COMMON16_GET_breg; |
| 1392 | COMMON16_GET_u7; |
| 1393 | REG_16BIT_RANGE(breg); |
| 1357 | 1394 | |
| 1395 | print("ADD_S %s, %02x", regnames[breg], u); |
| 1396 | return 2; |
| 1397 | } |
| 1358 | 1398 | |
| 1399 | int arcompact_handle1c_01_dasm(DASM_OPS_16) |
| 1400 | { |
| 1401 | int breg, u; |
| 1402 | COMMON16_GET_breg; |
| 1403 | COMMON16_GET_u7; |
| 1404 | REG_16BIT_RANGE(breg); |
| 1405 | |
| 1406 | print("CMP_S %s, %02x", regnames[breg], u); |
| 1407 | return 2; |
| 1408 | } |
| 1409 | |
| 1410 | |
| 1359 | 1411 | int arcompact_handle1d_00_dasm(DASM_OPS_16) { print("BREQ_S (%04x)", op); return 2;} |
| 1360 | 1412 | int arcompact_handle1d_01_dasm(DASM_OPS_16) { print("BRNE_S (%04x)", op); return 2;} |
| 1361 | 1413 | |