-
- /*
- * MOV direct, direct (opcode 85h) is peculiar, the operands
- * are inverted
- */
- if (opcode == 0x85) {
- cpu8051_sfr_mem_info(memory_read8(PGM_MEM_ID, address + 1),
- str);
- len += sprintf(&text[len], "%s,", str);
- cpu8051_sfr_mem_info(memory_read8(PGM_MEM_ID, address),
- str);
- len += sprintf(&text[len], "%s", str);
- address += 2;
- return inst_size;
- }
-
- for (i = 1; i <= InstArgTbl[ArgTblOfs]; i++) {
- switch (InstArgTbl[ArgTblOfs + i]) {
- case ADDR11: {
- len += sprintf(&text[len],
- "%.4XH", ((opcode << 3) & 0xF00) +
- (memory_read8(PGM_MEM_ID, address)));
- address++;
- break;
- }
- case ADDR16: {
- len += sprintf(
- &text[len], "%.4XH",
- ((memory_read8(PGM_MEM_ID, address) << 8) +
- memory_read8(PGM_MEM_ID, address + 1)));
- address += 2;
- break;
- }
- case DIRECT: {
- cpu8051_sfr_mem_info(memory_read8(PGM_MEM_ID, address),
- str);
- len += sprintf(&text[len], "%s", str);
- address++;
- break;
- }
- case BITADDR: {
- cpu8051_int_mem_bit_info(
- (memory_read8(PGM_MEM_ID, address) & 0xF8),
- str);
- len += sprintf(&text[len], "%s.%X" , str,
- (memory_read8(PGM_MEM_ID, address) & 7));
- address++;
- break;
- }
- case RELADDR: {
- address++;
- len += sprintf(&text[len], "%.4XH", (address & 0xFF00) +
- (((address & 0xFF) +
- memory_read8(PGM_MEM_ID,
- address - 1)) & 0xFF));
- break;
- }
- case DATAIMM: {
- len += sprintf(&text[len], "#%.2XH",
- memory_read8(PGM_MEM_ID, address));
- address++;
- break;
- }
- case DATA16: {
- len += sprintf(&text[len], "#%.4XH",
- ((memory_read8(PGM_MEM_ID,
- address) << 8) +
- memory_read8(PGM_MEM_ID, address+1)));
- address += 2;
- break;
- }
- case CBITADDR: {
- cpu8051_int_mem_bit_info((memory_read8(PGM_MEM_ID,
- address) & 0xF8),
- str);
- len += sprintf(&text[len], "/%s.%X", str,
- (memory_read8(PGM_MEM_ID, address) & 7));
- address++;
- break;
- }
- default: {
- len += sprintf(&text[len], "%s",
- ArgsTextTbl[InstArgTbl[ArgTblOfs + i]]);
- }
- }
- if (i < InstArgTbl[ArgTblOfs])
- len += sprintf(&text[len], ",");
- }