rv2fox: Understand .byte and .4byte directives

This commit is contained in:
Ry 2023-02-07 21:34:39 -08:00
parent 7965ead639
commit 73ed5a5fce

View File

@ -193,8 +193,12 @@ class Converter:
pass # ignore pass # ignore
elif m := re.fullmatch(r'word\s+([^\s]+)', line): elif m := re.fullmatch(r'word\s+([^\s]+)', line):
self.e.data(*m.groups()) self.e.data(*m.groups())
elif m := re.fullmatch(r'4byte\s+([^\s]+)', line):
self.e.data(*m.groups())
elif m := re.fullmatch(r'zero\s+([^\s]+)', line): elif m := re.fullmatch(r'zero\s+([^\s]+)', line):
self.e.zero(*m.groups()) self.e.zero(*m.groups())
elif m := re.fullmatch(r'byte\s+([^\s]+)', line):
self.e.zero(*m.groups())
elif m := re.fullmatch(r'string\s+\"(.*)\"', line): elif m := re.fullmatch(r'string\s+\"(.*)\"', line):
self.e.strz(*m.groups()) self.e.strz(*m.groups())
elif m := re.fullmatch(r'asciz\s+\"(.*)\"', line): elif m := re.fullmatch(r'asciz\s+\"(.*)\"', line):
@ -341,7 +345,7 @@ class Converter:
if line == '' or re.fullmatch(r'#.*', line): if line == '' or re.fullmatch(r'#.*', line):
pass pass
elif re.fullmatch(r'\.[a-z]+.*', line): elif re.fullmatch(r'\.[a-z0-9]+.*', line):
self.convert_directive(line[1:]) self.convert_directive(line[1:])
elif m := re.fullmatch(r'([a-zA-Z0-9_.]+):', line): elif m := re.fullmatch(r'([a-zA-Z0-9_.]+):', line):
self.e.label(*m.groups()) self.e.label(*m.groups())