qdosmsq:traps:trap_3:xtop

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

qdosmsq:traps:trap_3:xtop [2009/05/21 11:18] (current)
george.gwilt created
Line 1: Line 1:
 +====== SD_EXTOP/​IOW_XTOP ======
 +
 +====== MT_INF/​SMS_INFO ======
 +This trap calls an extended operation.
 +
 +^Call Parameters^^Return Parameters^^
 +|D0.B|$09|D0.L|Error return.|
 +|D1.L|Parameter |D1.L|Returned parameter.|
 +|D2.L|Parameter |D2.L|Preserved.|
 +|D3.W|Timeout|D3.L|Preserved.|
 +|A0.L|Channel ID |A0.L|Preserved.|
 +|A1.L|Parameter|A1.L|Returned parameter.|
 +|A2.L|Address of routine|A2.L|Preserved.|
 +===== Errors =====
 +
 +|ERR_NC|Not complete.|
 +|ERR_NO|Channel not open.|
 +
 +
 +===== Notes =====
 +  * All registers not shown above are not used on entry and are preserved on exit.
 +  * This trap allows additional functions to be added to screen drivers.
 +  * At entry A0.L points to the channel definition block and must not be altered by the routine. Note that if the Pointer Environment is present this address is $30 bytes after the start of the channel block.
 +  * At entry A6.L points to the system variables and must not be altered by the routine.
 +  * Parameters can be passed to the called routine in D1.L, D2.L and A1.L. Parameters can be returned by the routine in D1.L and A1.L.
 +  * The routine is executed in supervisor mode and must end with RTS with D0.L containing the error return and the condition codes set accordingly.
 +===== Example =====
 +The example below shows the use of this trap call to alter the character height. This was suggested by Andrew Pennel in The Sinclair QDOS Companion. It is assumed that A0 contains the window'​s ID.
 +
 +Note that the address sd_yinc(a0) will correctly access the height increment in the channel block whether PE is present or not.
 +
 +<​code>​
 +chhgt   ​moveq ​  #​sd_extop,​d0 ​   ; $09
 +        lea     ​conext,​a2 ​      ; EXTOP routine
 +        moveq   #​-1,​d3 ​         ; Timeout
 +        trap    #3              ; Do the routine
 +
 +conext ​ move.w ​ #​9,​sd_yinc(a0) ​ ; Set the height increment
 +        moveq   #​0,​d0 ​          ; No error
 +        rts
 +</​code>​
 +
  
  • qdosmsq/traps/trap_3/xtop.txt
  • Last modified: 2009/05/21 11:18
  • by george.gwilt