File:  [gforth] / gforth / ec / dotx.fs
Revision 1.8: download - view: text, annotated - select for diffs
Mon Dec 31 19:02:25 2007 UTC (16 years, 3 months ago) by anton
Branches: MAIN
CVS tags: v0-7-0, HEAD
updated copyright year after changing license notice

    1: \ dotx.fs a always (simple) hexadecimal .s
    2: 
    3: \ Copyright (C) 1998,2000,2003,2007 Free Software Foundation, Inc.
    4: 
    5: \ This file is part of Gforth.
    6: 
    7: \ Gforth is free software; you can redistribute it and/or
    8: \ modify it under the terms of the GNU General Public License
    9: \ as published by the Free Software Foundation, either version 3
   10: \ of the License, or (at your option) any later version.
   11: 
   12: \ This program is distributed in the hope that it will be useful,
   13: \ but WITHOUT ANY WARRANTY; without even the implied warranty of
   14: \ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15: \ GNU General Public License for more details.
   16: 
   17: \ You should have received a copy of the GNU General Public License
   18: \ along with this program. If not, see http://www.gnu.org/licenses/.
   19: 
   20: 
   21: 
   22: \ this is much simpler than the things needed for . and .s
   23: \ so if you are debugging primitives and you don't get .s
   24: \ to work use this version.
   25: 
   26: [IFUNDEF] 8>>
   27: : 8>> 8 rshift ;
   28: [THEN]
   29: 
   30: : .digit
   31:   $0f and
   32:    dup 9 u>
   33:    IF   
   34:         [ char A char 9 - 1- ] Literal +
   35:    THEN 
   36:   [char] 0 + (emit) ;
   37: 
   38: : .w
   39: 	dup 8>> 2/ 2/ 2/ 2/ .digit
   40: 	dup 8>> .digit
   41: 	dup 2/ 2/ 2/ 2/ .digit
   42: 	.digit ;
   43: 
   44: : .x 	
   45: 	dup 8>> 8>> .w .w $20 (emit) ;
   46: 
   47: : .sx
   48:   depth
   49:   dup [char] < emit .x [char] > emit dup
   50:   0 ?DO dup pick .x 1- LOOP drop ;

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>