home .. forth .. colorforth mail list archive ..

Re: [colorforth] CF05, Block 20 (USB), “free”


Hi Nick,

First, sorry, that hyperlink in my email wasn’t supposed to be there (Thunderbird being too clever). Thanks for the listing.

I think it might not be a specific USB point—it’s the command “ok” below (listing still right at bottom).
ok show black screen white regs keyboard ; free 67106904
3fff800 free !

free is magenta
6706904 is green
3fff800 dark yellow
free yellow
! yellow

That 3fff800 is a bit smaller than 4000000, which is 64MB. But why that number? Is there a simple explanation of colorForth’s memory map anywhere?

There is the following in Josh Grams source (the one I use):
;   100000 dictionary
;    a0000 return stack (main)
;    9f400 data stack
;    9dc00 return stack (draw)
;    9d000 data stack
;    9b800 return stack (serve)
;    9ac00 data stack
;    99400 divider (bottom of rstack, top of floppy buffer)
;    94c00 floppy buffer
;    92c00 forth dictionary addrs (room for 2048 entries)
;    90c00 forth dictionary names
;     7c00 BIOS loads boot sector here; we immediately move it to 0
;     4800 source
;     3000 icons
;        0 the colorforth kernel

So this goes up to 100000h (1MB)

I might be barking up entirely the wrong tree though. Maybe it is a peculiar USB–affected memory address.

Thanks,
Jason

Nick Maroudas said the following on 11/10/2008 07:04:
Quoting Jason Kemp <jason.kemp@xxxxxxxxxxxxxxxx>:

... " Hi,
... " ... " There is a variable, free, whose comment says ... " “current address in work ... " space” in this block. The initial value is ... " 3fff800 ... " <http://slug/colorforth/index.php?page=3fff800> ... " ... " Where does this address come from? ... " ... " Sorry, I can't point to an html listing of the
... " code on the Web
... " ... " Thanks,
... " Jason
... "

Nick here:  I can't help re USB, but here is an html
listing of CF05 in text form (original URL owner please
claim)


--------------------------------------------------------------------------------
{block 20} usb macro macro searched first
p@ a! dup ed 1, ; cyan macro compilation
bswap c80f 2, ;
b! ?lit 589 2, , drop ; forth
ad n-n 2* ff80 e800 8000e820 pci -1 + or ;
u@ n-n ad p@ ;
regs 12 for i u@ 4 h.n space i ad 4 h.n cr -next ;
ok show black screen white regs keyboard ; free 67106904
3fff800 free !
toggle 7 ;
array pop + ; magenta variables
string align array 42535500 , 143 , 20000 , a008000 , 28
, 0 , 1 , 0 ,
+fr a-a 1 +
fr n-a dup 3ff and drop if ; then fffffc00 + ;
frame 4 u@ 2/ 2/ 1 + fr ;
td, free @ ffffff7f and free ! 22 load
move sd 128 for over @ over ! 1 dup v+ next drop drop ;
yellow variable in green is literal
rest 31 block 1055 486 -31 + read ;
cf 0 1024 nc @ 18 * write ;
gds 4096 swap 255 + 256 / write ;
bot 3000 block dup 0 16 read 2000 block over move 2000
block over 128 6 * + move 0 16 write ;
--------------------------------------------------------------------------------
{block 21} p@ read register
p! write register
bswap byte-swap eax
b! store eax into literal byte address
ad byte-address of usb 16-bit register
u@ read usb register
regs display usb registers
ok start register display
free current address in work space
frames initialize 1024 frame pointers to off
+fr increment frame address - wrap
frame address of first accessible frame
td, wrap free 1st word of transfer
t, compile word into work space
b read 1024-byte blocks offset by 2000
--------------------------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com