VolksForth/AtariST/RAMDISK.FB

1 line
26 KiB
Plaintext
Raw Permalink Normal View History

2017-04-23 22:25:49 +00:00
HOW TO USE THE RAMDISK bp 17Aug86 Die Ramdisk ist im Prinzip ein erweiterter Buffermechanismus, der Buffer au<61>erhalb des Forth-Systems verwaltet. Die Organi- sation ist analog, mit der Ausnahme, da<64> es kein Updateflag gibt, ge<67>nderte Bl<42>cke also sofort auf die Diskette zur<75>ckge- schrieben werden. Die Benutzung ist v<>llig transparent, am Anfang mu<6D> nur einmal INITRAMDISK aufgerufen werden. Die Struktur der Buffer wird auf Screen 3 dargestellt. Die Ramdisk allokiert ihren Speicher mit MALLOC. \ loadscreen for more buffers bp 17Aug86 \needs 2over include double.scr Onlyforth \needs 4dup : 4dup 2over 2over ; \needs 4drop : 4drop 2drop 2drop ; \needs user' : user' ' >body c@ ; \needs d> : d> 2swap d< ; 2 $B +thru 1 +load \ patch ramdisk into system \ patch ramdisk into System bp 17Aug86 | : ((close ( fcb -- fcb ...) \ word for patch (CLOSE !! dup flushramfile [ Dos ' (close >body @ , ] ; | : (empty-buffers ( -- ...) \ word for patching EMPTY-BUFFE emptyramdisk [ ' empty-buffers >body @ , ] ; ' ramdiskr/w is r/w ' ((close Dos ' (close >body ! ' (empty-buffers ' empty-buffers >body ! save initramdisk \ Variables and Constants bp 10Aug86 2Variable ramprev 0. ramprev 2! \ points to first buffer 2Variable ramfirst 0. ramfirst 2! \ start of buffer area 2Variable ramsize 0. ramsize 2! \ length of buffer area $408 Constant b/rambuf | Code link>file ( d1 -- d2 ) .l 4 SP ) addq Label >next Next end-code | Code link>block .l 6 SP ) addq >next bra end-code | Code link>data .l 8 SP ) addq >next bra end-code \\ structure of a buffer: | link to next buffer | file | block | data .... | +0 +4 +6 +8 +1032