Click to See Complete Forum and Search --> : INT 21h func - 4E Issues


dumb_terminal
October 3rd, 2010, 12:22 AM
Hello all, i am having trouble with a FindFirstFile int call, isn't that supposed to put the file name 1E offset to 80h in a com file ?? Or i am in a illusion that i can use this interrupt under win xp ?? Or it may be the fact that in windows it isn't put under DTA... is some one kind enough to point direction ??

Here is the code, i am trying to print the file name of the first matched file.

c_seg segment 'code'
org 100h
assume cs:c_seg
main proc far
start_:


mov ax, cs
mov ds, ax
mov es, ax

file db "*.com", 0

mov ah, 4Eh
mov dx, offset file
mov cx, 0
int 21h

jc quit_
mov cx, 13
mov bx, [80h + 1Eh]
loop_1:
mov ah, 02h
mov dl, byte ptr[BX]
inc BX
int 21h
loop loop_1
quit_:
mov ah, 4ch
int 21h
main endp
c_seg ends
end start_


compiling with

tasm /m file_name.asm
tlink file_name.obj
exe2bin file_name.exe file_name.com

dumb_terminal
October 3rd, 2010, 01:38 AM
Sorry to bother u guyz, Solved it myself :D. Didn't know the set DTA part. Here is some help if some one seeks.....

DTA db 43 dup (?)

....

mov ah, 1Ah
lea dx, DTA
int 21h

...

Then use everything relative to DTA not 80h. I am silly as my name refers to....