home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 19
/
AACD19.BIN
/
CDTools
/
Viewers
/
Flick
/
src
/
math64.s
< prev
next >
Wrap
Text File
|
1994-11-15
|
832b
|
40 lines
; void __asm add64 (register __a0 struct EClockVal *dst,
; register __a1 struct EClockVal *src);
; void __asm sub64 (register __a0 struct EClockVal *dst,
; register __a1 struct EClockVal *src);
; int __asm cmp64 (register __a0 struct EClockVal *dst,
; register __a1 struct EClockVal *src);
xdef _add64
xdef _sub64
xdef _cmp64
_add64: addq.l #4,a1
addq.l #4,a0
move.l (a1),d0
add.l d0,(a0)
addx.l -(a1),-(a0)
rts
_sub64: addq.l #4,a1
addq.l #4,a0
move.l (a1),d0
sub.l d0,(a0) ; dst->lo - src->lo
subx.l -(a1),-(a0) ; dst->hi - src->hi
rts
_cmp64: cmpm.l (a1)+,(a0)+ ; (a0)-(a1), dst->hi - src->hi
bne.b 1$
cmpm.l (a1)+,(a0)+ ; dst->lo - src->lo
bne.b 1$
moveq #0,d0
rts
1$: bpl.b 2$
moveq #1,d0
rts
2$: moveq #-1,d0
rts
end