Skip to content

Commit f896a7d

Browse files
committed
Adding more info for const instructions
1 parent 223328b commit f896a7d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/app/shared/disassembler.shared.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,9 @@ export class Disassembler {
313313
}
314314
case Disassembler.CONST.opcode: {
315315
this.operand1 = this.get4();
316-
this.put(Disassembler.CONST, new Uint8Array([this.opcode, (this.operand1 >> 24) & 0x0ff, (this.operand1 >> 16) & 0x0ff, (this.operand1 >> 8) & 0x0ff, this.operand1 & 0x0ff]), this.operand1.toString());
316+
let asciiChar = String.fromCharCode(this.operand1);
317+
let isPrintable = /^[ -~]$/.test(asciiChar);
318+
this.put(Disassembler.CONST, new Uint8Array([this.opcode, (this.operand1 >> 24) & 0x0ff, (this.operand1 >> 16) & 0x0ff, (this.operand1 >> 8) & 0x0ff, this.operand1 & 0x0ff]), this.operand1.toString() + (isPrintable ? " (ASCII char: '" + asciiChar + "')" : ""));
317319
break;
318320
}
319321
case Disassembler.ADD.opcode: {

0 commit comments

Comments
 (0)