|
|
1.1 root 1: ////////
2: /
3: / Intel 8086 floating point.
4: / assigned add to a single float.
5: / small model.
6: /
7: ////////
8:
9: .globl dfladd
10: .globl dfradd
11: .globl _fpac_
12: .globl dladd
13:
14: ////////
15: /
16: / ** dfladd -- assigned single add (lvalue)
17: / ** dfradd -- assigned single add (rvalue)
18: /
19: / these two routines are called directly by the compiler to do single
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 single rvalue>
26: / lea ax,<left single lvalue>
27: / push ax
28: / call ddradd
29: / add sp,10
30: /
31: / lea ax,<right single lvalue>
32: / push ax
33: / lea ax,<left single 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: dfladd: 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: dfradd: 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 2(si) / push
68: push 0(si) / the
69: sub ax,ax / double
70: push ax / left
71: push ax / rvalue
72: call dladd / do the addition.
73: add sp,$10 / pop args
74:
75: mov ax,_fpac_+6 / copy
76: mov 2(si),ax / the
77: mov ax,_fpac_+4 / result
78: mov 0(si),ax / back.
79:
80: pop bp / standard
81: pop di / c
82: pop si / function
83: ret / return.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.