home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
300-399
/
ff390.lzh
/
SetClock
/
RWSClock.asm
< prev
next >
Wrap
Assembly Source File
|
1990-10-23
|
3KB
|
127 lines
;.PAGE 'Assembly language module for SetClock'
; Author: Willi Kusche
; P. O. Box 456
; Bellmawr, NJ 08099
;
; Macros
;
XLIB MACRO
XREF _LVO\1
ENDM
JSRLIB MACRO
JSR _LVO\1(A6)
ENDM
;
; EXEC calls
;
XLIB Forbid
XLIB Permit
;
; DOS calls via Pascal stub
;
XREF _Delay
;
; Entry point
;
XDEF _WriteSClock
XDEF _ReadSClock
;.PAGE 'Set the Spirit clock'
;
;
;
_WriteSClock
LINK A5,#0
MOVE.L #$00DC0FF0,A2
MOVEQ #0,D0
MOVEQ #1,D1
MOVE.B #$80,1(A2)
MOVE.B D0,3(A2)
MOVE.B D0,5(A2)
MOVE.B #$80,7(A2)
MOVE.B D1,9(A2)
MOVE.B D1,11(A2)
MOVE.B D1,13(A2)
MOVE.B #$87,15(A2)
MOVE.B #0,1(A2)
PEA 104
JSR _Delay
LEA 4(SP),SP
MOVEQ #0,D0
MOVEQ #1,D1
MOVE.B #$80,1(A2)
MOVE.B D0,3(A2)
MOVE.B D0,5(A2)
MOVE.B D0,7(A2)
MOVE.B D1,9(A2)
MOVE.B D1,11(A2)
MOVE.B D1,13(A2)
MOVE.B #$87,15(A2)
MOVE.B #0,1(A2)
JSRLIB Forbid
OR.B #$80,$00DC0FF1
MOVE.L #$00DC0FF3,A3
MOVE.B 31(A5),(A3) ; Set seconds
MOVE.B 27(A5),2(A3) ; Set minutes
MOVE.B 23(A5),4(A3) ; Set hours
MOVE.B 19(A5),8(A3) ; Set day
MOVE.B 15(A5),10(A3) ; Set month
MOVE.B 11(A5),12(A3) ; Set year
AND.B #$7F,$00DC0FF1
MOVE.L 4,A6
JSRLIB Permit
MOVEQ #0,D0
UNLK A5
RTS
;.PAGE 'Read the Spirit clock'
;
;
;
_ReadSClock
LINK A5,#0
MOVE.L 4,A6
JSRLIB Forbid
SUBQ.L #8,SP
MOVE.L #$00DC0FF1,A4
MOVE.B 12(A4),D0
CMP.B 12(A4),D0
BEQ.S 1$
CMP.B 12(A4),D0
BNE ClockNotFound
1$ AND.B #$E0,D0
BNE ClockNotFound
MOVE.B 8(A4),D0
AND.B #$B8,D0
BNE ClockNotFound
OR.B #$40,(A4)
MOVE.L SP,A1
MOVE.L A4,A0
MOVEQ #7,D1
2$ MOVE.B (A0),(A1)+
ADDQ.L #2,A0
DBRA D1,2$
AND.B #$BF,(A4)
BRA Perm
ClockNotFound
MOVE.B #$99,1(SP)
Perm JSRLIB Permit
MOVE.L 8(A5),A0
MOVEQ #5,D0
MOVEQ #0,D1
1$ MOVE.L D1,(A0)+
DBRA D0,1$
MOVE.L 8(A5),A0
MOVE.B 7(SP),3(A0)
MOVE.B 6(SP),7(A0)
MOVE.B 5(SP),11(A0)
MOVE.B 3(SP),15(A0)
MOVE.B 2(SP),19(A0)
MOVE.B 1(SP),23(A0)
ADDQ.L #8,SP
UNLK A5
RTS
;
;
;
END