Skip to content

Commit 105356e

Browse files
committed
Fixed spelling mistake
1 parent e66ee97 commit 105356e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

regcomp2.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
REG-COMP 2.0
33
Interface:
4-
py regcomp2.py {input} {output} --target={pASM/pASM.c/x86-64} --target-operant-size={} --target-memory-size={} --logging-mode={DEBUG/INFO/WARN/ERROR}
4+
py regcomp2.py {input} {output} --target={pASM/pASM.c/x86-64} --target-operand-size={} --target-memory-size={} --logging-mode={DEBUG/INFO/WARN/ERROR}
55
"""
66
from collections import defaultdict, deque
77
from traceback import format_exc
@@ -371,7 +371,7 @@ def main(input: str, output: str, target: _ty.Literal["pASM", "pASM.c", "x86-64"
371371
logging.error(f"Read memory size {memory_size} is larger than chosen memory size {chosen_memory_size}")
372372
sys.exit(1)
373373
elif operand_size > target_operant_size:
374-
logging.error(f"Read operant size {operand_size} is larger than target operant size {target_operant_size}")
374+
logging.error(f"Read operand size {operand_size} is larger than target operand size {target_operant_size}")
375375
sys.exit(1)
376376
logging.info(f"Reset chosen memory size to {memory_size} to match read memory size")
377377
chosen_memory_size = memory_size
@@ -387,7 +387,7 @@ def main(input: str, output: str, target: _ty.Literal["pASM", "pASM.c", "x86-64"
387387
if opcode in INSTRUCTION_SET: # Recognized opcode
388388
instruction = INSTRUCTION_SET[opcode]
389389
if "STP" == instruction: # No operand
390-
f.read(operand_size) # Need to discard the operant bits
390+
f.read(operand_size) # Need to discard the operand bits
391391
pasm_lines.append(f"{address:02} {instruction}")
392392
else:
393393
operand_bytes = f.read(operand_size)
@@ -751,10 +751,10 @@ def main(input: str, output: str, target: _ty.Literal["pASM", "pASM.c", "x86-64"
751751
else:
752752
logging.debug(f"Skipped placeholder replacement and rel-jump resolution")
753753
if (int(cell.op1.strip("#()") or "0").bit_length() + 7) // 8 > target_operant_size:
754-
logging.error(f"Op1 of '{cell}' is larger than the target operant size")
754+
logging.error(f"Op1 of '{cell}' is larger than the target operand size")
755755
sys.exit(1)
756756
elif (int(cell.op2.strip("#()") or "0").bit_length() + 7) // 8 > target_operant_size:
757-
logging.error(f"Op2 of '{cell}' is larger than the target operant size")
757+
logging.error(f"Op2 of '{cell}' is larger than the target operand size")
758758
sys.exit(1)
759759
file_list.append(f"{idx} {cell}\n")
760760
n += 1
@@ -933,8 +933,8 @@ def positive_nonzero_int(value):
933933
parser.add_argument("-o", nargs="?", default="", help="Path to the output file")
934934
parser.add_argument("--target", choices=["pASM", "pASM.c", "x86-64"], required=True,
935935
help="Compilation target: pASM, pASM.c or x86-64")
936-
parser.add_argument("--target-operant-size", type=positive_nonzero_int, default=2,
937-
help="A positive integer specifying the target operant size in bytes")
936+
parser.add_argument("--target-operand-size", type=positive_nonzero_int, default=2,
937+
help="A positive integer specifying the target operand size in bytes")
938938
parser.add_argument("--target-memory-size", type=positive_nonzero_int, default=0,
939939
help="A positive integer specifying the target memory size in bytes")
940940
parser.add_argument("--logging-mode", choices=["DEBUG", "INFO", "WARN", "ERROR"], default="INFO",
@@ -958,7 +958,7 @@ def positive_nonzero_int(value):
958958
logging.error(f"The input file ({input}) needs to exist")
959959
sys.exit(1)
960960
elif args.target_operant_size > 4:
961-
logging.error(f"The target operant size ({args.target_operant_size}) is bigger than the maximum allowed of 4")
961+
logging.error(f"The target operand size ({args.target_operant_size}) is bigger than the maximum allowed of 4")
962962
sys.exit(1)
963963
logging.info(f"Reading {input}, writing {output}")
964964

0 commit comments

Comments
 (0)