CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2010
    Posts
    12

    Unhappy INT 21h func - 4E Issues

    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.
    Code:
    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
    Code:
    tasm /m file_name.asm
    tlink file_name.obj
    exe2bin file_name.exe file_name.com
    Last edited by dumb_terminal; October 3rd, 2010 at 12:24 AM. Reason: (i messed up the title)

  2. #2
    Join Date
    Sep 2010
    Posts
    12

    Cool Re: INT 21h func - 4E Issues

    Sorry to bother u guyz, Solved it myself . Didn't know the set DTA part. Here is some help if some one seeks.....
    Code:
    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....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured