>From: David Rossi <David.Rossi_at_wcom.com>
>
>Why when I execute a base changing word like HEX, or OCTAL, the number
>stored at BASE never changes from 10?
>
>The actual system interpretation of the base does change however as
>evidenced by the TOS changing from 11 to B when I execute the word HEX after
>entering a TOS of 11 under the base of DECIMAL.
>
>I am checking the BASE value thusly:
>
>BASE 1 DUMP
>
>And it lists the address of BASE and the value 10.
first, dump changes BASE and while executing will always display 10.
second, consider that
DECIMAL 36 BASE ! BASE @ .
will always result in the display of "10"
since any given base, represented as a string in the given base, is
exactly ((1 * base) + 0) which is how base systems work
to examine the base, try the following:
HEX BASE @ DECIMAL .
OCTAL BASE @ DECIMAL .
or try a word which prints a number in a fixed base without
altering the base itself:
HEX BASE @ H.
DECIMAL BASE @ H.
OCTAL BASE @ H.
2 BASE ! BASE @ H.
rick
.
Received on Thu Oct 21 1999 - 13:11:47 PDT
Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!
This archive was generated 09-Feb-2012. Archive updated nightly.