Annotation of coherent/b/lib/libc/crt/i8086/ddxad.s, revision 1.1.1.1

1.1       root        1: ////////
                      2: /
                      3: / Intel 8086 C runtime.
                      4: / assigned add to a double float.
                      5: / small model.
                      6: /
                      7: ////////
                      8: 
                      9:        .globl  ddladd
                     10:        .globl  ddradd
                     11:        .globl  _fpac_
                     12:        .globl  dladd
                     13: 
                     14: ////////
                     15: /
                     16: / ** ddladd -- assigned double add (lvalue)
                     17: / ** ddradd -- assigned double add (rvalue)
                     18: /
                     19: / these two routines are called directly by the compiler to do double
                     20: / floating assigned addition. these small routines make the  compiler
                     21: / simpler, and get rid of a very bulky code sequence that would  have
                     22: / to be generated for a fairly uncommon operation.
                     23: /
                     24: / compiler calling sequences:
                     25: /      push    <right double rvalue>
                     26: /      lea     ax,<left double lvalue>
                     27: /      push    ax
                     28: /      call    ddradd
                     29: /      add     sp,10
                     30: /
                     31: /      lea     ax,<right double lvalue>
                     32: /      push    ax
                     33: /      lea     ax,<left double lvalue>
                     34: /      push    ax
                     35: /      call    ddladd
                     36: /      add     sp,4
                     37: /
                     38: / outputs:
                     39: /      _fpac_=result.
                     40: /
                     41: / uses:
                     42: /      ax, bx, cx, dx
                     43: /
                     44: ////////
                     45: 
                     46: pa     =       8                       / pointer to left
                     47: pb     =       10                      / pointer to right
                     48: b      =       10                      / right
                     49: 
                     50: ddladd:        push    si                      / standard
                     51:        push    di                      / c
                     52:        push    bp                      / function
                     53:        mov     bp,sp                   / entry
                     54: 
                     55:        mov     ax,pb(bp)               / ax=pointer to right operand
                     56:        jmp     l0                      / finish in common code
                     57: 
                     58: ddradd:        push    si                      / standard
                     59:        push    di                      / c
                     60:        push    bp                      / function
                     61:        mov     bp,sp                   / entry
                     62: 
                     63:        lea     ax,b(bp)                / ax=pointer to right operand
                     64: 
                     65: l0:    push    ax                      / second arg is right lvalue.
                     66:        mov     si,pa(bp)               / si=pointer to left.
                     67:        push    6(si)                   / push
                     68:        push    4(si)                   / the
                     69:        push    2(si)                   / left
                     70:        push    0(si)                   / rvalue
                     71:        call    dladd                   / do the addition.
                     72:        add     sp,$10                  / pop args
                     73: 
                     74:        mov     ax,_fpac_+6             / copy
                     75:        mov     6(si),ax                / the
                     76:        mov     ax,_fpac_+4             / result
                     77:        mov     4(si),ax                / back
                     78:        mov     ax,_fpac_+2             / to
                     79:        mov     2(si),ax                / the
                     80:        mov     ax,_fpac_+0             / left
                     81:        mov     0(si),ax                / operand.
                     82: 
                     83:        pop     bp                      / standard
                     84:        pop     di                      / c
                     85:        pop     si                      / function
                     86:        ret                             / return.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.