Thanks for the quick response, seems that apart from a lesson in coding it wasn't that far off the mark! I think I could perhaps have added a 'WMAN' function as well to test if the window manager is present (e.g. QDOS user only installed ptr_gen) since the test for window manager is also part of ptr.inf trap return IIRC.
The whole point of this was to make some extensions which would run on QDOS systems as well, so that a program could test its environment at startup and set itself up accordingly. For example, a graphics program could set itself up differently (more facilities? or which default startup screen mode) if GD2 was found at startup. Thanks for your help Marcel. Dilwyn Jones Marcel Kilgus wrote: > Dilwyn Jones wrote: > > clr.w d0 ;position in linkage to set > > Should be clr.w d1 of course. Though I think it doesn't really matter. > > > clr.w d2 ;no bytes to be set (read only) > > moveq.w #-1,d3 ;infinite timeout > > ;find channel ID for window number passed and put in a0 > > clr.l a1 ;pointer to data to set, in this case none as it's read only > > move.w #$6f,d0 ;iop.slnk ($6f=dec.111) > > I suggest to *always* use symbolic names instead of direct numbers. > Especially with things like the PTR2 offset and flag later on. > In this case one would include the following files for example: > include 'dev8_keys_qdos_io' > include 'dev8_keys_con' > > The command can then be written as > moveq #iop.slnk,d0 > > > trap #3 > > tst.w d0 ;any error such as channel not open > > Error returns are long. Though it doesn't make much difference in > practice, it'd be cleaner to use "tst.l d0".