[Coco] Absolute Memory Location

coco at jechar.ca coco at jechar.ca
Sat Aug 15 21:58:07 EDT 2020


Actually for my particular problem if there was a function
called CAPTURESHELL that worked like this.

DIM caparray(20):STRING[80]

caparray=CAPTURESHELL("dir -e")

TaDa now we have the output of up to 20 lines of directory
in the array caparray.

If "dir -e" produces 21 or more lines you only get 19 lines
of output and a final line with the message
OVERFLOW ERROR - OUTPUT TRUNCATED.


On 2020-08-15 22:45, coco at jechar.ca wrote:
> Trying to implement some inter-process communication was hoping
> to not have to settle for having to write to a temporary disk
> file and then read it. It seems there should be some memory only
> way to pass info.
> 
> NOW THIS IS FANTASY but it is the sort of thing that would be
> useful.
> 
> For example if there was a function like this:
> 
> DIM block:BYTE
> DIM rokey$,rwkey$:STRING[200]
> 
> RUN BUFFS("CREATE",block,rokey$,rwkey$)
> 
> Where block,rokey$ and rwkey$ cannot be set but only read
> except that if rwkey$="NO" means that no other process can
> write to the memory.
> 
> Then if you say
> 
> returnval$="UNPROCESSED"
> key$=rwkey$
> SHELL "someProgram "+returnval$+key$
> 
> in "someProgram" say your code assigns returnval$="NEW VALUE"
> 
> looping through
> BPOKE key$,address,bytevalue
> 
> Where BPOKE lets you poke into the buffer with the given rwkey
> 
> There would also be a x = BPEEK(key$,byteval) where key$ may be
> either rwkey or rokey
> 
> Of course the OS would have to manage the keys to make sure that
> there were no duplication although duplication would be unlikely
> in a 200 character key.
> 
> Also If the key is to be so long there should be some way that the
> first time the key is checked by BPEEK or BPOKE and checks out as
> ok then additional calls from the same process do not need to recheck.
> 
> Also note valid values for address would be 0 to 8191 since these
> buffers are 8K blocks.
> 
> Finally RUN BUFFS("CLOSE",block)
> where you can only close the block if you opened it in the
> first palace.
> 
> But of course RUN BUFFS() , BPEEK and BPOKE are a FANTASY.
> 
> I think  I heard of something called "NAMED PIPES" that might
> work if OS9 has them.
> 
> On 2020-08-15 19:40, Rick Ulland wrote:
>> Not really.
>> 
>> Really.
>> 
>> In EDECB you have LPOKE, but there you own the machine and are free to
>> crash it. Basic09 runs underneath the OS9 system - you do not know
>> what is going on outside your process space and are not free to change
>> anything out there. You can hack some things. Your users will hate
>> you.
>> 
>> This might be the X=Y problem. What are you wanting to do that
>> requires smashing an absolute memory location to a fixed value from
>> inside Basic?
>> 
>> -rick
>> 
>> 
>> 
>> On 8/15/20 4:27 PM, coco at jechar.ca wrote:
>>> 
>>>  Is there any assembly program or syscall that can let you
>>>  put values in an ABSOLUTE location ( Specified MMU bank and
>>>  ADDRESS ). This program would need to be callable from Basic09.
>>> 
>>>  Charlie.
>>> 


More information about the Coco mailing list