mirror of
https://github.com/livingcomputermuseum/pdp7-unix.git
synced 2026-02-10 10:20:38 +00:00
fix subtraction with relative values (relative-relative)=absolute!
This commit is contained in:
16
tools/as7
16
tools/as7
@@ -465,15 +465,29 @@ sub parse_expression {
|
||||
|
||||
if ($op eq '+') {
|
||||
$word += $syllable;
|
||||
$flags |= $sylflags;
|
||||
}
|
||||
elsif ($op eq '-') {
|
||||
$word -= $syllable;
|
||||
if ($flags & $RELATIVE) {
|
||||
# relative-relative => absolute!
|
||||
if ($sylflags & $RELATIVE) {
|
||||
$flags &= ~$RELATIVE;
|
||||
}
|
||||
# else: relative-abs => relative (no change)
|
||||
}
|
||||
else { # word is absolute
|
||||
if ($sylflags & $RELATIVE) {
|
||||
err('A', 'absolute value minus relative??');
|
||||
}
|
||||
# else: absolute-absolute => absolute (no change)
|
||||
}
|
||||
}
|
||||
else {
|
||||
$word |= $syllable;
|
||||
$flags |= $sylflags;
|
||||
}
|
||||
$word &= 0777777;
|
||||
$flags |= $sylflags;
|
||||
printf("\tsyllable: %#o word: %#o\n", $syllable, $word) if ($debug);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user