1
0
mirror of https://github.com/rzzzwilson/pymlac.git synced 2025-06-10 09:32:41 +00:00

Fixed bug in pass 2 handling of BSS

This commit is contained in:
Ross Wilson 2016-01-30 17:02:23 +07:00
parent efd43b1391
commit 3feb4c2329
2 changed files with 8 additions and 5 deletions

View File

@ -661,13 +661,15 @@ def pass_2(lines):
error("BSS pseudo-op has bad value")
return False
value = eval_expr(addr)
if value is None:
error("BSS pseudo-op has bad value: '%s'" % addr)
if label:
try:
old_value = SymTable[label]
if value != old_value:
error("BSS value in has changed, "
old_dot = SymTable[label]
if Dot != old_dot:
error("BSS dot value has changed, "
"was %06o, is now %06o"
% (old_value, value))
% (old_dot, Dot))
except KeyError:
error("BSS label '%s' wasn't defined in first pass!?"
% label)

View File

@ -16,6 +16,7 @@ offset data start - 3
ascii 'xxxxxxx'
ascii "xx"
ascii 'x'
tom bss 4
end hlt
end start
end start2