home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
forth
/
compiler
/
fpc
/
source
/
p3_8bs.seq
< prev
next >
Wrap
Text File
|
1990-04-07
|
911b
|
30 lines
\ Balraj Sidhu Set: 14D4
\ Comp 462 - Forth
\ Date: April 7, 1990
\ Problem 3.8
\ Illustration of Number Bases and formatted display operators
: binary ( -- ) 2 base ! ;
: ntable ( dn -- )
cr ." Unsigned" ." Signed" ." Unsigned"
." Signed" ." Unsigned" ." Signed"
cr ." Decimal" ." Decimal" ." Binary"
." Binary" ." Hex " ." Hex "
cr ." ----------------------------------------------"
." -------------------------------------------------------"
20 0 do
cr
decimal dup 10 u.r
dup 10 .r
binary dup 18 u.r
dup 17 .r
hex dup 10 u.r
dup 10 .r
1 +
loop
drop decimal cr ;