Continue to Site

Problem with coding: the search function does not work

Status
Not open for further replies.

ron2004

Newbie level 2
Newbie level 2
Joined
Oct 27, 2004
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
20
int 21h/ ah=04Eh

i want to create a prog.exe to copy directory that is compiled in turbo assembler.
my problem is the code that i search does not work properly here it is

ideal
dosseg
model small
stack 256

dataseg


dNa2 db '*.txt',00

dNa3 db 0


codeseg

start:
mov ax, @data
mov ds, ax
mov es, ax

xor ax, ax

mov ah, 04Eh ;search file for first text file
mov cx, 00000001b
mov dx, offset dNa2
int 021h

mov [dNa3], al ; get the file handle so ah=3Dh can use it

mov ah, 3Dh ;open file
mov al, 02h
mov dx, offset dNa3 ; mov dx, 9Eh is my other use of it
int 021h



exit:
mov ax, 04C00h
int 021h


the mov ah, 3Dh is cf = 1. it got error, my problem is i cant use the search
function "mov ah, 04Eh" for "mov ah, 3Dh" to open the file.


please help me.
 

int 21h/ ah=04Eh

Move your post to "PC Programming" forum - it has nothing related to Microcontrollers, because it is pure MS-DOS question!

As to your program - it has some bugs. For example, it doesn't check CF after function 04Eh. Also, it should use DTA to get name of found file, but I didn't notice that in your prog.

I think, you'd better look on Internet for "TechHelp" and read it carefully. This is compiled help on all MS-DOS functions, which has necessary info about functions, like 4Eh,4Fh,3Dh etc.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top