.sect .text .sect .rom .sect .data .sect .bss .sect .text !------------------------------------------------------------------------------ ! UNSIGNED ARITHMETIC !----------------------------------------------------------------------------- adu_z: mov (sp)+,d0 ; bra 0f adu_l: adroff ; move.w (a5),d0 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 sbu_l: adroff ; move.w (a5),d0 0: checksize 2: move.w (sp)+,d1 ; sub.w d1,(sp) jmp (a4) 4: move.l (sp)+,d1 ; sub.l d1,(sp) jmp (a4) !------------------------------------------------------------------------------ mlu_z: mov (sp)+,d0 ; bra 0f mlu_l: adroff ; move.w (a5),d0 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 dvu_l: adroff ; move.w (a5),d0 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 rmu_l: adroff ; move.w (a5),d0 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 slu_l: adroff ; move.w (a5),d0 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 sru_l: adroff ; move.w (a5),d0 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 !------------------------------------------------------------------------------ adf_l: sbf_l: mlf_l: dvf_l: adroff ; move.w (a5),d0 1: add.l d0,sp #ifdef FLTRAP bra flnim #else jmp (a4) #endif adf_z: sbf_z: mlf_z: dvf_z: mov (sp)+,d0 ; bra 1b adf_s0: sbf_s0: mlf_s0: dvf_s0: move.l #0,d0 ; move.b (a3)+,d0 bra 1b fef_l: sub.l wrd,sp fif_l: ngf_l: adroff fef_z: #ifdef FLTRAP bra flnim #else jmp (a4) #endif ngf_z: fif_z: add.l wrd,sp ; bra fef_z