QDOS Internals

Anything you never knew you wanted to know about the Sinclair QL.

User Tools

Site Tools



These vectors set an ASCII string for date (CN_DATE/CV_ILDAT) and day (CN_DAY/CV_DAY).

Call ParametersReturn Parameters
D1.LDate (internal value). D1.LPreserved.
A1.LPointer to maths stack. A1.LUpdated.


No errors are returned by this vector call.


  • All registers not shown above are not used on entry and are preserved on exit.
  • A1 points to the maths stack relative to A6.
  • On return (A1,A6.L) points to the ASCII string created by the vectors. The string is in the normal form of a word giving the length followed by the ASCII characters.
  • The date is returned in the form yyyy mmmm dd hh:mm:ss.
  • The day is returned as a three letter day of the week.
  • CN_DATE/CV_ILDAT requires at least 22 bytes on the stack. CN_DAY/CV_ILDAY requires at least 6 bytes.


The example below shows the use of these vectors to set the date followed by the day. We suppose that A6.L points to the data space. The example uses the trap #1 routine MT_RCLCK.

mst     equ     30+6            ; Space for date and day.

Get_dte moveq   #MT_RCLCK,d0    ; To read the clock.
        trap    #1              ; D1.L contains the date.
        lea     mst,a1          ; End of stack.
        movea.w CN_DAY,a2       ; CN_DAY vector address.
	jsr	(a2)		; ASCII day at (A1,A6.L)
	movea.w CN_DATE,a2      ; CN_DATE vector address.
	jsr	(a2)		; ASCII date at (A1,A6.L)
        lea     (a1,a6.l),a4    ; Set the address of "date" to A4

qdosmsq/vectors/ildat.txt · Last modified: 2009/02/25 16:22 by george.gwilt