Page 1 of 1

QSET User Queue

Posted: Mon Jun 23, 2014 3:24 pm
by tcat
Hi All,

I am trying to process some data in a user queue, and I realised I need some help.
I found a vectored QL routine IO.QSET, that beleive is ideal for that, but I am not sure how to pass parameters to it.

My understatnding is that a queue has a 16 byte header, followed by actual queue data.
Providing this piece of code is alright.

Code: Select all

* reserve 48 byte queue + header
q_hdr    ds.b      16
q_dta    ds.b      48
*
         movea.w   $DC,a1
         lea       q_hdr(pc),a2
         moveq     #48,d1
         jsr       (a1)
         tst.l     d0               ; is this test needed?
         bne.s     error_no_queue
*
Question is, what reference do I pass to IO.QIN and IO.QOUT routines in register A2, to read or write data?
Do I pass reference to the queue as q_dta(pc) or q_hdr(pc)?

Many thanks
Tom

Re: QSET User Queue

Posted: Tue Jun 24, 2014 5:45 pm
by tofro
Tom,

you need to pass the absolute beginning of the queue data structure. The queue routines need to be able to fiddle with the header. (so pass the header address, just like you do with io.qset)

Tobias

Re: QSET User Queue

Posted: Wed Jun 25, 2014 8:21 am
by tcat
Toby,

Thank you, I can now porcess data in queue.
I realised to get 48 bytes in queue I need to allow for the header as well, I therefore pass 48 to the routine, and I have to reserve 48+16 in memory for it, right?

Updated the code above in this respect.

Tom