Re: [Ql-Users] Job data space - foibles?

2013-10-08 Thread nor...@dunbar-it.co.uk
Sorry about possible format problems, I'm on my phone.

Hi Marcel,

My file size is 30 bytes. I checked. Default data space from GWASL is 4000 
bytes. I expected that to end up as 4030 or possibly rounded to the nearest 8 
or 16 which would be 4032. 

Hence my confusion as 4042 is not divisible by 8 or 16.

Cheers,
Norm.

Ps. Yes it's 5 mins for someone who knows their way around the source  ;-)

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


Re: [Ql-Users] Job data space - foibles?

2013-10-08 Thread Marcel Kilgus
nor...@dunbar-it.co.uk wrote:
 My file size is 30 bytes. I checked. Default data space from GWASL
 is 4000 bytes. I expected that to end up as 4030 or possibly rounded
 to the nearest 8 or 16 which would be 4032.

What's the value of a4 then?

My test exe was 1024 bytes data space and 222 bytes EXE and A5 was
exactly 1246. Of course it depends on the way the EXE is started, as
the values given to SMS.CRJB are directly used. JMON (my way)
obviously didn't do any rounding, but others might.

 Ps. Yes it's 5 mins for someone who knows their way around the source  ;-)

You overestimate my knowledge of the code, I just know how to use FiFi
;)

Marcel

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


Re: [Ql-Users] Job data space - foibles?

2013-10-08 Thread nor...@dunbar-it.co.uk
A4 is $1e. 

I execute the job simply as ex test_bin. JMON picks it up at startup.

Sent from my HTC

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


Re: [Ql-Users] Job data space - foibles?

2013-10-08 Thread George Gwilt

On 7 Oct 2013, at 20:36, Norman Dunbar wrote:

 Evening all,
 
 I'm experimenting for the first exciting episode of the new assembly language 
 mailing list. It's the first time I've sat down with QPC since I started my 
 new job!
 
 I have noticed something a little odd, well, even to be honest. Strangely 
 enough, the answer is 42 - what is the question? ;-)
 
 Seriously, when I create a job with any given dataspace, when the job is 
 activated, A5.L is always set to that data space value plus 42 extra bytes.
 
 There's nothing in the QDOS docs (from Jochen) nor in Dickens or Pennell. The 
 closest I have found is in Pennell on page 20 where he says that ... TRNSP 
 is expanded by D2+D3+$68, memory permitting when a job is created.
 
 D2 is the code size, D3 is the requested dataspace size and the extra $68 is 
 for the standard job header area.
 
 I'm wondering if the mysterious 42 extra bytes is also accumulated in the 
 space desired in TRNSP (it has to be D2+D3+$68+42 or stuff would crash!) but 
 where does it come from?
 
 I cannot see it as being a rounding to the nearest 16 or 8 or whatever, 
 because it's always 42. When I say always, I have tried the same job with the 
 following dataspace sizes, and every one set A5 to be 42 extra:
 
 126, 256, 500, 512, 1000, 1024, 2000, 2048, 3000, 3172, 4000, 4096.
 
 I could, I suppose, look up the source for SMSQ but I don;t, sadly, have the 
 time at the moment. Not after doing all the above testing! I'm afraid I shall 
 be lazy and rely on the good will and knowledge of the list for answers.
 
 Thanks in advance.
 
 
 Cheers,
 Norm.
 

Pennel says that (A6,A4) points to the start of data and (A6,A5) points to 
immediately past the data area end. This implies that the size of the data 
space is A5 - A4.

Having experimented with a program having no parameter list and no channels on 
being executed, I found that there always was an excess of A5 - A4 over the 
data space requested in the program. In my case the excess was always positive, 
always even and never 42. The excess ranged from 12 to 34.

George

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


Re: [Ql-Users] Job data space - foibles?

2013-10-08 Thread Norman Dunbar

On 07/10/13 21:18, Lee Privett wrote:


PRINT the_answer_to_life_the_universe_and_everything

 ...

Ok, I'm game 

PRINT the_answer_to_life_the_universe_and_everything
0

Print CODE(0)
48

What am I missing?

--
Norman Dunbar
Dunbar IT Consultants Ltd

Registered address:
27a Lidget Hill
Pudsey
West Yorkshire
United Kingdom
LS28 7LG

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


Re: [Ql-Users] Programming in Assembler

2013-10-08 Thread Norman Dunbar

Hi Jochen,

On 07/10/13 23:43, jms1 wrote:

Please include me in your mailing of further instalments of Programming
in Assembler


if you go here 
http://qdosmsq.dunbar-it.co.uk/doku.php#assembly_language_mailing_list 
there are details on how to subscribe - copied below:



