home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BURKS 2
/
BURKS_AUG97.ISO
/
BURKS
/
SOFTWARE
/
LIBS
/
PMC101.ZIP
/
LIBSRC.ZIP
/
GETENV.ASM
(
.txt
)
< prev
next >
Wrap
Assembly Source File
|
1994-06-29
|
1KB
|
86 lines
.386p
locals
_DATA segment dword public use32 'DATA'
_DATA ends
_BSS segment dword public use32 'BSS'
_BSS ends
DGROUP group _DATA, _BSS
assume cs:_TEXT, ds:DGROUP
extrn __lowbufptr:dword
extrn _envsel:word
public GETENV
_TEXT segment byte public use32 'CODE'
assume cs:_TEXT, ds:DGROUP
GETENV:
push esi edi
cld
mov edi,[esp+4+8+00h]
or ecx,-1
xor al,al
repne scasb
not ecx
lea edx,[ecx-1]
mov es,_envsel
xor edi,edi
@@00l:
mov esi,[esp+4+8+00h]
mov ecx,edx
repe cmpsb
jne short @@00l00
mov al,'='
scasb
jne short @@00l00
mov esi,edi
or ecx,-1
xor al,al
repne scasb
not ecx
mov edi,__lowbufptr
mov ax,es
mov dx,ds
mov ds,ax
mov es,dx
mov eax,edi
mov dl,cl
shr ecx,2
rep movsd
mov cl,dl
and cl,3
rep movsb
mov cx,es
mov ds,cx
jmp short @@00
@@00l00:
or ecx,-1
xor al,al
repne scasb
cmp es:[edi],al
jne @@00l
mov ax,ds
mov es,ax
xor eax,eax
@@00:
pop edi esi
ret 04h
_TEXT ends
end