version 1.5, 1998/12/20 23:17:54
|
version 1.6, 1998/12/23 09:24:38
|
Line 35 Variable tcell
|
Line 35 Variable tcell
|
|
|
: search-magic ( fd -- ) >r |
: search-magic ( fd -- ) >r |
BEGIN magicbuf 8 r@ read-file throw 8 = WHILE |
BEGIN magicbuf 8 r@ read-file throw 8 = WHILE |
magicbuf s" Gforth" tuck compare 0= UNTIL |
magicbuf s" Gforth2" tuck compare 0= UNTIL |
ELSE true abort" No magic found" THEN |
ELSE true abort" No magic found" THEN |
magicbuf 6 + c@ digit? drop tchars ! |
1 magicbuf 7 + c@ 5 rshift 3 and lshift tchars ! |
magicbuf 7 + c@ digit? drop dup -2 and tcell ! |
1 magicbuf 7 + c@ 1 rshift 3 and lshift tcell ! |
1 and 0= [ pad off 1 pad ! pad c@ 1 = ] Literal = bswap? ! |
magicbuf 7 + c@ 1 and 0= |
|
[ pad off 1 pad ! pad c@ 1 = ] Literal = bswap? ! |
rdrop ; |
rdrop ; |
|
|
Create image-header 4 cells allot |
Create image-header 4 cells allot |