MNEMONIC_COLUMN_NAME = "opcode"
XO_COLUMN_NAME = "Major 59 and 63"
-# TODO: copy PO=59 table to PO=63 table
-
class LineReader:
def __init__(self, lines):
row = line_parts[1].strip()
if row.startswith('`') and row.endswith('`'):
row = row[1:-1].strip()
- assert row.lstrip(" 01") == "", (f"invalid table line header-cell "
- f"contents -- must be a "
- f"binary string: {row}")
+ assert row.lstrip(" 01/.") == "", (
+ f"invalid table line header-cell contents -- must be a "
+ f"binary string: {row}")
for i, column in zip(columns_range, columns):
cell = line_parts[i]
+ if cell.strip() == "":
+ continue
match = re.fullmatch(
- r" *<small> *` *(?P<xo>[01][01 ]*[01]) *` *</small>"
+ r" *<small> *` *(?P<xo>[01./][01 ./]*[01./]) *` *</small>"
r" *<br/?> *(?P<mnemonic>[a-zA-Z0-9_.][a-zA-Z0-9_.()]*)?"
- r"(?(mnemonic)|(?:\([a-zA-Z0-9_.()]+\)|\*\*TBD\*\*|))"
+ r"(?(mnemonic)|(?:\([a-zA-Z0-9_.()]+\)|"
+ r"\*\*TBD\*\*| |))"
r"(?: *\(draft\))? *", cell)
assert match is not None, f"invalid table cell: {cell!r}"
xo, mnemonic = match.group("xo", "mnemonic")
- shrunk_xo = xo.replace(" ", "")
- expected_xo = (row + column).replace(" ", "")
+ shrunk_xo = xo.replace(" ", "").replace('.', '/')
+ expected_xo = (row + column).replace(" ", "").replace('.', '/')
assert shrunk_xo == expected_xo, \
f"incorrect XO: found {shrunk_xo} expected {expected_xo}"
if mnemonic is None:
yield line
line, lineno = lr.read()
- for _ in range(2):
+ for _ in range(3):
yield from parse_single_mnemonic_to_opcode_map()
def skip_table():