qdosmsq:vectors:wtext

UT_MTEXT/UT_WTEXT - Vector $D0

This vector sends text to a channel.

Call ParametersReturn Parameters
D0.LUnused D0.LError code.
D1.LUnused D1.LCorrupted.
D2.LUnused D2.LCorrupted.
D3.LUnused D3.L0 or -1
A0.LChannel ID A0.LPreserved.
A1.LPointer to text A1.LCorrupted.
A2.LUnused A2.LCorrupted.
A3.LUnused A3.LCorrupted.
ERR_NCNot complete (only for A0=0)
ERR_NOChannel not open
ERR_DFDrive full
  • All registers not shown above are not used on entry and are preserved on exit.
  • If A0 = 0, the channel is #0. If this channel is in use #1 is tried. Although not recommended by Sinclair it seems to work.
  • If A0 = 0, D3 is set to 0 on exit, otherwise D3 is -1.
  • As is usual D0 is tested before exit except for QDOS versions 1.03 and earlier.
  • The text to which A1 points is in the usual form, a word containing the length followed by that number of characters.
  • A programmer who wants LF at the end of the string must include it.

The example below shows the use of this vector to print a message.

Prt     movea.w UT_MTEXT,a2     ; UT_MTEXT vector address.
        lea     mess,a1         ; Address of message.
	jsr	(a2)		; Print the message
	bne.s	Error_handler	; Oops! (QDOS versions later than 1.03)
        rts

mess    dc.w    6
        dc.b    'Hello',10
  • qdosmsq/vectors/wtext.txt
  • Last modified: 2009/02/11 15:23
  • by george.gwilt