UT_MTEXT/UT_WTEXT - Vector $D0
This vector sends text to a channel.
Call Parameters | Return Parameters | ||
---|---|---|---|
D0.L | Unused | D0.L | Error code. |
D1.L | Unused | D1.L | Corrupted. |
D2.L | Unused | D2.L | Corrupted. |
D3.L | Unused | D3.L | 0 or -1 |
A0.L | Channel ID | A0.L | Preserved. |
A1.L | Pointer to text | A1.L | Corrupted. |
A2.L | Unused | A2.L | Corrupted. |
A3.L | Unused | A3.L | Corrupted. |
Errors
ERR_NC | Not complete (only for A0=0) |
ERR_NO | Channel not open |
ERR_DF | Drive full |
Notes
- 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.
Example
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