diff options
| -rw-r--r-- | core.e | 4 | ||||
| -rw-r--r-- | dynamic.e | 6 | ||||
| -rw-r--r-- | input.e | 2 | ||||
| -rw-r--r-- | interpret.e | 8 | ||||
| -rw-r--r-- | quine.asm | 5 | ||||
| -rw-r--r-- | transform.e | 6 |
6 files changed, 15 insertions, 16 deletions
diff --git a/core.e b/core.e index e49c2f9..91cf849 100644 --- a/core.e +++ b/core.e @@ -1149,10 +1149,8 @@ here ! : entry-flags@ 8 + @ 0xFF & ; -~ TODO these parameters are in a counterintuitive order, swap them -~ (entry pointer, new flags byte --) +~ (new flags byte, entry pointer --) : entry-flags! - swap 8 + dup @ 3roll 0xFF & diff --git a/dynamic.e b/dynamic.e index 55db683..d10a9c4 100644 --- a/dynamic.e +++ b/dynamic.e @@ -293,9 +293,9 @@ ~ We'll be defining a lot of immediate words, so we should set up a terse ~ way to do that. -: make-immediate latest @ dup entry-flags@ 0x01 | entry-flags! ; -: make-hidden latest @ dup entry-flags@ 0x80 | entry-flags! ; -: make-visible latest @ dup entry-flags@ 0x80 invert & entry-flags! ; +: make-immediate latest @ dup entry-flags@ 0x01 | swap entry-flags! ; +: make-hidden latest @ dup entry-flags@ 0x80 | swap entry-flags! ; +: make-visible latest @ dup entry-flags@ 0x80 invert & swap entry-flags! ; ~ Sooner or later we'll want to define recursive words; this one lets us ~ do that. It compiles into a call to the word that's currently being diff --git a/input.e b/input.e index dd5b7d3..dc20db8 100644 --- a/input.e +++ b/input.e @@ -262,7 +262,7 @@ ~ "attach-string-to-input-buffer". s" main-input-buffer-metadata" create -s" main-input-buffer-metadata" find 0x01 entry-flags! +s" main-input-buffer-metadata" find 0x01 swap entry-flags! ~ Having done that, now we do the runtime allocation. Then we also define ~ the variable "main-input-buffer" so we can find it again. diff --git a/interpret.e b/interpret.e index 24ea430..c1d88c4 100644 --- a/interpret.e +++ b/interpret.e @@ -544,10 +544,10 @@ latest @ ~ Now we enable the three words we'd been keeping hidden. It would be a ~ good idea to call "quit" as soon as possible after this, but we leave it to ~ the user. -dup entry-flags@ 0x80 invert & entry-flags! -dup entry-flags@ 0x80 invert & entry-flags! -dup entry-flags@ 0x80 invert & entry-flags! -dup entry-flags@ 0x80 invert & entry-flags! +dup entry-flags@ 0x80 invert & swap entry-flags! +dup entry-flags@ 0x80 invert & swap entry-flags! +dup entry-flags@ 0x80 invert & swap entry-flags! +dup entry-flags@ 0x80 invert & swap entry-flags! ~ Though we only do it once, this is a bit involved so we provide it as a ~ word. Notionally there are situations in which it could come up again, so diff --git a/quine.asm b/quine.asm index 6027e5e..ab742a0 100644 --- a/quine.asm +++ b/quine.asm @@ -5798,9 +5798,7 @@ cold_start: dq early_here, fetch, lit, 8, packalign, early_here_store ; This was "store_entry_flags". - ; TODO these parameters are in a counterintuitive order, swap them dq litstring, "entry-flags!", early_create, early_docol_codeword - dq litstring, "swap", early_find, entry_to_execution_token, early_comma dq litstring, "lit", early_find, entry_to_execution_token, early_comma dq lit, 8, early_comma dq litstring, "+", early_find, entry_to_execution_token, early_comma @@ -7723,6 +7721,7 @@ cold_start: dq litstring, "lit", early_find, entry_to_execution_token, early_comma dq lit, 0x80, early_comma dq litstring, "|", early_find, entry_to_execution_token, early_comma + dq litstring, "swap", early_find, entry_to_execution_token, early_comma dq litstring, "entry-flags!", early_find, entry_to_execution_token dq early_comma dq litstring, "exit", early_find, entry_to_execution_token, early_comma @@ -7737,6 +7736,7 @@ cold_start: dq lit, 0x80, early_comma dq litstring, "invert", early_find, entry_to_execution_token, early_comma dq litstring, "&", early_find, entry_to_execution_token, early_comma + dq litstring, "swap", early_find, entry_to_execution_token, early_comma dq litstring, "entry-flags!", early_find, entry_to_execution_token dq early_comma dq litstring, "exit", early_find, entry_to_execution_token, early_comma @@ -7750,6 +7750,7 @@ cold_start: dq litstring, "lit", early_find, entry_to_execution_token, early_comma dq lit, 0x01, early_comma dq litstring, "|", early_find, entry_to_execution_token, early_comma + dq litstring, "swap", early_find, entry_to_execution_token, early_comma dq litstring, "entry-flags!", early_find, entry_to_execution_token dq early_comma dq litstring, "exit", early_find, entry_to_execution_token, early_comma diff --git a/transform.e b/transform.e index 63ae9c1..f470cb5 100644 --- a/transform.e +++ b/transform.e @@ -881,7 +881,7 @@ allocate-transformation-state s" transformation-state" variable swap-transform-variables + , - latest @ dup entry-flags@ 0x80 | entry-flags! + latest @ dup entry-flags@ 0x80 | swap entry-flags! ] ; @@ -912,7 +912,7 @@ allocate-transformation-state s" transformation-state" variable swap-transform-variables offset-to-target-address-space , - latest @ dup entry-flags@ 0x80 invert & entry-flags! + latest @ dup entry-flags@ 0x80 invert & swap entry-flags! ~ Since [ is an immediate word, we have to go to extra trouble to compile ~ it as part of ;. @@ -926,7 +926,7 @@ allocate-transformation-state s" transformation-state" variable ~ before attempting to understand label-semicolon-assembly-alternate. : label-semicolon-assembly-alternate here @ pack-next 8 packalign here ! - latest @ dup dup entry-flags@ 0x80 invert & entry-flags! + latest @ dup dup entry-flags@ 0x80 invert & swap entry-flags! entry-to-execution-token ~ The codeword needs to be transformed to the target address space. dup 8 + host-address-space-to-target |