Little bit more clean up

This commit is contained in:
Joseph Ferano 2025-03-13 21:59:37 +07:00
parent d4216d793a
commit 6909f75b35

View File

@ -531,12 +531,12 @@ main :: proc() {
dst_opr = parse_operand(inst, inst.dst, data[idx:], &processed, word, has_segment) dst_opr = parse_operand(inst, inst.dst, data[idx:], &processed, word, has_segment)
src_opr = parse_operand(inst, inst.src, data[idx:], &processed, word, has_segment) src_opr = parse_operand(inst, inst.src, data[idx:], &processed, word, has_segment)
// TODO: This is ugly as hell src_is_imm := operand_is(Immediate8, src_opr) || operand_is(Immediate16, src_opr)
is_imm := operand_is(Immediate8, src_opr) || operand_is(Immediate16, src_opr) dst_is_bracketed := operand_is(MemoryAddr, dst_opr) || operand_is(DirectAddress, dst_opr)
is_bracketed := operand_is(MemoryAddr, dst_opr) || operand_is(DirectAddress, dst_opr) src_is_bracketed := operand_is(MemoryAddr, src_opr) || operand_is(DirectAddress, src_opr)
shiftrot := inst.src == .ShiftRotate shiftrot := inst.src == .ShiftRotate
size_string := "" size_string := ""
if ((is_imm && is_bracketed) || (is_bracketed && shiftrot)) { if ((src_is_imm && dst_is_bracketed) || (dst_is_bracketed && shiftrot)) || (src_is_bracketed && operand_is(None, dst_opr)) {
size_string = word ? "word " : "byte " size_string = word ? "word " : "byte "
} }
@ -548,11 +548,6 @@ main :: proc() {
src_str := get_operand_string(src_opr, word, has_segment) src_str := get_operand_string(src_opr, word, has_segment)
full_inst: string full_inst: string
if dst_str == "" { if dst_str == "" {
_,ok_1 := src_opr.(MemoryAddr);
_,ok_2 := src_opr.(DirectAddress);
if (ok_1 || ok_2) {
size_string = word ? "word " : "byte "
}
interseg_string: string interseg_string: string
if indirect_intersegment { if indirect_intersegment {
interseg_string = " far" interseg_string = " far"