home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / forth / compiler / fpc / source / p3_7dc.seq < prev    next >
Text File  |  1990-04-04  |  612b  |  30 lines

  1. \ Anwser for problem 3.7 by Dickson Cheng  04/04/90 21:06:40.95
  2.  
  3. \ Each definitions ended with DECIMAL so than the system will change
  4. \ back to DECIMAL BASE.
  5.  
  6. \ " . "  is already defined to display the top number in DECIMAL.
  7.  
  8.  
  9. : BINARY        ( -- )
  10.         2 BASE ! ;
  11.  
  12. : .H            ( n -- )
  13.         HEX . DECIMAL ;
  14.  
  15. : U.H           ( n -- )
  16.         HEX U. DECIMAL ;
  17.  
  18. : .O            ( n -- )
  19.         OCTAL . DECIMAL ;
  20.  
  21. : U.O           ( n -- )
  22.         OCTAL U. DECIMAL ;
  23.  
  24. : .B            ( n -- )
  25.         BINARY . DECIMAL ;
  26.  
  27. : U.B           ( n -- )
  28.         BINARY U. DECIMAL ;
  29.  
  30.