24.12.2013 Views

TOPS-10 Monitor Calls Manual Volume 2 AA-K039D ... - Trailing-Edge

TOPS-10 Monitor Calls Manual Volume 2 AA-K039D ... - Trailing-Edge

TOPS-10 Monitor Calls Manual Volume 2 AA-K039D ... - Trailing-Edge

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

DATE [CALLI 14]<br />

22.21 DATE [CALLI 14]<br />

FUNCTION<br />

Returns a code giving the system date.<br />

by the formula:<br />

The code is an<br />

integer given<br />

code = 31[12(year-1964)+(month-1) ]+(day-l)<br />

You can obtain the current day, month, and year using the formulas:<br />

day<br />

month<br />

year<br />

mod(code,31)+1<br />

mod(code/31,12)+1<br />

(code/372)+1964<br />

The DATE call is equivalent to using GETTAB to obtain item %CNDAT.<br />

The day, month, and year are stored in GETTAB items %CNDAY, %CNMON,<br />

and %CNYER, respectively. Your program can avoid the computations<br />

needed to interpret the data returned from the DATE call by GETTABing<br />

the specific items, but the efficient program will avoid performing<br />

three separate GETTAB calls by GETTABing %CNDAT and then dividing the<br />

data into its appropriate components.<br />

CALLING SEQUENCE<br />

DATE<br />

return<br />

ac,<br />

EXAMPLE<br />

The following macro computes the current day, month, and year.<br />

DEFINE<br />

CURDAT(DAY,MONTH,YEAR)<<br />

DATE T1,<br />

IDIVI T1,AD31<br />

ADDI T2,1<br />

MOVEM<br />

IDIVI<br />

T2,DAY<br />

Tl,AD12<br />

ADDI T2,1<br />

MOVEM<br />

ADDI<br />

T2,MONTH<br />

TI,AD1964<br />

MOVEM T1,YEAR<br />

><br />

RELATED CALLS<br />

TIMER<br />

22-48

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!