From db55d49fb2c582093271a58e116baeea8e1a56aa Mon Sep 17 00:00:00 2001 From: Ricardo Menotti Date: Fri, 30 Apr 2021 15:01:35 -0300 Subject: [PATCH] moving parameters to tables file --- assembler/assembler.py | 4 ++-- assembler/tables.py | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/assembler/assembler.py b/assembler/assembler.py index 468e75a..5975a04 100755 --- a/assembler/assembler.py +++ b/assembler/assembler.py @@ -6,8 +6,8 @@ import time atable, ltable, dtable = {}, {}, {} #initialize global tables -address_size = 4 -jump_size = 7 +address_size = fields_table["address"] +jump_size = fields_table["jump"] try: filename = sys.argv[1] diff --git a/assembler/tables.py b/assembler/tables.py index f7347c6..71fbb57 100644 --- a/assembler/tables.py +++ b/assembler/tables.py @@ -11,3 +11,9 @@ "unused" : 112, "data" : 16 } + +fields_table = { + "opcode" : 4, + "address" : 4, + "jump" : 7 +}