mirror of
https://github.com/elliotnunn/tbxi-patches.git
synced 2024-05-28 14:41:26 +00:00
Allow multiple instructions per line
Makes command line use easier
This commit is contained in:
parent
6bdba0df45
commit
200bc15b91
11
ppcasm.py
11
ppcasm.py
|
@ -46,14 +46,15 @@ def assemble(asm, return_labels=False):
|
||||||
line = line.lower() # normalize case
|
line = line.lower() # normalize case
|
||||||
line = line.partition('#')[0] # strip comments
|
line = line.partition('#')[0] # strip comments
|
||||||
|
|
||||||
line_labels, line = re.match(r'^((?:\s*\w+:)*)(.*)', line).groups()
|
for line in line.split(';'):
|
||||||
|
line_labels, line = re.match(r'^((?:\s*\w+:)*)(.*)', line).groups()
|
||||||
|
|
||||||
line_labels = re.findall(r'\w+', line_labels)
|
line_labels = re.findall(r'\w+', line_labels)
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
|
|
||||||
line_list.append((lineno, offset, orig_line, line_labels, line))
|
line_list.append((lineno, offset, orig_line, line_labels, line))
|
||||||
|
|
||||||
if line: offset += 4
|
if line: offset += 4
|
||||||
|
|
||||||
# Second pass: resolve labels (each instruction is 4 bytes, easy)
|
# Second pass: resolve labels (each instruction is 4 bytes, easy)
|
||||||
all_labels = {}
|
all_labels = {}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user