langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
19
Task/Date-format/XPL0/date-format.xpl0
Normal file
19
Task/Date-format/XPL0/date-format.xpl0
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
include c:\cxpl\codes;
|
||||
int CpuReg, Year, Month, Day, DName, MName, WDay;
|
||||
[CpuReg:= GetReg; \access CPU registers
|
||||
CpuReg(0):= $2A00; \DOS system call
|
||||
SoftInt($21);
|
||||
Year:= CpuReg(2);
|
||||
Month:= CpuReg(3) >> 8;
|
||||
Day:= CpuReg(3) & $FF;
|
||||
WDay:= CpuReg(0) & $FF;
|
||||
IntOut(0, Year); ChOut(0, ^-);
|
||||
if Month<10 then ChOut(0, ^0); IntOut(0, Month); ChOut(0, ^-);
|
||||
if Day<10 then ChOut(0, ^0); IntOut(0, Day); CrLf(0);
|
||||
DName:= ["Sunday", "Monday", "Tuesday", "Wednesday",
|
||||
"Thursday", "Friday", "Saturday"];
|
||||
MName:= [0, "January", "February", "March", "April", "May", "June", "July",
|
||||
"August", "September", "October", "November", "December"];
|
||||
Text(0, DName(WDay)); Text(0, ", "); Text(0, MName(Month)); Text(0, " ");
|
||||
IntOut(0, Day); Text(0, ", "); IntOut(0, Year); CrLf(0);
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue