QSET User Queue

Anything QL Software or Programming Related.
Post Reply
tcat
Super Gold Card
Posts: 633
Joined: Fri Jan 18, 2013 5:27 pm
Location: Prague, Czech Republic

QSET User Queue

Post 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
Last edited by tcat on Thu Jun 26, 2014 8:00 am, edited 2 times in total.


User avatar
tofro
Font of All Knowledge
Posts: 3091
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: QSET User Queue

Post 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


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
tcat
Super Gold Card
Posts: 633
Joined: Fri Jan 18, 2013 5:27 pm
Location: Prague, Czech Republic

Re: QSET User Queue

Post 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


Post Reply