home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
forth
/
compiler
/
fpc
/
source
/
p3_7bs.seq
< prev
next >
Wrap
Text File
|
1990-04-06
|
824b
|
26 lines
\ Balraj Sidhu Set: 14D4
\ Comp 462 - Forth
\ Date: April 6, 1990
\ Problem 3.7
: binary ( -- ) 2 base ! ; \ set radix to binary
: .h ( n -- ) hex . decimal ; \ display number in hex
: u.h ( n -- ) hex u. decimal ; \ display number in unsigned hex
: .o ( n -- ) octal . decimal ; \ display number in octal
: u.o ( n -- ) octal u. decimal ; \ display number in unsigned octal
: .b ( n -- ) binary . decimal ; \ display number in binary
: u.b ( n -- ) binary u. decimal ; \ display number in unsigned binary
COMMENT:
Each definitions ends in decimal because so we no what mode it will
be in once it displayed the number.
We do not need .D to display the top number in decimal because switching to
decimal then display the number is just as easy.
COMMENT;