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

Fixed error in handling of 'dot' label

This commit is contained in:
Ross Wilson
2016-05-23 09:50:08 +07:00
parent 52a20c8ec7
commit 9a07713809
2 changed files with 11 additions and 4 deletions

View File

@@ -627,10 +627,12 @@ def eval_expr(expr):
if expr is None:
return None
print('eval_expr: initial expr=%s' % expr)
# replace any "." value with "dot" defined in the symbol table
expr = string.replace(expr, '.', 'DOT')
expr = string.replace(expr, '.', '_D_O_T_')
globs = copy.deepcopy(SymTable)
globs['DOT'] = Dot # add in the "." address
globs['_D_O_T_'] = Dot # add in the "." address
# evaluate the expression
try:

View File

@@ -1,6 +1,11 @@
; a very simple 'smoke-test' file
org 0100
org 02
start hlt
dot equ 01
org 0200
start jmp dot
hlt
end start