12#define CRT_LOWORD(x) dword ptr [x+0]
13#define CRT_HIWORD(x) dword ptr [x+4]
15 __declspec(naked)
void _alldiv()
26; Determine sign of the result (edi = 0
if result is positive, non-zero
27; otherwise) and make operands positive.
29 xor edi,edi ; result sign assumed positive
31 mov eax,CRT_HIWORD(DVND) ; hi word of a
32 or eax,eax ; test to see
if signed
33 jge
short L1 ; skip rest
if a is already positive
34 inc edi ; complement result sign flag
35 mov edx,CRT_LOWORD(DVND) ; lo word of a
36 neg eax ; make a positive
39 mov CRT_HIWORD(DVND),eax ; save positive
value
40 mov CRT_LOWORD(DVND),edx
42 mov eax,CRT_HIWORD(DVSR) ; hi word of b
43 or eax,eax ; test to see
if signed
44 jge
short L2 ; skip rest
if b is already positive
45 inc edi ; complement the result sign flag
46 mov edx,CRT_LOWORD(DVSR) ; lo word of a
47 neg eax ; make b positive
50 mov CRT_HIWORD(DVSR),eax ; save positive
value
51 mov CRT_LOWORD(DVSR),edx
55; Now
do the divide. First look to see
if the divisor is less than 4194304K.
56; If so, then we can use a simple algorithm with word divides, otherwise
57; things get a little more complex.
59; NOTE - eax currently contains the high order word of DVSR
62 or eax,eax ; check to see
if divisor < 4194304K
63 jnz
short L3 ; nope, gotta
do this the hard way
64 mov ecx,CRT_LOWORD(DVSR) ; load divisor
65 mov eax,CRT_HIWORD(DVND) ; load high word of dividend
67 div ecx ; eax <- high order bits of quotient
68 mov ebx,eax ; save high bits of quotient
69 mov eax,CRT_LOWORD(DVND) ; edx:eax <- remainder:lo word of dividend
70 div ecx ; eax <- low order bits of quotient
71 mov edx,ebx ; edx:eax <- quotient
72 jmp
short L4 ; set sign, restore stack and return
75; Here we
do it the hard way. Remember, eax contains the high word of DVSR
79 mov ebx,eax ; ebx:ecx <- divisor
80 mov ecx,CRT_LOWORD(DVSR)
81 mov edx,CRT_HIWORD(DVND) ; edx:eax <- dividend
82 mov eax,CRT_LOWORD(DVND)
84 shr ebx,1 ; shift divisor right one bit
86 shr edx,1 ; shift dividend right one bit
89 jnz
short L5 ; loop until divisor < 4194304K
90 div ecx ; now divide, ignore remainder
91 mov esi,eax ; save quotient
94; We may be off by one, so to check, we will multiply the quotient
95; by the divisor and check the result against the orignal dividend
96; Note that we must also check
for overflow, which can occur
if the
97; dividend is close to 2**64 and the quotient is off by 1.
100 mul CRT_HIWORD(DVSR) ; QUOT * CRT_HIWORD(DVSR)
102 mov eax,CRT_LOWORD(DVSR)
103 mul esi ; QUOT * CRT_LOWORD(DVSR)
104 add edx,ecx ; EDX:EAX = QUOT * DVSR
105 jc
short L6 ; carry means Quotient is off by 1
108;
do long compare here between original dividend and the result of the
109; multiply in edx:eax. If original is larger or equal, we are ok, otherwise
110; subtract one (1) from the quotient.
113 cmp edx,CRT_HIWORD(DVND) ; compare hi words of result and original
114 ja
short L6 ; if result > original, do subtract
115 jb
short L7 ; if result < original, we are ok
116 cmp eax,CRT_LOWORD(DVND) ; hi words are equal, compare lo words
117 jbe
short L7 ; if less or equal we are ok, else subtract
119 dec esi ; subtract 1 from quotient
121 xor edx,edx ; edx:eax <- quotient
125; Just the cleanup left to do. edx:eax contains the quotient. Set the sign
126; according to the save
value, cleanup the stack, and return.
130 dec edi ; check to see if result is negative
131 jnz
short L8 ; if EDI == 0, result should be negative
132 neg edx ; otherwise, negate the result
137; Restore the saved registers and return.
152 __declspec(naked)
void _alldvrm()
154 #define DVND esp + 16
155 #define DVSR esp + 24
163; Determine sign of the quotient (edi = 0
if result is positive, non-zero
164; otherwise) and make operands positive.
165; Sign of the remainder is kept in ebp.
167 xor edi,edi ; result sign assumed positive
168 xor ebp,ebp ; result sign assumed positive
170 mov eax,CRT_HIWORD(DVND) ; hi word of a
171 or eax,eax ; test to see
if signed
172 jge
short L1 ; skip rest
if a is already positive
173 inc edi ; complement result sign flag
174 inc ebp ; complement result sign flag
175 mov edx,CRT_LOWORD(DVND) ; lo word of a
176 neg eax ; make a positive
179 mov CRT_HIWORD(DVND),eax ; save positive
value
180 mov CRT_LOWORD(DVND),edx
182 mov eax,CRT_HIWORD(DVSR) ; hi word of b
183 or eax,eax ; test to see
if signed
184 jge
short L2 ; skip rest
if b is already positive
185 inc edi ; complement the result sign flag
186 mov edx,CRT_LOWORD(DVSR) ; lo word of a
187 neg eax ; make b positive
190 mov CRT_HIWORD(DVSR),eax ; save positive
value
191 mov CRT_LOWORD(DVSR),edx
195; Now
do the divide. First look to see
if the divisor is less than 4194304K.
196; If so, then we can use a simple algorithm with word divides, otherwise
197; things get a little more complex.
199; NOTE - eax currently contains the high order word of DVSR
202 or eax,eax ; check to see
if divisor < 4194304K
203 jnz
short L3 ; nope, gotta
do this the hard way
204 mov ecx,CRT_LOWORD(DVSR) ; load divisor
205 mov eax,CRT_HIWORD(DVND) ; load high word of dividend
207 div ecx ; eax <- high order bits of quotient
208 mov ebx,eax ; save high bits of quotient
209 mov eax,CRT_LOWORD(DVND) ; edx:eax <- remainder:lo word of dividend
210 div ecx ; eax <- low order bits of quotient
211 mov esi,eax ; ebx:esi <- quotient
213; Now we need to
do a multiply so that we can compute the remainder.
215 mov eax,ebx ; set up high word of quotient
216 mul CRT_LOWORD(DVSR) ; CRT_HIWORD(QUOT) * DVSR
217 mov ecx,eax ; save the result in ecx
218 mov eax,esi ; set up low word of quotient
219 mul CRT_LOWORD(DVSR) ; CRT_LOWORD(QUOT) * DVSR
220 add edx,ecx ; EDX:EAX = QUOT * DVSR
221 jmp
short L4 ; complete remainder calculation
224; Here we
do it the hard way. Remember, eax contains the high word of DVSR
228 mov ebx,eax ; ebx:ecx <- divisor
229 mov ecx,CRT_LOWORD(DVSR)
230 mov edx,CRT_HIWORD(DVND) ; edx:eax <- dividend
231 mov eax,CRT_LOWORD(DVND)
233 shr ebx,1 ; shift divisor right one bit
235 shr edx,1 ; shift dividend right one bit
238 jnz
short L5 ; loop until divisor < 4194304K
239 div ecx ; now divide, ignore remainder
240 mov esi,eax ; save quotient
243; We may be off by one, so to check, we will multiply the quotient
244; by the divisor and check the result against the orignal dividend
245; Note that we must also check
for overflow, which can occur
if the
246; dividend is close to 2**64 and the quotient is off by 1.
249 mul CRT_HIWORD(DVSR) ; QUOT * CRT_HIWORD(DVSR)
251 mov eax,CRT_LOWORD(DVSR)
252 mul esi ; QUOT * CRT_LOWORD(DVSR)
253 add edx,ecx ; EDX:EAX = QUOT * DVSR
254 jc
short L6 ; carry means Quotient is off by 1
257;
do long compare here between original dividend and the result of the
258; multiply in edx:eax. If original is larger or equal, we are ok, otherwise
259; subtract one (1) from the quotient.
262 cmp edx,CRT_HIWORD(DVND) ; compare hi words of result and original
263 ja
short L6 ; if result > original, do subtract
264 jb
short L7 ; if result < original, we are ok
265 cmp eax,CRT_LOWORD(DVND) ; hi words are equal, compare lo words
266 jbe
short L7 ; if less or equal we are ok, else subtract
268 dec esi ; subtract 1 from quotient
269 sub eax,CRT_LOWORD(DVSR) ; subtract divisor from result
270 sbb edx,CRT_HIWORD(DVSR)
272 xor ebx,ebx ; ebx:esi <- quotient
276; Calculate remainder by subtracting the result from the original dividend.
277; Since the result is already in a register, we will do the subtract in the
278; opposite direction and negate the result if necessary.
281 sub eax,CRT_LOWORD(DVND) ; subtract dividend from result
282 sbb edx,CRT_HIWORD(DVND)
285; Now check the result sign flag to see if the result is supposed to be positive
286; or negative. It is currently negated (because we subtracted in the 'wrong'
287; direction), so if the sign flag is set we are done, otherwise we must negate
288; the result to make it positive again.
291 dec ebp ; check result sign flag
292 jns
short L9 ; result is ok, set up the quotient
293 neg edx ; otherwise, negate the result
298; Now we need to get the quotient into edx:eax and the remainder into ebx:ecx.
308; Just the cleanup left to do. edx:eax contains the quotient. Set the sign
309; according to the save
value, cleanup the stack, and return.
312 dec edi ; check to see if result is negative
313 jnz
short L8 ; if EDI == 0, result should be negative
314 neg edx ; otherwise, negate the result
319; Restore the saved registers and return.
334 __declspec(naked)
void _allmul()
343 mov eax,CRT_HIWORD(A)
344 mov ecx,CRT_LOWORD(B)
345 mul ecx ;eax has AHI, ecx has BLO, so AHI * BLO
346 mov ebx,eax ;save result
348 mov eax,CRT_LOWORD(A)
349 mul CRT_HIWORD(B) ;ALO * BHI
350 add ebx,eax ;ebx = ((ALO * BHI) + (AHI * BLO))
352 mov eax,CRT_LOWORD(A) ;ecx = BLO
353 mul ecx ;so edx:eax = ALO*BLO
354 add edx,ebx ;now edx has all the LO*HI stuff
358 ret 16 ; callee restores the stack
365 __declspec(naked)
void _allrem()
367 #define DVND esp + 12
368 #define DVSR esp + 20
376; Determine sign of the result (edi = 0
if result is positive, non-zero
377; otherwise) and make operands positive.
379 xor edi,edi ; result sign assumed positive
381 mov eax,CRT_HIWORD(DVND) ; hi word of a
382 or eax,eax ; test to see
if signed
383 jge
short L1 ; skip rest
if a is already positive
384 inc edi ; complement result sign flag bit
385 mov edx,CRT_LOWORD(DVND) ; lo word of a
386 neg eax ; make a positive
389 mov CRT_HIWORD(DVND),eax ; save positive
value
390 mov CRT_LOWORD(DVND),edx
392 mov eax,CRT_HIWORD(DVSR) ; hi word of b
393 or eax,eax ; test to see
if signed
394 jge
short L2 ; skip rest
if b is already positive
395 mov edx,CRT_LOWORD(DVSR) ; lo word of b
396 neg eax ; make b positive
399 mov CRT_HIWORD(DVSR),eax ; save positive
value
400 mov CRT_LOWORD(DVSR),edx
404; Now
do the divide. First look to see
if the divisor is less than 4194304K.
405; If so, then we can use a simple algorithm with word divides, otherwise
406; things get a little more complex.
408; NOTE - eax currently contains the high order word of DVSR
411 or eax,eax ; check to see
if divisor < 4194304K
412 jnz
short L3 ; nope, gotta
do this the hard way
413 mov ecx,CRT_LOWORD(DVSR) ; load divisor
414 mov eax,CRT_HIWORD(DVND) ; load high word of dividend
416 div ecx ; edx <- remainder
417 mov eax,CRT_LOWORD(DVND) ; edx:eax <- remainder:lo word of dividend
418 div ecx ; edx <-
final remainder
419 mov eax,edx ; edx:eax <- remainder
421 dec edi ; check result sign flag
422 jns
short L4 ; negate result, restore stack and
return
423 jmp
short L8 ; result sign ok, restore stack and return
426; Here we
do it the hard way. Remember, eax contains the high word of DVSR
430 mov ebx,eax ; ebx:ecx <- divisor
431 mov ecx,CRT_LOWORD(DVSR)
432 mov edx,CRT_HIWORD(DVND) ; edx:eax <- dividend
433 mov eax,CRT_LOWORD(DVND)
435 shr ebx,1 ; shift divisor right one bit
437 shr edx,1 ; shift dividend right one bit
440 jnz
short L5 ; loop until divisor < 4194304K
441 div ecx ; now divide, ignore remainder
444; We may be off by one, so to check, we will multiply the quotient
445; by the divisor and check the result against the orignal dividend
446; Note that we must also check
for overflow, which can occur
if the
447; dividend is close to 2**64 and the quotient is off by 1.
450 mov ecx,eax ; save a copy of quotient in ECX
452 xchg ecx,eax ; save product, get quotient in EAX
454 add edx,ecx ; EDX:EAX = QUOT * DVSR
455 jc
short L6 ; carry means Quotient is off by 1
458;
do long compare here between original dividend and the result of the
459; multiply in edx:eax. If original is larger or equal, we are ok, otherwise
460; subtract the original divisor from the result.
463 cmp edx,CRT_HIWORD(DVND) ; compare hi words of result and original
464 ja
short L6 ;
if result > original,
do subtract
465 jb
short L7 ;
if result < original, we are ok
466 cmp eax,CRT_LOWORD(DVND) ; hi words are equal, compare lo words
467 jbe
short L7 ;
if less or equal we are ok,
else subtract
469 sub eax,CRT_LOWORD(DVSR) ; subtract divisor from result
470 sbb edx,CRT_HIWORD(DVSR)
474; Calculate remainder by subtracting the result from the original dividend.
475; Since the result is already in a
register, we will
do the subtract in the
476; opposite direction and negate the result
if necessary.
479 sub eax,CRT_LOWORD(DVND) ; subtract dividend from result
480 sbb edx,CRT_HIWORD(DVND)
483; Now check the result sign flag to see
if the result is supposed to be positive
484; or negative. It is currently negated (because we subtracted in the
'wrong'
485; direction), so
if the sign flag is set we are done, otherwise we must negate
486; the result to make it positive again.
489 dec edi ; check result sign flag
490 jns
short L8 ; result is ok, restore stack and
return
492 neg edx ; otherwise, negate the result
497; Just the cleanup left to
do. edx:eax contains the quotient.
498; Restore the saved registers and
return.
512 __declspec(naked)
void _allshl()
517;
Handle shifts of 64 or more bits (all get 0)
523;
Handle shifts of between 0 and 31 bits
532;
Handle shifts of between 32 and 63 bits
551 __declspec(naked)
void _allshr()
556;
Handle shifts of 64 bits or more (
if shifting 64 bits or more, the result
557; depends only on the high order bit of edx).
563;
Handle shifts of between 0 and 31 bits
572;
Handle shifts of between 32 and 63 bits
582; Return
double precision 0 or -1, depending on the sign of edx
591 __declspec(naked)
void _aulldiv()
593 #define DVND esp + 12
594 #define DVSR esp + 20
602; Now
do the divide. First look to see
if the divisor is less than 4194304K.
603; If so, then we can use a simple algorithm with word divides, otherwise
604; things get a little more complex.
607 mov eax,CRT_HIWORD(DVSR) ; check to see
if divisor < 4194304K
609 jnz
short L1 ; nope, gotta
do this the hard way
610 mov ecx,CRT_LOWORD(DVSR) ; load divisor
611 mov eax,CRT_HIWORD(DVND) ; load high word of dividend
613 div ecx ; get high order bits of quotient
614 mov ebx,eax ; save high bits of quotient
615 mov eax,CRT_LOWORD(DVND) ; edx:eax <- remainder:lo word of dividend
616 div ecx ; get low order bits of quotient
617 mov edx,ebx ; edx:eax <- quotient hi:quotient lo
618 jmp
short L2 ; restore stack and return
621; Here we
do it the hard way. Remember, eax contains DVSRHI
625 mov ecx,eax ; ecx:ebx <- divisor
626 mov ebx,CRT_LOWORD(DVSR)
627 mov edx,CRT_HIWORD(DVND) ; edx:eax <- dividend
628 mov eax,CRT_LOWORD(DVND)
630 shr ecx,1 ; shift divisor right one bit; hi bit <- 0
632 shr edx,1 ; shift dividend right one bit; hi bit <- 0
635 jnz
short L3 ; loop until divisor < 4194304K
636 div ebx ; now divide, ignore remainder
637 mov esi,eax ; save quotient
640; We may be off by one, so to check, we will multiply the quotient
641; by the divisor and check the result against the orignal dividend
642; Note that we must also check
for overflow, which can occur
if the
643; dividend is close to 2**64 and the quotient is off by 1.
646 mul CRT_HIWORD(DVSR) ; QUOT * CRT_HIWORD(DVSR)
648 mov eax,CRT_LOWORD(DVSR)
649 mul esi ; QUOT * CRT_LOWORD(DVSR)
650 add edx,ecx ; EDX:EAX = QUOT * DVSR
651 jc
short L4 ; carry means Quotient is off by 1
654;
do long compare here between original dividend and the result of the
655; multiply in edx:eax. If original is larger or equal, we are ok, otherwise
656; subtract one (1) from the quotient.
659 cmp edx,CRT_HIWORD(DVND) ; compare hi words of result and original
660 ja
short L4 ; if result > original, do subtract
661 jb
short L5 ; if result < original, we are ok
662 cmp eax,CRT_LOWORD(DVND) ; hi words are equal, compare lo words
663 jbe
short L5 ; if less or equal we are ok, else subtract
665 dec esi ; subtract 1 from quotient
667 xor edx,edx ; edx:eax <- quotient
671; Just the cleanup left to do. edx:eax contains the quotient.
672; Restore the saved registers and return.
687 __declspec(naked)
void _aulldvrm()
690 #define DVSR esp + 16
697; Now
do the divide. First look to see
if the divisor is less than 4194304K.
698; If so, then we can use a simple algorithm with word divides, otherwise
699; things get a little more complex.
702 mov eax,CRT_HIWORD(DVSR) ; check to see
if divisor < 4194304K
704 jnz
short L1 ; nope, gotta
do this the hard way
705 mov ecx,CRT_LOWORD(DVSR) ; load divisor
706 mov eax,CRT_HIWORD(DVND) ; load high word of dividend
708 div ecx ; get high order bits of quotient
709 mov ebx,eax ; save high bits of quotient
710 mov eax,CRT_LOWORD(DVND) ; edx:eax <- remainder:lo word of dividend
711 div ecx ; get low order bits of quotient
712 mov esi,eax ; ebx:esi <- quotient
715; Now we need to
do a multiply so that we can compute the remainder.
717 mov eax,ebx ; set up high word of quotient
718 mul CRT_LOWORD(DVSR) ; CRT_HIWORD(QUOT) * DVSR
719 mov ecx,eax ; save the result in ecx
720 mov eax,esi ; set up low word of quotient
721 mul CRT_LOWORD(DVSR) ; CRT_LOWORD(QUOT) * DVSR
722 add edx,ecx ; EDX:EAX = QUOT * DVSR
723 jmp
short L2 ; complete remainder calculation
726; Here we
do it the hard way. Remember, eax contains DVSRHI
730 mov ecx,eax ; ecx:ebx <- divisor
731 mov ebx,CRT_LOWORD(DVSR)
732 mov edx,CRT_HIWORD(DVND) ; edx:eax <- dividend
733 mov eax,CRT_LOWORD(DVND)
735 shr ecx,1 ; shift divisor right one bit; hi bit <- 0
737 shr edx,1 ; shift dividend right one bit; hi bit <- 0
740 jnz
short L3 ; loop until divisor < 4194304K
741 div ebx ; now divide, ignore remainder
742 mov esi,eax ; save quotient
745; We may be off by one, so to check, we will multiply the quotient
746; by the divisor and check the result against the orignal dividend
747; Note that we must also check
for overflow, which can occur
if the
748; dividend is close to 2**64 and the quotient is off by 1.
751 mul CRT_HIWORD(DVSR) ; QUOT * CRT_HIWORD(DVSR)
753 mov eax,CRT_LOWORD(DVSR)
754 mul esi ; QUOT * CRT_LOWORD(DVSR)
755 add edx,ecx ; EDX:EAX = QUOT * DVSR
756 jc
short L4 ; carry means Quotient is off by 1
759;
do long compare here between original dividend and the result of the
760; multiply in edx:eax. If original is larger or equal, we are ok, otherwise
761; subtract one (1) from the quotient.
764 cmp edx,CRT_HIWORD(DVND) ; compare hi words of result and original
765 ja
short L4 ; if result > original, do subtract
766 jb
short L5 ; if result < original, we are ok
767 cmp eax,CRT_LOWORD(DVND) ; hi words are equal, compare lo words
768 jbe
short L5 ; if less or equal we are ok, else subtract
770 dec esi ; subtract 1 from quotient
771 sub eax,CRT_LOWORD(DVSR) ; subtract divisor from result
772 sbb edx,CRT_HIWORD(DVSR)
774 xor ebx,ebx ; ebx:esi <- quotient
778; Calculate remainder by subtracting the result from the original dividend.
779; Since the result is already in a register, we will do the subtract in the
780; opposite direction and negate the result.
783 sub eax,CRT_LOWORD(DVND) ; subtract dividend from result
784 sbb edx,CRT_HIWORD(DVND)
785 neg edx ; otherwise, negate the result
790; Now we need to get the quotient into edx:eax and the remainder into ebx:ecx.
798; Just the cleanup left to do. edx:eax contains the quotient.
799; Restore the saved registers and return.
811 __declspec(naked)
void _aullrem()
814 #define DVSR esp + 16
820; Now
do the divide. First look to see
if the divisor is less than 4194304K.
821; If so, then we can use a simple algorithm with word divides, otherwise
822; things get a little more complex.
825 mov eax,CRT_HIWORD(DVSR) ; check to see
if divisor < 4194304K
827 jnz
short L1 ; nope, gotta
do this the hard way
828 mov ecx,CRT_LOWORD(DVSR) ; load divisor
829 mov eax,CRT_HIWORD(DVND) ; load high word of dividend
831 div ecx ; edx <- remainder, eax <- quotient
832 mov eax,CRT_LOWORD(DVND) ; edx:eax <- remainder:lo word of dividend
833 div ecx ; edx <-
final remainder
834 mov eax,edx ; edx:eax <- remainder
836 jmp
short L2 ; restore stack and return
839; Here we
do it the hard way. Remember, eax contains DVSRHI
843 mov ecx,eax ; ecx:ebx <- divisor
844 mov ebx,CRT_LOWORD(DVSR)
845 mov edx,CRT_HIWORD(DVND) ; edx:eax <- dividend
846 mov eax,CRT_LOWORD(DVND)
848 shr ecx,1 ; shift divisor right one bit; hi bit <- 0
850 shr edx,1 ; shift dividend right one bit; hi bit <- 0
853 jnz
short L3 ; loop until divisor < 4194304K
854 div ebx ; now divide, ignore remainder
857; We may be off by one, so to check, we will multiply the quotient
858; by the divisor and check the result against the orignal dividend
859; Note that we must also check
for overflow, which can occur
if the
860; dividend is close to 2**64 and the quotient is off by 1.
863 mov ecx,eax ; save a copy of quotient in ECX
865 xchg ecx,eax ; put partial product in ECX, get quotient in EAX
867 add edx,ecx ; EDX:EAX = QUOT * DVSR
868 jc
short L4 ; carry means Quotient is off by 1
871;
do long compare here between original dividend and the result of the
872; multiply in edx:eax. If original is larger or equal, we
're ok, otherwise
873; subtract the original divisor from the result.
876 cmp edx,CRT_HIWORD(DVND) ; compare hi words of result and original
877 ja short L4 ; if result > original, do subtract
878 jb short L5 ; if result < original, we're ok
879 cmp eax,CRT_LOWORD(DVND) ; hi words are equal, compare lo words
880 jbe
short L5 ;
if less or equal we
're ok, else subtract
882 sub eax,CRT_LOWORD(DVSR) ; subtract divisor from result
883 sbb edx,CRT_HIWORD(DVSR)
887; Calculate remainder by subtracting the result from the original dividend.
888; Since the result is already in a register, we will perform the subtract in
889; the opposite direction and negate the result to make it positive.
892 sub eax,CRT_LOWORD(DVND) ; subtract original dividend from result
893 sbb edx,CRT_HIWORD(DVND)
894 neg edx ; and negate it
899; Just the cleanup left to do. dx:ax contains the remainder.
900; Restore the saved registers and return.
914 __declspec(naked) void _aullshr()
922; Handle shifts of between 0 and 31 bits
931; Handle shifts of between 32 and 63 bits
APPLE_EVENT_HANDLE Handle