|
|
1.1 ! root 1: //////// ! 2: / ! 3: / Intel 8086 floating point. ! 4: / assigned subtract from a single float. ! 5: / small model. ! 6: / ! 7: //////// ! 8: ! 9: .globl dflsub ! 10: .globl dfrsub ! 11: .globl _fpac_ ! 12: .globl dlsub ! 13: ! 14: //////// ! 15: / ! 16: / ** dflsub -- assigned single subtract (lvalue) ! 17: / ** dfrsub -- assigned single subtract (rvalue) ! 18: / ! 19: / these two routines are called directly by the compiler to do single ! 20: / floating assigned subtract. 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 dfrsub ! 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 dflsub ! 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: dflsub: 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: dfrsub: 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 dlsub / do the subtract. ! 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.