Assembly Language Mailing List

 With the [impending] demise of the last, known, surviving QL magazine 
in print, there is unlikely to be a printed copy of the remainder of my 
series on Assembly Language.


 As the series is not yet finished, and we are slap bang in the middle 
of a new (potentially useful) LibGen utility, my long time reader(s) may 
wish to complete the application. If so, please subscribe to my mailing 
list so that you can be kept up to date as and when I create new articles.


 The hope is that I will send out an email to all subscribers who wish 
to follow the series, and the email will contain a link to a pdf version 
of the article.


 I also have plans to combine everything done so far over the years 
into a “book” and make that available for download too. That work is 
quite close to completion.


You can subscribe at http://qdosmsq.dunbar-it.co.uk/mailinglist. Please 
note, that I ask for your name as part of the subscription process, this 
is to try and stop spam bots from subscribing. I get a lot of those.



You click the link and the on the next link that says subscribe to our 
newsletters.


Then you fill in all the details requested in red. And tick the box to 
indicate that yo want to subscribe to the QDOSMSQ Assembly Language 
newsletter and click the subscribe button. (Phew!)



Cheers,
Norm.

--
Norman Dunbar
Dunbar IT Consultants Ltd

Registered address:
27a Lidget Hill
Pudsey
West Yorkshire
United Kingdom
LS28 7LG

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


Re: [Ql-Users] Programming in Assembler

2013-10-08 Thread Norman Dunbar

On 07/10/13 23:43, jms1 wrote:

Please include me in your mailing of further instalments of Programming
in Assembler


PS. Then you get an email sent to you asking you to confirm your 
subscription request. If you don't get one, it will be in your spam 
bucket and you may need to whitelist me.



Cheers,
Norm.

--
Norman Dunbar
Dunbar IT Consultants Ltd

Registered address:
27a Lidget Hill
Pudsey
West Yorkshire
United Kingdom
LS28 7LG

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


Re: [Ql-Users] Job data space - foibles?

2013-10-08 Thread Norman Dunbar

On 08/10/13 17:21, George Gwilt wrote:

Pennel says that (A6,A4) points to the start of data and (A6,A5) points to 
immediately past the data area end. This implies that the size of the data 
space is A5 - A4.


Yes, A4 is actually the program size, which in my case is 30 bytes only. 
It's not a complicated program:


begin   bra.s   start
dc.l0
dc.w$4afb
dc.w8
dc.b'Test Job'

start   moveq   #8,d0
moveq   #-1,d1
moveq   #10,d3
suba.l  a1,a1
trap#1
bra.s   start

Assembled with GWASL I get a file of 30 bytes and a data space of 4000.

What Marcel (and you) say makes perfect sense. If the job starts at the 
address A6 points to, and is 30 bytes long, then the start of the data 
space must be A6+30 and as A4 holds the value $1e, that's correct.


I would imagine that A5, on the other hand should hold the address of 
A6+30+4000 which would be correct in my case, but I get the extra 12 bytes.


4000 is exactly divisible by 2, 4, 8, 16 or 32 in the powers of two 
range. I think QDOSMSQ rounds some memory allocations to the next 8 but 
I can't remember if it rounds anything to the next 16.


4030 is divisible by 2.

4042 is divisible by 2, and not much else!

Maybe it's to do with the size of the code file on disc? I changed the 
source to add a buffer of 64 words, taking me up to a file size of 158 
bytes.


This time, when executed, A4 is $9E (aka 158) which is exactly the size 
of the code file, as expected. A5 is 4000+158+12, which is exactly 12 
bytes more than the data + code size - and matches up to what I was 
already seeing.


In my code size 30 example, I get 42 which is an extra 12 as well. 
What's so special about 12 I wonder?


insert delay while I rummage in the source code

Right, it must be something in the allocation of memory. I found the 
code that creates a job and it simply allocates memory for 
#jcb_end+d2+d3 and jcb_end is $68. This is what it requests of the 
memory allocation code - so whatever is being allocated must be coming 
from that.


I can live with this. It was something unusual that I came across, and I 
think it's explained adequately now.


Thanks to all who replied.


Cheers,
Norm.

--
Norman Dunbar
Dunbar IT Consultants Ltd

Registered address:
27a Lidget Hill
Pudsey
West Yorkshire
United Kingdom
LS28 7LG

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


Re: [Ql-Users] Job data space - foibles?

2013-10-08 Thread Lee
Hee he, it has to be on a standard QL Norman.
Or on QemuLator standard QL settings
You shouldn't get a 0, but another *

Sent from my iPad

 On 8 Oct 2013, at 17:56, Norman Dunbar nor...@dunbar-it.co.uk wrote:
 
 universe
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm