aboutsummaryrefslogtreecommitdiffstats
path: root/asm/creole.py
diff options
context:
space:
mode:
authorGravatar Peter McGoron 2023-02-21 17:47:15 +0000
committerGravatar Peter McGoron 2023-02-21 17:47:15 +0000
commitb7eed7d44e81e1bb69fafec9ba85a73bbce63a23 (patch)
tree5a191cf78f3d4d0f4231230596f2e87ace2e998b /asm/creole.py
parentadd data parsing (diff)
get rid of unused lablen
Diffstat (limited to '')
-rw-r--r--asm/creole.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/asm/creole.py b/asm/creole.py
index e323432..d8f5d32 100644
--- a/asm/creole.py
+++ b/asm/creole.py
@@ -338,13 +338,18 @@ class Line:
self.ins = ins
self.args = args
- def check_line(self, lablen, reglen):
+ def check_line(self, reglen, datlen):
for a in self.args:
if a.at == ArgType.REG:
if a.val < 0 or a.val >= reglen:
raise RangeCheckException(a.at,
a.val,
reglen)
+ elif a.at == ArgType.DAT:
+ if a.val < 0 or a.val >= datlen:
+ raise RangeCheckException(a.at,
+ a.val,
+ reglen)
def __call__(self):
return self.ins.render(self.args)
@@ -366,7 +371,7 @@ def _term_sep(s):
class Program:
def _asm_push_line(self, ins, args):
l = Line(ins, args)
- l.check_line(self.lablen, self.reglen)
+ l.check_line(self.reglen, self.datlen)
self.asm.append(l)
def parse_asm_line(self, line):
@@ -454,8 +459,8 @@ class Program:
assert len(b) < encoding_types[lablen][0]
return b
- def __init__(self, lablen=16, reglen=16):
+ def __init__(self, reglen=16, datlen=16):
self.asm = []
- self.lablen = lablen
self.reglen = reglen
+ self.datlen = datlen
le='2021-07-26 16:10:31 -0700'>2021-07-26paired mutatorsGravatar John Cowan 1-43/+68 2021-07-26exceptionsGravatar John Cowan 1-1/+15 2021-07-26new exampleGravatar John Cowan 1-1/+4 2021-07-26updatesGravatar John Cowan 1-2/+4 2021-07-26dtd always first argumentGravatar John Cowan 1-9/+9 2021-07-26DTO to DTDGravatar John Cowan 1-55/+52 2021-07-26typoGravatar John Cowan 1-1/+1 2021-07-26switching to explicit dtosGravatar John Cowan 1-88/+102 2021-07-26errorsGravatar John Cowan 1-1/+4 2021-07-26more MN-W reviewGravatar John Cowan 1-5/+5 2021-07-26update preview linkGravatar John Cowan 1-1/+1 2021-07-26MN-W reviewGravatar John Cowan 1-6/+6 2021-07-26paired mutatorsGravatar John Cowan 1-43/+68 2021-07-25exceptionsGravatar John Cowan 1-1/+15 2021-07-25new exampleGravatar John Cowan 1-1/+4 2021-07-25updatesGravatar John Cowan 1-2/+4 2021-07-24dtd always first argumentGravatar John Cowan 1-9/+9 2021-07-23DTO to DTDGravatar John Cowan 1-55/+52 2021-07-22typoGravatar John Cowan 1-1/+1 2021-07-22switching to explicit dtosGravatar John Cowan 1-88/+102 2021-07-22errorsGravatar John Cowan 1-1/+4 2021-07-22more MN-W reviewGravatar John Cowan 1-5/+5 2021-07-20update preview linkGravatar John Cowan 1-1/+1 2021-07-20MN-W reviewGravatar John Cowan 1-6/+6 2021-07-18Fix typo.Gravatar Arthur A. Gleckler 2-4/+4 2021-07-18Add <p> around abstract.Gravatar Arthur A. Gleckler 1-2/+2 2021-07-18Publish first draft.draft-1Gravatar Arthur A. Gleckler 3-0/+114 2021-07-18Ignore trailing whitespace.Gravatar Arthur A. Gleckler 11-129/+129 2021-07-18Ignore "Dictionaries.log".Gravatar Arthur A. Gleckler 1-1/+2 2021-07-18Fix errors reported by W3C HTML Validator.Gravatar Arthur A. Gleckler 1-27/+27 2021-07-18Eliminate unnecessary redirect by using TLS/SSL.Gravatar Arthur A. Gleckler 1-1/+1