flat assembler
Message board for the users of flat assembler.

Index > DOS > Opening a file - obtainig carry and don't know why

Author
Thread Post new topic Reply to topic
StrenoJr



Joined: 13 Mar 2014
Posts: 22
Location: Slovakia
StrenoJr 24 Mar 2014, 20:25
Hi, I am getting carry on opening a file with this code
Code:
org 100h
use16
mov ax, 0x3D02; reading
mov dx, filename;
int 0x21;     
filename db "FILE.TXT", 0;     

I think it's correct but as it doesn't works I am not sure.
returns 0x02 in ax.
The file exists and I also tried creating a new file with a different name (returns carry too).
The rest of the code is not posted because it throws an error here - at the top.
Post 24 Mar 2014, 20:25
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1636
Location: Toronto, Canada
AsmGuru62 24 Mar 2014, 21:28
Maybe the current directory is not what you think it is?
Try to include a path into file name.
Post 24 Mar 2014, 21:28
View user's profile Send private message Send e-mail Reply with quote
freecrac



Joined: 19 Oct 2011
Posts: 117
Location: Germany Hamburg
freecrac 25 Mar 2014, 09:29
Or the address in the datasegmentregister is wrong.
DS:DX -> ASCIZ filename

Error code:
02h (2) file not found

Dirk
Post 25 Mar 2014, 09:29
View user's profile Send private message Send e-mail Reply with quote
badc0de02



Joined: 25 Nov 2013
Posts: 215
Location: %x
badc0de02 29 Mar 2014, 07:13
is the file too large does the random access memory a carry out?
Post 29 Mar 2014, 07:13
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1903
DOS386 29 Mar 2014, 08:10
> mov ax, 0x3D02; reading

try MOV AX,$3D00 ; READ ONLY http://www.delorie.com/djgpp/doc/rbinter/id/90/27.html
Post 29 Mar 2014, 08:10
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.