From a73f6e1d9403af7b480e760e440bf11e406a27e1 Mon Sep 17 00:00:00 2001 From: Chris Pressey Date: Tue, 8 May 2018 12:48:15 +0100 Subject: [PATCH] Update HISTORY and README. --- HISTORY.md | 10 ++++++---- README.md | 24 +++++++++++++----------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 3f48a1a..a004965 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -4,10 +4,8 @@ History of SixtyPical 0.16 ---- -* Removed `--prelude` in favour of specifying both format and prelude - with a single option, `--output-format`. Documentation for same. -* `or a, z`, `and a, z`, and `eor a, z` compile to zero-page operations - if the address of z < 256. +* Added `save` block, which allows the named locations to be modified + arbitrarily inside the block, and automatically restored at the end. * More thorough tests and justifications written for the case of assigning a routine to a vector with a "wider" type. * Support for `copy [ptra]+y, [ptrb]+y` to indirect LDA indirect STA. @@ -15,6 +13,10 @@ History of SixtyPical * Support for `I a, btable + x` where `I` is `add`, `sub`, `cmp`, `and`, `or`, or `xor` * Support for `I btable + x` where `I` is `shl`, `shr`, `inc`, `dec` +* `or a, z`, `and a, z`, and `eor a, z` compile to zero-page operations + if the address of z < 256. +* Removed `--prelude` in favour of specifying both format and prelude + with a single option, `--output-format`. Documentation for same. 0.15 ---- diff --git a/README.md b/README.md index 40b9965..2621ea6 100644 --- a/README.md +++ b/README.md @@ -87,28 +87,30 @@ Is that consistent with `st`? Well, probably it is, but we have to explain it. It might make more sense, then, for it to be "part of the operation" instead of "part of the reference"; something like `st.hi x, word`; `st.lo y, word`. Dunno. -### Save values +### Save multiple values in single block -This preserves them, so that, semantically, they can be used later even though they -are trashed (or otherwise alternately used) inside the block. - -Inside the block, we set them as writeable (but not meaningful). When the block -exits, we restore whatever status they had. - -This act will trash `a`, both in the block, and outside it, unless the value being -saved is `a`. One idiom would be something like +As a shortcut for the idiom save a { save var { ... } } -which would save all values. Maybe abbreviate this to +allow save a, var { ... } -This can use the stack. But it need not use the stack. +### Save values to other-than-the-stack + +Allow + + save a to temp_a { + ... + } + +Which uses some other storage location instead of the stack. A local static +would be a good candidate for such. ### Make all symbols forward-referencable