From 73ed5a5fce9d7ff414991096c25828940bf5cb61 Mon Sep 17 00:00:00 2001 From: Ry Date: Tue, 7 Feb 2023 21:34:39 -0800 Subject: [PATCH] rv2fox: Understand .byte and .4byte directives --- gcc/rv2fox | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/rv2fox b/gcc/rv2fox index dbe574f..8156664 100755 --- a/gcc/rv2fox +++ b/gcc/rv2fox @@ -193,8 +193,12 @@ class Converter: pass # ignore elif m := re.fullmatch(r'word\s+([^\s]+)', line): 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): 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): self.e.strz(*m.groups()) elif m := re.fullmatch(r'asciz\s+\"(.*)\"', line): @@ -341,7 +345,7 @@ class Converter: if line == '' or re.fullmatch(r'#.*', line): pass - elif re.fullmatch(r'\.[a-z]+.*', line): + elif re.fullmatch(r'\.[a-z0-9]+.*', line): self.convert_directive(line[1:]) elif m := re.fullmatch(r'([a-zA-Z0-9_.]+):', line): self.e.label(*m.groups())