easier to #define USING_NOREGS if the opcode does not use any registers
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 26 Sep 2018 05:35:32 +0000 (06:35 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 26 Sep 2018 05:35:32 +0000 (06:35 +0100)
id_regs.py

index 3f5290d41ca77b2871da5dbdbe7e60d3076032d3..830ef95f7c405d6d8ac01e96368642c1889b4566 100644 (file)
@@ -58,6 +58,8 @@ def find_registers(fname):
             if p.startswith('WRITE_'):
                 p = p[6:]
             res.append('#define USING_REG_%s' % p)
+    if not res:
+        return '#define USING_NOREGS'
     return '\n'.join(res)
 
 if __name__ == '__main__':