[Ql-Users] Where is SBASIC?

2011-05-10 Thread Martyn Hill

Dear list

I am working on an SBASIC editing tool (initially in SBASIC itself) 
under SMSQ/E (QPC 2).


I'm currently trying to find my way around the SBASIC (Job0 or 
otherwise) job area and am confused by the locations of the various 
areas within the SBASIC job itself.


Here's an example from a fairly long SBASIC daughter job (sorry about 
the possibly screwed-up spacing):


AreaLength  St   End

Input buf   10 256   266
Token buf61280  1286
Program  23830  123544147374
Name table2856   89800 92656
Name list 2889   59848 62737
Variables 4080-3110136  -3106056
Channels   200 -179720   -179520
Return  24 -790456   -790432
Lines0   0 0

How is it that some of these areas lie well outside of the traditional 
SBASIC job area?


I have my own ideas, but hoped someone here (Marcel?) might be able to 
shed some light on how and where SBASIC is laid-out in SMSQ/E.


Also, the Job 0 pointed-to from the system variables appears to be a 
'dummy' job header+job area (640 bytes, regardless of whats loaded in 
Job 0).


I supoose all I really need to know (beyond satisfying my curiosity) is:

a) Can I rely on the pointers above - from peek_l(\\...) - to find 
the actual table data?
b) Is there a SBASIC job-size stored in any _one_ place (as opposed 
to adding up the 'Length' bits above)


Thanks for any insights ;-)

Martyn Hill
London.

--
"There are 10 types of people in this world. Those who understand binary and those 
who don't."

___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] Where is SBASIC?

2011-05-12 Thread Marcel Kilgus
Martyn Hill wrote:
> How is it that some of these areas lie well outside of the traditional
> SBASIC job area?
>
> I have my own ideas, but hoped someone here (Marcel?) might be able to
> shed some light on how and where SBASIC is laid-out in SMSQ/E.

Frankly for me it's all pretty hazy what you're trying to do or asking
here. The sources of the SBASIC interpreter are out there and usually
well enough commented, though I concur that many things are still not
easy to understand ;-)

Generally everything in Basic is always relative to a Basic-area base
pointer. This is at a fixed offset from the JCB for SBasic jobs. I'm
not sure how job 0 is handled.

The SBasic job working areas are generally allocated from the common
heap, so they are a) discontinuous and b) might be below A6 (therefore
negative offsets are possible).

>  b) Is there a SBASIC job-size stored in any _one_ place (as opposed
> to adding up the 'Length' bits above)

No. But why would one want to know this?

Cheers, Marcel

___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm