home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 3
/
AACD03.BIN
/
AACD
/
Utilities
/
BackClock
/
sources
/
backclock
/
dtb.s
< prev
next >
Wrap
Text File
|
1999-08-04
|
1KB
|
66 lines
incdir asmone:
include devpacmacros.i
include stormc:source/horloge/dtb.i
XDEF _DateToByte
*******************************************************************************
*
* _DateToByte
* convertit une chaine ascii en octets
*
* entrée:
* a0 : adresse de la chaine ASCII
* a1 : adresse de la structure idWin
*
*******************************************************************************
;d5 h
;d6 m
;d7 s
; section prg,code
_DateToByte
movem.l d0-d7/a0-a6,-(a7)
move.w (a0)+,d5
move.b (a0)+,d7
move.w (a0)+,d6
move.b (a0)+,d7
move.w (a0)+,d7
move.w d5,d0
bsr.s convert
move.w d0,heu(a1)
move.w d6,d0
bsr.s convert
move.w d0,min(a1)
move.w d7,d0
bsr.s convert
move.w d0,sec(a1)
movem.l (a7)+,d0-d7/a0-a6
rts
convert
; e :d0 uword (ascii)
; s :d0 ubyte (hex)
movem.l d1-d2,-(a7)
move.w d0,d2
lsr #8,d2
and.b #$f,d2
moveq #0,d3
move.b d2,d3
lsl #4,d2
move.w d0,d1
and.w #$f,d1
or.b d2,d1
move.w d1,d0
tst.b d3
beq.s .ok
sub.b #1,d3
.dec1 sub.b #6,d0
dbra d3,.dec1
.ok movem.l (a7)+,d1-d2
rts