Norman Dunbar wrote:
> 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.
Wrong. As I wrote, the caller of sms.crjb must be the culprit. You
wrote you used EX to call the job, so we now look at that:
win1_sbsext_ext_exsbas_bas
prog_create
move.l a0,a4 save channel id
move.l job_id(sp),d1 owned by 0 or previous job
move.l d7,d3 number of files
addq.l #3,d3 plus two pipes (and two counts)
lsl.l #2,d3 *4
add.l d5,d3 plus string length
add.l d0,d3 plus data space required
moveq #sms.crjb,d0 create job
trap #1
EX adds 12 bytes for "two pipes (and two counts)". Reading the source
the counts seem to refer to two words counting the number of channels
and the bytes of the command string (EX test_exe;'command string').
Now that we have found this out the next thought must be "wow, this
standard must surely be documented somewhere", and lo and behold, it
is (QDOS/SMS reference manual, section 3):
(A6,A5) | Command string length(word) + bytes |
| |
| Channel ID long |
| Channel ID long |
| " |
| " |
| Channel ID long |
| |
(A7) | Number of Channel IDs word |
| |
(A6,A4) | Data area |
| |
| Code area |
| |
| Job name length(word) + bytes |
| |
| $4AFB word |
| |
(A6) | JMP.L JOB_START |
Morale of the story: I should have looked at the documentation first
;-)
Marcel
_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm