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

  1. \ Balraj Sidhu   Set: 14D4
  2. \ Comp 462 - Forth
  3. \ Date: April 6, 1990
  4. \ Problem 3.6
  5.  
  6. \ Illustration of Number Bases and formatted display operators
  7.  
  8. : ntable ( dn -- )
  9.         cr ."       Unsigned"  ."        Signed" ."      Unsigned"
  10.            ."         Signed"  ."      Unsigned" ."        Signed"
  11.         cr ."        Decimal"  ."       Decimal" ."        Octal "
  12.            ."         Octal "  ."        Hex   " ."         Hex  "
  13.         20 0 do
  14.              cr
  15.              decimal dup 13 u.r
  16.                      dup 13  .r
  17.              octal   dup 13 u.r
  18.                      dup 13  .r
  19.              hex     dup 13 u.r
  20.                      dup 13  .r
  21.              1 +
  22.              loop
  23.              drop decimal ;
  24.  
  25.  
  26.