mirror of
https://github.com/catseye/SixtyPical.git
synced 2025-02-09 01:30:50 +00:00
Confirm constraint on save
ing a
.
This commit is contained in:
parent
19461bc205
commit
e7674c44ce
@ -785,7 +785,8 @@ class Analyzer(object):
|
||||
baton = batons.pop()
|
||||
context.re_introduce(baton)
|
||||
|
||||
# FIXME check if A needs to be the outer thing that is saved, I think it does.
|
||||
# We do this check outside the loop, because A is only preserved
|
||||
# if it is the outermost thing being `save`d.
|
||||
if location == REG_A:
|
||||
pass
|
||||
else:
|
||||
|
@ -2121,6 +2121,20 @@ There is a shortcut syntax for a nested series of `save`s.
|
||||
| }
|
||||
= ok
|
||||
|
||||
`a` is only preserved if it is the outermost thing `save`d.
|
||||
|
||||
| routine main
|
||||
| inputs a
|
||||
| outputs a
|
||||
| trashes z, n
|
||||
| {
|
||||
| save x, a {
|
||||
| ld a, 0
|
||||
| ld x, 1
|
||||
| }
|
||||
| }
|
||||
? UnmeaningfulOutputError: a
|
||||
|
||||
Not just registers, but also user-defined locations can be saved.
|
||||
|
||||
| byte foo
|
||||
|
Loading…
x
Reference in New Issue
Block a user