summaryrefslogtreecommitdiffstats
path: root/private/ntos/dll/i386/emfmisc.asm
diff options
context:
space:
mode:
authorAdam <you@example.com>2020-05-17 05:51:50 +0200
committerAdam <you@example.com>2020-05-17 05:51:50 +0200
commite611b132f9b8abe35b362e5870b74bce94a1e58e (patch)
treea5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/ntos/dll/i386/emfmisc.asm
downloadNT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip
Diffstat (limited to 'private/ntos/dll/i386/emfmisc.asm')
-rw-r--r--private/ntos/dll/i386/emfmisc.asm81
1 files changed, 81 insertions, 0 deletions
diff --git a/private/ntos/dll/i386/emfmisc.asm b/private/ntos/dll/i386/emfmisc.asm
new file mode 100644
index 000000000..6adc08dc3
--- /dev/null
+++ b/private/ntos/dll/i386/emfmisc.asm
@@ -0,0 +1,81 @@
+ subttl emfmisc.asm - FABS, FCHS, FFREE, FXCH
+ page
+;*******************************************************************************
+;emfmisc.asm - FABS, FCHS, FFREE, FXCH
+;
+; Microsoft Confidential
+;
+; Copyright (c) Microsoft Corporation 1991
+; All Rights Reserved
+;
+;Purpose:
+; FABS, FCHS, FFREE, FXCH instructions
+;Inputs:
+; edi = [CURstk]
+; esi = pointer to st(i) from instruction field
+;
+;Revision History:
+;
+; [] 09/05/91 TP Initial 32-bit version.
+;
+;*******************************************************************************
+
+
+;******
+EM_ENTRY eFABS
+eFABS:
+;******
+ cmp EMSEG:[edi].bTag,bTAG_EMPTY
+ jz StackError ;in emarith.asm
+ mov EMSEG:[edi].bSgn,0 ;Turn sign bit off
+ ret
+
+;******
+EM_ENTRY eFCHS
+eFCHS:
+;******
+ cmp EMSEG:[edi].bTag,bTAG_EMPTY
+ jz StackError ;in emarith.asm
+ not EMSEG:[edi].bSgn ;Flip the sign
+ ret
+
+;******
+EM_ENTRY eFFREE
+eFFREE:
+;******
+ mov EMSEG:[esi].bTag,bTAG_EMPTY
+ ret
+
+;******
+EM_ENTRY eFXCH
+eFXCH:
+;******
+ cmp EMSEG:[esi].bTag,bTAG_EMPTY
+ jz XchDestEmpty
+XchgChkSrc:
+ cmp EMSEG:[edi].bTag,bTAG_EMPTY
+ jz XchSrcEmpty
+DoSwap:
+;Swap [esi] with [edi]
+ mov eax,EMSEG:[edi]
+ xchg eax,EMSEG:[esi]
+ mov EMSEG:[edi],eax
+ mov eax,EMSEG:[edi+4]
+ xchg eax,EMSEG:[esi+4]
+ mov EMSEG:[edi+4],eax
+ mov eax,EMSEG:[edi+8]
+ xchg eax,EMSEG:[esi+8]
+ mov EMSEG:[edi+8],eax
+ ret
+
+XchDestEmpty:
+ call ReturnIndefinite ;in emarith.asm - ZF set if unmasked
+ jnz XchgChkSrc ;Continue if masked
+ ret
+
+XchSrcEmpty:
+ xchg edi,esi ;pass pointer in esi
+ call ReturnIndefinite ;in emarith.asm - ZF set if unmasked
+ xchg edi,esi
+ jnz DoSwap ;Continue if masked
+ ret