This commit is contained in:
Neil Webber 2023-09-22 09:33:47 -04:00
parent 853bdb6741
commit 7dee0dbf9e

View file

@ -331,26 +331,20 @@ class InstructionBlock(PDP11InstructionAssembler, AbstractContextManager):
block = fref.block block = fref.block
# the location to be patched is in one of three places, look for it: # the location to be patched is in one of three places, look for it:
for loco in (0, 1, 2): for loco in (0, 1, 2):
if block._instblock[fref.loc + loco] == fref: if block._instblock[fref.loc + loco] is fref:
break break
fwdoffs = block.getlabel(fref.name) - (2*fref.loc) fwdoffs = block.getlabel(fref.name) - (2*fref.loc)
block._instblock[fref.loc + loco] = fwdoffs block._instblock[fref.loc + loco] = fwdoffs
def label(self, name, *, value=None): def label(self, name, *, value='.'):
"""Record the current position, or 'value', as 'name'. """Record the current position, or 'value', as 'name'.
If value is '.', the current position is multiplied by 2 If no value specified, it defaults to '.' which means
(so that value will be suitable for adding to a base address) the current position index, multiplied by 2 so that it
is suitable to add to a base address. Otherwise the value
A trivial amount of arithmetic processing is allowed in the value: is taken as-is, or with a trivial amount of arithmetic.
token + token
token - token
where 'token' is a symbol name, a number, or '.'
""" """
if value is None:
value = '.'
try: try:
value_tokens = value.split() value_tokens = value.split()
except AttributeError: except AttributeError: