www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/20/03:05:45

Xref: news2.mv.net comp.os.msdos.djgpp:7654
From: John Joseph Newbigin <079519 AT bud DOT cc DOT swin DOT edu DOT au>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: assembly
Date: Tue, 20 Aug 1996 14:07:10 +1000
Organization: Swinburne University of Technology
Lines: 44
Message-ID: <Pine.OSF.3.91.960820140336.2062A-100000@bud.cc.swin.edu.au>
References: <32177794 DOT 5CA AT unm DOT edu>
NNTP-Posting-Host: bude.cc.swin.edu.au
Mime-Version: 1.0
In-Reply-To: <32177794.5CA@unm.edu>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp


On Sun, 18 Aug 1996 strider7 AT unm DOT edu wrote:

> im trying to learn assembly (at&t syntax), and i made a little program that 
> prints out a string:
> 
> ..file "junk.s"                          # new logical file
> 
> ..data
> 
>    string:
>       .ascii "hello there!\r\n$"
> 
> ..text
> 
> ..global _main
> _main:
> 
>       movl $string, %dx                 # move string into dx
>       movb $0x09, %ah                   # print the string, calling
>       int  $0x21                        # int 21h, subfunction 9h
This is doing a protected mode int. but DOS is a real mode program. I am 
sure there is a reason why it works under 95, but I don't know it.

What yo have to do is call a real mode interrupt by calling the DPMI 
server.  It is probably easier to use DJGPP and do inline assembly :)

Newbs.

 > 
>       ret                               # leave program
> 
> it works under win95, but doesnt under dos (with cwsdpmi v2), it prints out 
> junk on the screen.  am i doing this right, if im not, how come it works 
> under win95?
> 
> another question, what does '.align' do and why do i need it?
I'll leave this for someone else
> 
> -- 
>    http://www.unm.edu/~strider7
>    <strider7 AT unm DOT edu>
> 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019