home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Antic Magazine 1982 June
/
Antic_June_1982_Vol_1_No_2.atr
/
forthfa2.txt
< prev
next >
Wrap
Text File
|
2021-01-30
|
2KB
|
1 lines
Pink noise studios/fig-forth 1/82¢\ 30 extensions for others rfg20apr82¢: \ in @ c/1 / 1+ c/l * in ! ;¢ immediate \ from Henry Laxen¢: NOT 0= ;¢ hex¢: MSBYTE 0 100 v/ swap drop ;¢: LSBYTE ff and ;¢: >< \ byteswap¢ dup byteswap¢ dup lsbyte 100 x swap msbyte + ;¢0 variable TOFLAG¢: TO 1 toflag ! ;¢: VAR <builds ,¢ does> toflag @¢ If ! Else @ then 0 toflag ! ;¢decimal ;s¢¢\ 31 fields in directory rfg18apr82¢0 variable DIR.ADDR¢\ points to directory entry in buffers¢: FIELDER <builds c, \ offset into field¢ does> c@ dir.addr @ + \ compute add¢ Toflag @ if ! Else @ then 0 toflag ! ;¢0 fielder FLAG.BYTE¢1 fielder SECTOR.COUNT¢3 fielder START.SECTOR¢: NAME.FIELD dir.addr @ 5 + ;¢;s¢¢\ 32 utilities for DIR rfg18apr82¢: ?NULLED \ return true if nulled out¢ flag.byte lsbyte dup 80 =¢ swap 0= or sector.count 0= or ;¢ hex¢: PNAME¢ name.field dup 8 type 2e emit¢ 8 + 3 type ;¢0 variable #SEC¢: BUMPSEC \ increment total and print¢ sector.count dup #sec +! 4 .r ;¢ decimal¢: .USED \ according to VTOC¢ 359 block 3 + @ 4 .r¢ . sectors available cr ;¢;s¢¢pink noise studios/fig-forth 1/82¢\ 33 directory of FMS disks rfg18apr82¢ decimal¢: DIR 0 #sec ! cr¢ 368 360 \ directory sectors¢ do i block dup b/buf + swap¢ do i dir.addr !¢ ?nulled not¢ if pname bumpsec cr then¢ 16 +loop¢ loop cr #sec @ 4 .r¢ . sectors used by files cr .used ;¢;s¢¢\ 34 fields in sectors rfg18apr82¢ decimal¢ 0 variable SECTOR¢: DATA <builds c,¢ does> c@ sector @ 1- block +¢toflag @¢ if ! else @ then 0 toflag ! ;¢125 data FILE¢125 data POINTER¢127 data BCOUNT¢ hex¢\ below return values¢: #FILE file lsbyte 4 / ;¢: #POINT pointer >< 3ff and ;¢: #BYTES bcount 7f and 7d min ;¢\ above accounts for short sectors¢;s¢¢\ 35 dos access utilities rfg18apr82¢: DATA.FIELD \ first storage location¢ sector @ 1- block ;¢: ?LAST #point -dup 0= ;¢\ leave true or false + link¢\ to next sector¢¢ pink noise studios/fig-forth 1/82¢\ 36 printing a file rfg20apr82¢\ assumes dir.addr points to¢\ directory entry in buffers¢: PRINT.FILE¢ start.sector sector !¢ begin data.field #bytes type¢ ?last not¢ while sector !¢ repeat ;¢