1
0
mirror of https://github.com/danbee/8080 synced 2025-03-04 08:39:07 +00:00

Better number formatting

This commit is contained in:
Daniel Barber 2015-12-13 20:09:23 +01:00
parent fc4764c5de
commit c5a0f40eac
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8

View File

@ -15,12 +15,12 @@ fn print_mnemonic(mnemonic: &str, bytes: &[u8]) {
opcode = bytes[0],
mnemonic = mnemonic,
arg = argument),
2 => println!("{opcode:02x} {byte:02x} {mnemonic:6} {arg}#0x{byte:02x}",
2 => println!("{opcode:02x} {byte:02x} {mnemonic:6} {arg}#${byte:02x}",
opcode = bytes[0],
byte = bytes[1],
mnemonic = mnemonic,
arg = argument),
3 => println!("{opcode:02x} {low_byte:02x} {high_byte:02x} {mnemonic:6} {arg}${high_byte:02x}{low_byte:02x}",
3 => println!("{opcode:02x} {low_byte:02x} {high_byte:02x} {mnemonic:6} {arg}#${high_byte:02x}{low_byte:02x}",
opcode = bytes[0],
low_byte = bytes[1],
high_byte = bytes[2],