ack/mach/mantra/int/mloop7

252 lines
4.1 KiB
Plaintext
Raw Permalink Normal View History

1986-12-09 11:13:14 +00:00
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
1984-07-23 11:49:00 +00:00
!------------------------------------------------------------------------------
! UNSIGNED ARITHMETIC
!-----------------------------------------------------------------------------
adu_z: mov (sp)+,d0 ; bra 0f
1987-03-31 09:23:20 +00:00
adu_l: adroff ; move.w (a5),d0
1984-07-23 11:49:00 +00:00
0: checksize
2: move.w (sp)+,d1 ; add.w d1,(sp)
jmp (a4)
4: move.l (sp)+,d1; add.l d1,(sp)
jmp (a4)
sbu_z: mov (sp)+,d0 ; bra 0f
1987-03-31 09:23:20 +00:00
sbu_l: adroff ; move.w (a5),d0
1984-07-23 11:49:00 +00:00
0: checksize
2: move.w (sp)+,d1 ; sub.w d1,(sp)
jmp (a4)
1987-07-09 17:46:31 +00:00
4: move.l (sp)+,d1 ; sub.l d1,(sp)
1984-07-23 11:49:00 +00:00
jmp (a4)
!------------------------------------------------------------------------------
mlu_z: mov (sp)+,d0 ; bra 0f
1987-03-31 09:23:20 +00:00
mlu_l: adroff ; move.w (a5),d0
1984-07-23 11:49:00 +00:00
0: checksize
2: move.w (sp)+,d0 ; mulu (sp),d0
move.w d0,(sp) ; jmp (a4)
4: move.l (sp)+,d0 ; move.l (sp),d1
bsr mlu4 ; move.l d0,(sp)
jmp (a4)
!----------------------------------------------------------------------------
dvu_z: mov (sp)+,d0 ; bra 0f
1987-03-31 09:23:20 +00:00
dvu_l: adroff ; move.w (a5),d0
1984-07-23 11:49:00 +00:00
0: checksize
2: move.w (sp)+,d1 ; beq 3f
move.w (sp),d0 ; divu d1,d0
move.w d0,(sp) ; jmp (a4)
3: bsr e_idivz ; move.w #-1,(sp)
jmp (a4)
4: move.l (sp)+,d0 ; move.l (sp),d1
bsr dvu4 ; move.l d1,(sp)
jmp (a4)
!----------------------------------------------------------------------------
rmu_z: mov (sp)+,d0 ; bra 0f
1987-03-31 09:23:20 +00:00
rmu_l: adroff ; move.w (a5),d0
1984-07-23 11:49:00 +00:00
0: checksize
2: move.w (sp)+,d1 ; beq 3f
move.w (sp),d0 ; divu d1,d0
swap d0 ; move.w d0,(sp)
jmp (a4)
3: bsr e_idivz ; clr.w (sp)
jmp (a4)
4: move.l (sp)+,d0 ; move.l (sp),d1
bsr dvu4 ; move.l d3,(sp)
jmp (a4)
!------------------------------------------------------------------------.
slu_z: mov (sp)+,d0 ; bra 0f
1987-03-31 09:23:20 +00:00
slu_l: adroff ; move.w (a5),d0
1984-07-23 11:49:00 +00:00
0: checksize
2: move.w (sp)+,d0
bmi 7f
3: move.w (sp),d1
lsl.w d0,d1 ; move.w d1,(sp)
jmp (a4)
4: mov (sp)+,d0
bmi 9f
5: move.l (sp),d1
lsl.l d0,d1 ; move.l d1,(sp)
jmp (a4)
7: neg.w d0 ; bra 3f
9: nega d0 ; bra 5f
7: neg.w d0 ; bra 3b
9: nega d0 ; bra 5b
sru_z: mov (sp)+,d0 ; bra 0f
1987-03-31 09:23:20 +00:00
sru_l: adroff ; move.w (a5),d0
1984-07-23 11:49:00 +00:00
0: checksize
2: move.w (sp)+,d0
bmi 7b
3: move.w (sp),d1
lsr.w d0,d1 ; move.w d1,(sp)
jmp (a4)
4: mov (sp)+,d0
bmi 9b
5: move.l (sp),d1
lsr.l d0,d1 ; move.l d1,(sp)
jmp (a4)
!------------------------------------------------------------------------------
! DUMMY FLOATING POINT ROUTINES
!------------------------------------------------------------------------------
1988-04-28 15:16:07 +00:00
adf_l:
1987-03-31 09:23:20 +00:00
adroff ; move.w (a5),d0
1988-04-28 15:16:07 +00:00
1:
1984-07-23 11:49:00 +00:00
#ifdef FLTRAP
bra flnim
#else
1988-04-28 15:16:07 +00:00
checkfsize
4:
jsr .adf4
add.l #4,sp
jmp (a4)
8:
jsr .adf8
add.l #8,sp
jmp (a4)
#endif
adf_z:
mov (sp)+,d0 ; bra 1b
adf_s0:
move.l #0,d0 ; move.b (a3)+,d0
bra 1b
sbf_l:
adroff ; move.w (a5),d0
1:
#ifdef FLTRAP
bra flnim
#else
checkfsize
4:
jsr .sbf4
add.l #4,sp
jmp (a4)
8:
jsr .sbf8
add.l #8,sp
jmp (a4)
#endif
sbf_z:
mov (sp)+,d0 ; bra 1b
sbf_s0:
move.l #0,d0 ; move.b (a3)+,d0
bra 1b
mlf_l:
adroff ; move.w (a5),d0
1:
#ifdef FLTRAP
bra flnim
#else
checkfsize
4:
jsr .mlf4
add.l #4,sp
jmp (a4)
8:
jsr .mlf8
add.l #8,sp
1984-07-23 11:49:00 +00:00
jmp (a4)
#endif
1988-04-28 15:16:07 +00:00
mlf_z:
1984-07-23 11:49:00 +00:00
mov (sp)+,d0 ; bra 1b
1988-04-28 15:16:07 +00:00
mlf_s0:
1984-07-23 11:49:00 +00:00
move.l #0,d0 ; move.b (a3)+,d0
bra 1b
1988-04-28 15:16:07 +00:00
dvf_l:
adroff ; move.w (a5),d0
1:
#ifdef FLTRAP
bra flnim
#else
checkfsize
4:
jsr .dvf4
add.l #4,sp
jmp (a4)
8:
jsr .dvf8
add.l #8,sp
jmp (a4)
#endif
dvf_z:
mov (sp)+,d0 ; bra 1b
dvf_s0:
move.l #0,d0 ; move.b (a3)+,d0
bra 1b
ngf_l: adroff ; move.w (a5),d0
1:
#ifdef FLTRAP
bra flnim
#else
checkfsize
4:
jsr .ngf4
jmp (a4)
8:
jsr .ngf8
jmp (a4)
#endif
ngf_z:
mov (sp)+,d0 ; bra 1b
fif_l: adroff ; move.w (a5),d0
1:
#ifdef FLTRAP
bra flnim
#else
checkfsize
4:
move.l sp,-(sp)
1988-04-28 15:16:07 +00:00
jsr .fif4
add.l #4,sp
1988-04-28 15:16:07 +00:00
jmp (a4)
8:
move.l sp,-(sp)
1988-04-28 15:16:07 +00:00
jsr .fif8
add.l #4,sp
1988-04-28 15:16:07 +00:00
jmp (a4)
#endif
fif_z:
mov (sp)+,d0 ; bra 1b
fef_l: adroff ; move.w (a5),d0
1:
1984-07-23 11:49:00 +00:00
#ifdef FLTRAP
bra flnim
#else
1988-04-28 15:16:07 +00:00
checkfsize
4:
move.l sp,-(sp)
sub.l #4,(sp)
1988-04-28 15:16:07 +00:00
jsr .fef4
#ifndef lword
add.l #2,sp
#endif
jmp (a4)
8:
move.l sp,-(sp)
sub.l #4,(sp)
1988-04-28 15:16:07 +00:00
jsr .fef8
#ifndef lword
add.l #2,sp
#endif
1984-07-23 11:49:00 +00:00
jmp (a4)
#endif
1988-04-28 15:16:07 +00:00
fef_z: mov (sp)+,d0 ; bra 1b