GIDForums  

Go Back   GIDForums > Computer Programming Forums > Assembly Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 06-Mar-2009, 11:43
hell0 hell0 is offline
Awaiting Email Confirmation
 
Join Date: Mar 2009
Posts: 4
hell0 is on a distinguished road

Four E


Learning assembly...with windows, using tasm5 and tlink for assembling and linking.

i am trying to use the Findfirst function (4Eh) of interrupt 21h.
Here, I understand that the details of found file are seen in DiscTransferArea.

Please...let me know..
Where do or how do I find this elusive DTA?

It would be greatly valued if a few hints are given to enable me to make out the right track.

Thank you...
  #2  
Old 07-Mar-2009, 12:10
Howard_L Howard_L is offline
Regular Member
 
Join Date: Apr 2007
Location: Maryland/PA, USA
Posts: 802
Howard_L is a jewel in the roughHoward_L is a jewel in the roughHoward_L is a jewel in the rough

Re: Four E


Post your code.
If it's real long write a short version which illustrates the problem.

Include compiling errors (if any).
Also include your comments on output vs expected output etc...
  #3  
Old 07-Mar-2009, 13:46
hell0 hell0 is offline
Awaiting Email Confirmation
 
Join Date: Mar 2009
Posts: 4
hell0 is on a distinguished road

Re: Four E


Many thanks for your response..
Code:
Code segment Assume cs:code,ds:code Org 100h Begin proc near mov ah,4eh xor cx,cx mov dx,offset Filetype int 21h mov ah,3dh mov al,02h mov dx,9eh ; name of file in DTA int 21h xchg bx,ax mov ah,40h mov cx,10h mov dx,offset begin mov ah,3eh int 21h mov ax,4C00h int 21h begin endp Filetype db "*.com",0 code ends end begin
The above lines of code assemble to a .com file without a sigh. (tlink name.obj /t).
As i understand, the 4Eh function searches for a file with extension .com as pointed out by the variable ‘Filetype’.
If the search is successful, the details of found file are seen in DTA.

The issue is this...
What exactly is the value present at 9eh in DTA?
To read/see that value, how do I access DTA?

May be iam a little confused here in my understanding of DTA . Hope you could help me to get this holdup cleared.

Regards...
  #4  
Old 08-Mar-2009, 11:24
Howard_L Howard_L is offline
Regular Member
 
Join Date: Apr 2007
Location: Maryland/PA, USA
Posts: 802
Howard_L is a jewel in the roughHoward_L is a jewel in the roughHoward_L is a jewel in the rough

Re: Four E


sorry to be so long getting back.
Quote:
The issue is this...
What exactly is the value present at 9eh in DTA?
To read/see that value, how do I access DTA?
In looking at this reference:
htl-steyr.ac.at/~morg/pcinfo/hardware/interrupts/inte1at0.htm
In
INT 21 4e Find first matching file.
There is a interesting description of what is found in the dta and at what offset it is found at. Basically there is a chunk of data at the dta memory address and you find certain values at certain offsets in the chunk.

There are also:
INT 21,1A - Set Disk Transfer Address (DTA)
and
INT 21,2F - Get Disk Transfer Address (DTA)

Which provide some additional info. such as:
Quote:
- the default DTA is a 128 byte block at address 80h in the Program Segment Prefix (~PSP~). This area also contains the command tail at program startup it must be saved or the DTA must be relocated before use to preserve the command tail
hmmm in the 4e description it says the filename is at offset 1e and above it says the starting offset is 80...
80 + 1E = 9e ... and that is what you used in 3d to open the file. Did it work?

Disclaimer: I have not done any of this so I could be totally wrong...
Last edited by Howard_L : 08-Mar-2009 at 12:05.
  #5  
Old 08-Mar-2009, 12:28
hell0 hell0 is offline
Awaiting Email Confirmation
 
Join Date: Mar 2009
Posts: 4
hell0 is on a distinguished road

Re: Four E


Howard_L . . thank you for making an honest effort to clear my doubt..

You had wondered where i got the 9Eh from ?
Well, it’s like this:

When a search function is successful, details of found file are made available in DTA which by default is located at offset 80h in the PSP(program segment prefix). At 1eh from DTA’s beginning, is the asciiz of the file name. Adding these two values together:
80h +
1Eh
= 9Eh
This is address where the name of the found file is located.

It may be superfluous at this stage but i think i owe this to your earnestness.

Good luck and god bless.

Regards...
  #6  
Old 08-Mar-2009, 13:08
Howard_L Howard_L is offline
Regular Member
 
Join Date: Apr 2007
Location: Maryland/PA, USA
Posts: 802
Howard_L is a jewel in the roughHoward_L is a jewel in the roughHoward_L is a jewel in the rough

Re: Four E


Glad to try , it helps me learn. What's dumb is that I learned about this a few months ago and had forgotten it!!!

Have you tried using the old 'debug' program?
It comes with '98 and XP , not sure about Vista.
You can view the entire PSP in that (including all the dta bytes).

So what is the question?
  #7  
Old 08-Mar-2009, 22:34
hell0 hell0 is offline
Awaiting Email Confirmation
 
Join Date: Mar 2009
Posts: 4
hell0 is on a distinguished road

Re: Four E


My acquaintance with assembly especially and programming in general is very recent and shallow.
Yes ...one can steal a look at PSP and DTA in debugger as you have suggested.
i got it ... rather learned this, after i asked the question and before you could answer it.

So, what is the question ... what happened to DTA??

Both got worked out between question and answer.

Regards...
 
 

Recent GIDBlogToyota - 2009 May Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 16:37.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.