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
