TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: david nugent
from: Paul Edwards
date: 1994-04-25 17:17:14
subject: msdos program

Hello david!

I'm planning on learning 80386 assembler, and am also interested in some of
the MSDOS background, so I hope you don't mind being hit with a lot of
questions here.

 dn> # include 
 dn> # include 
 dn> # include 
 dn> # include 
 dn> # include 

First of all, you said that you left unportable stuff to assembler.  I can
sympathise with that attitude, however your actions seem entirely
different. First of all you go and include all these headers, then you use
open instead of fopen, and you have a "seg" variable too, and
then you use inline assembler which looks like it's using C constructs in
it anyway!  So you seem to have tied yourself down to the way a particular
C compiler handles inline assembler, rather than having more
"generic" assembler code.

In the below segment, you decided to push ds.  Why didn't you also do that
with bx, dx, cx and ax?  What do you use as a reference to all the DOS
interrupts?

        asm {
            mov     bx,[fd]
            xor     dx,dx
            mov     cx,0x1000   /* write in 4K blocks */
            mov     ah,0x40
            push    ds
            mov     ds,[seg]
            int     0x21
            pop     ds
        }
<<

> Apologies for the inline assembler, but I don't do much truely 'unportable'
> stuff in C.  If I've got to "DOS" it, I'll usually use asm
anyway rather than
> fiddle with MK_FP's and so forth.  I guess it depends on what you're used to,
> but I've got more flight hours in asm than in DOSish C. :-)  This is also
> memory model independant.

And why didn't my code using huge pointers work?  BFN.

Paul

--- GoldED/2 2.42.G1114
* Origin: Ten Minute Limit (3:711/934)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.