flat assembler
Message board for the users of flat assembler.

Index > DOS > Environment variables

Author
Thread Post new topic Reply to topic
Picnic



Joined: 05 May 2007
Posts: 1389
Location: Piraeus, Greece
Picnic 09 Aug 2007, 18:18
Hi,
I wrote a script, just for fun, to read the environment variables on xp and save them on a text.
here is how i'm reading them, tested on 2 pc's with xp, its working, but is it a valid - safe way?

Code:
org 100h

 mov ds,[es:002ch]
 xor si,si
 cmp byte [si],0
 je done

print:
 cmp word [si],0
 je done
 cmp byte [si],0
 jne @f
 mov al,0dh
 int 29h
 mov al,0ah
 int 29h
 inc si
@@:
 lodsb
 int 29h
 jmp print

done:
 int 20h 
    

_________________
Hobby BASIC Interpreter
Post 09 Aug 2007, 18:18
View user's profile Send private message Visit poster's website Reply with quote
DJ Mauretto



Joined: 14 Mar 2007
Posts: 464
Location: Rome,Italy
DJ Mauretto 09 Aug 2007, 20:10
Quote:

Sun is shining, the weather is sweet

Make you wanna move your dancing feet now
To the rescue, here I am
Want you to know, yall, can you understand? Wink
Post 09 Aug 2007, 20:10
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1389
Location: Piraeus, Greece
Picnic 09 Aug 2007, 20:59
That's it DJ, i'm listening now..

_________________
Hobby BASIC Interpreter
Post 09 Aug 2007, 20:59
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1900
DOS386 10 Aug 2007, 19:26
Quote:
sun is shining, the weather is sweet


XP kernel is running, big fan blowing out all the heat Laughing
Post 10 Aug 2007, 19:26
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1389
Location: Piraeus, Greece
Picnic 14 Aug 2007, 07:19
hey, that's nice NTOSKRNL_VXE Smile
Post 14 Aug 2007, 07:19
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.