This one sidetracked me once.
BASE stores the modulo of the currently selected base, that is, 2 for BINARY, 8 for OCTAL, 16 for HEX, etc.
But when dump prints the number in BASE, it prints according to the currently selected base, so:
in base 2 (BINARY), the 2 stored in BASE prints as 10 ( one-zero binary)
in base 8 (OCTAL) , the eight prints as 10 ( 1000 binary)
in base 16 (HEX( the sixteen prints as 10. (10000 binary)
They are actually different values, but dump is dumping them in your selected base, so they always print as 10.
Glenn
>>> SF Talk <sftalk_at_forth.com> 10/21/99 02:12PM >>>
Date: Thu, 21 Oct 1999 15:33:54 -0400
From: David Rossi <David.Rossi_at_wcom.com>
Subject: Base never seems to change ???
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.
Thanks!
.
Received on Thu Oct 21 1999 - 15:33:54 PDT
Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!
This archive was generated 07-Feb-2012. Archive updated nightly.