🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.lang.asm
Article #332

Re: Newbie: File operations

#332
From: bmarcum
Date: Wed, 15 Mar 2000 00:00
26 lines
1736 bytes
On 2000-03-14 kid1983@hotmail.com said:
   >Here's the code for creating a file. It always gave some sort of an
   >error. Thanks for the help.
   >HELLO  segment
   >assume  cs:HELLO, ds:HELLO, es:HELLO
   >org     100h
   >start:  mov ah,09h
   >mov ah, 3C    ;To open the file with a handle
   >mov cx, 00100000   ;The attribute
   >mov bx,cs  ;pointing to the ASCIIZ filename
   >mov ds,bx
   >mov dx,offset mytext
   >mytext  db 'test.txt','$'

To open a file, you terminate the name with a zero byte, not $; and
there's not much point in moving different values into ah or ax without
doing an int or some other instruction that uses ax. Finally, you can't
just stick data in the middle of your code.  The cpu will try to execute
the bytes 'test.txt'.

   >mov ax,4c00h
   >int 21h
   >HELLO  ends
   >end start
 
Technical Details
Message-ID: <scu832859n55@corp.supernews.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8alolr$8eq$1@bob.news.rcn.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f7d8d,9d73404c09218118
X-Google-Attributes: gidf7d8d,public
X-Google-Thread: feaef,9d73404c09218118
X-Google-Attributes: gidfeaef,public
X-Google-Thread: 114917,9d73404c09218118
X-Google-Attributes: gid114917,public
From: bmarcum@iglou.com
Subject: Re: Newbie: File operations
Date: 2000/03/15
Message-ID: <scu832859n55@corp.supernews.com>
X-Deja-AN: 597672594
Approved: ccrayne@pacific.net (comp.lang.asm.x86)
Sender: News <news@iglou.com>
References: <8alolr$8eq$1@bob.news.rcn.net>
X-Original-NNTP-Posting-Host: news-incoming.iglou.com
X-Everything: Net-Tamer V 1.08X
X-Track2: 2
X-Complaints-To: newsabuse@supernews.com
Organization: IgLou Internet Services, Inc.
X-Apparently-To: clax86@yahoo.com via web1702.mail.yahoo.com
X-Track: 1-1: 40
Newsgroups: alt.lang.asm,borland.public.tasm,comp.lang.asm.x86