| | |
Changing current directory. Help.
Thread Solved |
Hello everybody. I'm trying to get the current directory, save it, changing the current dir, then coming back to the previous one.
My code so far
My problem is that i have an error at line 15. I don't know how to put the buffer's adress into ds. Can some one help me?
Btw , please tell me what is the function that waits for a key to be pressed and/or the one that waits a certain given time to pass.
My code so far
asm Syntax (Toggle Plain Text)
TITLE ep1_7 .MODEL SMALL .STACK 10h .DATA msg DB 'Current directory:',0h msg_l equ $-msg buff db 64 dup('$') ;f_handle dw 1 dup(?) .CODE begin: mov ax,@DATA mov ds,ax ;Getting current directory mov ah,47h mov dl,0 mov ds,buff ;showing the returned pathname mov dx,OFFSET buff mov ah,09h int 21h ;bail out mov ax,4c00h int 21h END begin
My problem is that i have an error at line 15. I don't know how to put the buffer's adress into ds. Can some one help me?
Btw , please tell me what is the function that waits for a key to be pressed and/or the one that waits a certain given time to pass.
Last edited by Alex_; Oct 22nd, 2009 at 2:10 pm.
Fundamental law of life:
do{ ThingsToDo+=me.CompleteTask(ThingsToDo); }while(ThingsToDo); Die(me);
Law of the Spirit:
do{ Rebuke(me); }while(!me.Repented); LiveEternal(me);
PM me to know more why i wrote this or what it means.
do{ ThingsToDo+=me.CompleteTask(ThingsToDo); }while(ThingsToDo); Die(me);
Law of the Spirit:
do{ Rebuke(me); }while(!me.Repented); LiveEternal(me);
PM me to know more why i wrote this or what it means.
1
#2 Oct 22nd, 2009
mov ds, seg buff ; works in MASM
mov si, offset buff
All you need is the segment address on which the buff string
lies, this is because your generating an .EXE.
Here's one way to wait for a key press:
mov si, offset buff
All you need is the segment address on which the buff string
lies, this is because your generating an .EXE.
Here's one way to wait for a key press:
Assembly Syntax (Toggle Plain Text)
waitkey: mov ah, 0x6 mov dx, 0xff int 0x21 jz waitkey ; if no char recieved ZF=1
Last edited by NotNull; Oct 22nd, 2009 at 6:34 pm.
----------------------------------------------------------
To control a mind violates a man, and all it has been used for is
hurting and afflicting. Nowonder I progam in assembly...
--->Now available http://dotcoding.netai.net/
To control a mind violates a man, and all it has been used for is
hurting and afflicting. Nowonder I progam in assembly...
--->Now available http://dotcoding.netai.net/
![]() |
Similar Threads
- parsing multiple files in current directory (Perl)
- any project in mind? (Assembly)
- find path of current directory (VB.NET)
- specify the current directory (Shell Scripting)
- current directory (C++)
- Changing permission for www/html directory (Window and Desktop Managers)
Other Threads in the Assembly Forum
- Previous Thread: add
- Next Thread: Question regarding output
| Thread Tools | Search this Thread |






