.ENABL LC .TITLE RTIME Set RT11 system date/time .MCALL .EXIT,.SDTTM .IDENT /1.1/ .GLOBL JTIME,RTIME ; ; If your board has non-standard clock addresses, you should ; change the next line ... ; $CLOK == 177300 ; 1st of 16 calendar clock registers ; ; If your board has a watchdog timer, you should disable the ; next line, and enable the one following it; if your watchdog ; reset register is at a non-standard address, change "177342" to ; the appropriate value ... ; $WDOG == 177560 ; Read a "safe" address ;$WDOG == 177342 ; Reset the w'dog by reading this address ; ; If your board does not have CMOS RAM, the following lines ; can be left as they are; if it has CMOS RAM with standard ; addressing, they can be left as they are; if it has CMOS RAM ; with non-standard addressing, you must change the following ; lines ... ; RAM = 166000 ; 1st location of CMOS RAM $YEAR == RAM + 776 ; Two parameters used $INCY == RAM + 772 ; to maintain the year in 58174s $PAGE == 177342 ; CMOS RAM page select register BEGIN: MOV #ARGS,R5 ; R5 --> argument list JSR PC,RTIME ; Call RTIME routine MOV (R5)+,R2 ; Get year since 1972 in <04:00>, SUB #72.,R2 ; MOV (R5)+,R0 ; plus month of year in <13:10>, MOV #2000,R1 ; JSR PC,$MUL ; BIS R1,R2 ; MOV (R5)+,R0 ; plus day of month in <09:05> MOV #40,R1 ; JSR PC,$MUL ; BIS R1,R2 ; MOV R2,RTDTM ; Date is 1st word in RT list MOV #JHR,R0 ; MOV (R5)+,(R0)+ ; Copy hours for CALL JTIME MOV (R5)+,(R0)+ ; Copy minutes MOV (R5)+,(R0)+ ; Copy seconds CLR (R0)+ ; No ticks for now MOV #JARGS,R5 ; JSR PC,JTIME ; Convert to RT-style 32-bit integer .SDTTM #AREA,#RTDTM ; .EXIT $MUL: MOV R0,-(SP) ; Save the multiplicand MOV #17.,-(SP) ; Load number of bit shifts CLR R0 ; Init the product 5$: ROR R0 ; Rotate product ROR R1 ; Rotate multiplier BCC 10$ ; Add if bit is set ADD 2(SP),R0 ; 10$: DEC (SP) ; Count bits BGT 5$ ; CMP (SP)+,(SP)+ ; Clean stack RTS PC AREA: .BLKW 2 ARGS: .BYTE 1,0 .WORD DATIME DATIME: .BLKW 9. JARGS: .BYTE 5,0 .WORD JHR .WORD JMI .WORD JSE .WORD JTI .WORD RTDTM+2 JHR: .BLKW 1 JMI: .BLKW 1 JSE: .BLKW 1 JTI: .BLKW 1 RTDTM: .BLKW 3 .END BEGIN