home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / forth / compiler / fpc / source / sstack.seq < prev    next >
Text File  |  1988-11-04  |  656b  |  18 lines

  1.  
  2. \ HERE ARE THE MODIFICATIONS TO .SD  REQUIRED SO THAT IT WILL
  3. \ DISPLAY SINGLE NUMBERS.  I HAVE COMMENTED OUT THE PARTS OF
  4. \ .SD THAT ARE NOT REQUIRED.
  5. \ This stack print will print double numbers that are on the stack.
  6. \ If there is an odd number of numbers on the stack or if the stack
  7. \ has a mixed combination of singles and doubles you are likely to
  8. \ get confusing results.
  9. \ : .SD ( -- )
  10.   : .SS ( -- )
  11.      DEPTH ?DUP IF
  12.                  0 ?DO DEPTH I - 1- PICK
  13.                         (  DEPTH I - 2- PICK )
  14.                       . (  D.  8 EMIT ASCII . EMIT )
  15.                  ( 2 +) LOOP
  16.                 ELSE ." Empty" THEN ;
  17.  
  18.