s390guy / SATK

Toolkit for creating baremetal programs targeting mainframe compatible systems
GNU General Public License v3.0
42 stars 6 forks source link

case inconsistencies #5

Closed mstram closed 4 years ago

mstram commented 10 years ago

This all assembles correctly : dc x'42 dc X'42' DC x'42' DC X'42

But any of these generates an error : (the x is the error)

 dc   a(x'42')
 dc   A(x'42')
 DC  a(x'42')
 DC  A(x'42')

asma.py Copyright (C) 2014 Harold Grovesteen
Traceback (most recent call last):
File "/home/action/git/SATK/tools/asma.py", line 268, in
ASMA(args,dm).run()
File "/home/action/git/SATK/tools/asma.py", line 102, in run
self.assembler.assemble()
File "/home/action/git/SATK/asma/assembler.py", line 4567, in assemble
method(s,trace=pdebug)
File "/home/action/git/SATK/asma/assembler.py", line 3860, in _dc_pass2
con.build(stmt,ondx,debug=edebug,trace=etrace)
File "/home/action/git/SATK/asma/asmparsers.py", line 2131, in build
debug=debug,trace=trace)
File "/home/action/git/SATK/asma/asmparsers.py", line 1818, in build
expr.evaluate(debug=debug,trace=trace)
File "/home/action/git/SATK/tools/lang/expression.py", line 131, in evaluate
res=self.pparser.run(self.ptokens,debug=debug,trace=trace)
File "/home/action/git/SATK/tools/lang/pratt.py", line 408, in run
res=self.parse(debug=debug,trace=trace)
File "/home/action/git/SATK/tools/lang/pratt.py", line 397, in parse
exp=self.expression(rbp=0,debug=debug,trace=trace)
File "/home/action/git/SATK/tools/lang/pratt.py", line 336, in expression
left=t.nud(self,debug=debug,trace=trace)
File "/home/action/git/SATK/tools/lang/pratt.py", line 219, in nud
res=self.value()
File "/home/action/git/SATK/asma/asmparsers.py", line 688, in value
v=self.convert()
File "/home/action/git/SATK/asma/asmparsers.py", line 680, in convert
b=PLitDC.base[dctype]
KeyError: 'x'

s390guy commented 10 years ago

On Fri, 2014-08-01 at 08:48 -0700, Mike Stramba wrote:

This all assembles correctly : dc x'42 dc X'42' DC x'42' DC X'42

But any of these generates an error : (the x is the error)

dc a(x'42') dc A(x'42') DC a(x'42') DC A(x'42') asma.py Copyright (C) 2014 Harold Grovesteen

Traceback (most recent call last):

File "/home/action/git/SATK/tools/asma.py", line 268, in

ASMA(args,dm).run()

File "/home/action/git/SATK/tools/asma.py", line 102, in run

self.assembler.assemble()

File "/home/action/git/SATK/asma/assembler.py", line 4567, in assemble

method(s,trace=pdebug)

File "/home/action/git/SATK/asma/assembler.py", line 3860, in _dc_pass2

con.build(stmt,ondx,debug=edebug,trace=etrace)

File "/home/action/git/SATK/asma/asmparsers.py", line 2131, in build

debug=debug,trace=trace)

File "/home/action/git/SATK/asma/asmparsers.py", line 1818, in build

expr.evaluate(debug=debug,trace=trace)

File "/home/action/git/SATK/tools/lang/expression.py", line 131, in evaluate

res=self.pparser.run(self.ptokens,debug=debug,trace=trace)

File "/home/action/git/SATK/tools/lang/pratt.py", line 408, in run

res=self.parse(debug=debug,trace=trace)

File "/home/action/git/SATK/tools/lang/pratt.py", line 397, in parse

exp=self.expression(rbp=0,debug=debug,trace=trace)

File "/home/action/git/SATK/tools/lang/pratt.py", line 336, in expression

left=t.nud(self,debug=debug,trace=trace)

File "/home/action/git/SATK/tools/lang/pratt.py", line 219, in nud

res=self.value()

File "/home/action/git/SATK/asma/asmparsers.py", line 688, in value

v=self.convert()

File "/home/action/git/SATK/asma/asmparsers.py", line 680, in convert

b=PLitDC.base[dctype]

KeyError: 'x'

While self defining terms using 'X' or 'x' were accepted, internally only upper case was recognized. Committed change allows self defining terms when used in DC directive address constant expressions to be case insensitive. Change applies to B, C, CE and CA types as well.

Fish-Git commented 4 years ago

FYI: shouldn't this issue be closed now? Mike's code works fine for me!