28 |
|
XDEF _AtomicAnd |
29 |
|
XDEF _AtomicOr |
30 |
|
XDEF _MoveVBR |
31 |
– |
XDEF _TimevalTo64 |
32 |
– |
XDEF _TimevalToMacTime |
31 |
|
XDEF _Execute68k |
32 |
|
XDEF _Execute68kTrap |
33 |
|
XDEF _TrapHandlerAsm |
106 |
|
rte |
107 |
|
|
108 |
|
* |
111 |
– |
* Convert timeval to 64 bit microseconds |
112 |
– |
* |
113 |
– |
|
114 |
– |
_TimevalTo64 move.l 4(sp),a0 ;Pointer to timeval |
115 |
– |
move.l 8(sp),a1 ;Pointer to high longword of result, low longword is returned in d0 |
116 |
– |
|
117 |
– |
move.l d2,-(sp) |
118 |
– |
|
119 |
– |
move.l TV_SECS(a0),d0 ;Convert to 64 bit microseconds |
120 |
– |
mulu.l #1000000,d1:d0 |
121 |
– |
add.l TV_MICRO(a0),d0 |
122 |
– |
moveq #0,d2 |
123 |
– |
addx.l d2,d1 |
124 |
– |
move.l d1,(a1) |
125 |
– |
|
126 |
– |
move.l (sp)+,d2 |
127 |
– |
rts |
128 |
– |
|
129 |
– |
* |
130 |
– |
* Convert timeval to Mac time value (>0: milliseconds, <0: microseconds) |
131 |
– |
* |
132 |
– |
|
133 |
– |
_TimevalToMacTime |
134 |
– |
move.l 4(sp),a0 ;Pointer to timeval |
135 |
– |
|
136 |
– |
move.l d2,-(sp) |
137 |
– |
|
138 |
– |
move.l TV_SECS(a0),d0 ;Convert to 64 bit microseconds |
139 |
– |
mulu.l #1000000,d1:d0 |
140 |
– |
add.l TV_MICRO(a0),d0 |
141 |
– |
moveq #0,d2 |
142 |
– |
addx.l d2,d1 |
143 |
– |
|
144 |
– |
tst.l d1 ;Too large for 32 bit microseconds? |
145 |
– |
bne.s 1$ |
146 |
– |
cmp.l #$7fffffff,d0 |
147 |
– |
bhi.s 1$ |
148 |
– |
|
149 |
– |
neg.l d0 ;No, return negative microseconds |
150 |
– |
bra.s 2$ |
151 |
– |
|
152 |
– |
1$ divu.l #1000,d1:d0 ;Yes, return milliseconds |
153 |
– |
|
154 |
– |
2$ move.l (sp)+,d2 |
155 |
– |
rts |
156 |
– |
|
157 |
– |
* |
109 |
|
* Execute 68k subroutine (must be ended with rts) |
110 |
|
* r->a[7] and r->sr are unused! |
111 |
|
* |