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

  1. \ Comp 462
  2. \ Balraj Sidhu   Set: 14D4
  3. \ Date: April 3, 1990
  4. \ Problem 3.1
  5.  
  6.  
  7. \ print double numbers on the stack
  8.  
  9. : .sd ( -- )
  10.         depth ?dup if
  11.                 0 ?do depth i - 1- pick
  12.                       depth i - 2- pick
  13.                       d. 8 emit                 \ back up one space
  14.                       ascii . emit              \ indicate double word
  15.                 2 +loop
  16.                 else ." Empty" then ;
  17.  
  18. \ print all single numbers on the stack
  19. : .ss ( -- )
  20.         depth ?dup if
  21.                 0 ?do depth i - 1- pick
  22.                       . 8 emit                 \ back up one space
  23.                 loop
  24.                 else ." Empty" then ;
  25.  
  26.  
  27.