Changeset 4f508e6 in buchla-68k for lib700/ldiv.s


Ignore:
Timestamp:
07/01/2017 02:34:46 PM (7 years ago)
Author:
Thomas Lopatic <thomas@…>
Branches:
master
Children:
08e1da1
Parents:
f40a309
Message:

Converted assembly language files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib700/ldiv.s

    rf40a309 r4f508e6  
    1 * ------------------------------------------------------------------------------
    2 * ldiv.s -- long division
    3 * Version 1 -- 1988-01-22
    4 * ------------------------------------------------------------------------------
     1| ------------------------------------------------------------------------------
     2| ldiv.s -- long division
     3| Version 1 -- 1988-01-22
     4| ------------------------------------------------------------------------------
    55                .text
    6 *
     6
    77                .xdef   _ldiv
    88                .xdef   ldiv
    9 *
     9
    1010                .xdef   _ldivr
    11 *
    12 ARG1            .equ    8
    13 ARG2            .equ    12
    14 *
     11
     12ARG1            =       8
     13ARG2            =       12
     14
    1515_ldiv:
    1616ldiv:           link    a6,#-2
     
    2121                move.l  ARG2(a6),d6
    2222                bne     ldiv1
    23 *
    24                 move.l  #$80000000,_ldivr
    25                 move.l  #$80000000,d0
     23
     24                move.l  #0x80000000,_ldivr
     25                move.l  #0x80000000,d0
    2626                divs    #0,d0
    2727                bra     ldiv11
    28 *
     28
    2929ldiv1:          bge     ldiv2
    30 *
     30
    3131                neg.l   d6
    3232                addq.w  #1,d3
    33 *
     33
    3434ldiv2:          tst.l   d7
    3535                bge     ldiv3
    36 *
     36
    3737                neg.l   d7
    3838                addq.w  #1,d3
    39 *
     39
    4040ldiv3:          cmp.l   d7,d6
    4141                bgt     ldiv9
    42 *
     42
    4343                bne     ldiv4
    44 *
     44
    4545                moveq.l #1,d5
    4646                clr.l   d7
    4747                bra     ldiv9
    48 *
    49 ldiv4:          cmp.l   #$10000,d7
     48
     49ldiv4:          cmp.l   #0x10000,d7
    5050                bge     ldiv5
    51 *
     51
    5252                divu    d6,d7
    5353                move.w  d7,d5
     
    5555                ext.l   d7
    5656                bra     ldiv9
    57 *
     57
    5858ldiv5:          moveq.l #1,d4
    59 *
     59
    6060ldiv6:          cmp.l   d6,d7
    6161                bcs     ldiv7
    62 *
     62
    6363                asl.l   #1,d6
    6464                asl.l   #1,d7
    6565                bra     ldiv6
    66 *
     66
    6767ldiv7:          tst.l   d4
    6868                beq     ldiv9
    69 *
     69
    7070                cmp.l   d6,d7
    7171                bcs     ldiv8
    72 *
     72
    7373                or.l    d4,d5
    7474                sub.l   d6,d7
    75 *
     75
    7676ldiv8:          lsr.l   #1,d4
    7777                lsr.l   #1,d6
    7878                bra     ldiv7
    79 *
     79
    8080ldiv9:          cmp.w   #1,d3
    8181                bne     ldiv10
    82 *
     82
    8383                neg.l   d7
    8484                move.l  d7,_ldivr
     
    8686                neg.l   d0
    8787                bra     ldiv11
    88 *
     88
    8989ldiv10:         move.l  d7,_ldivr
    9090                move.l  d5,d0
    91 *
     91
    9292ldiv11:         tst.l   (a7)+
    9393                movem.l (a7)+,d3-d7
    9494                unlk    a6
    9595                rts
    96 *
     96
    9797                .bss
    98 *
     98
    9999_ldivr:         .ds.l   1
    100 *
     100
    101101                .end
Note: See TracChangeset for help on using the changeset viewer.