www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/19/05:46:32

Xref: news2.mv.net comp.os.msdos.djgpp:7620
From: strider7 AT unm DOT edu
Newsgroups: comp.os.msdos.djgpp
Subject: assembly
Date: Sun, 18 Aug 1996 14:05:40 -0600
Organization: University of New Mexico, Albuquerque
Lines: 30
Message-ID: <32177794.5CA@unm.edu>
NNTP-Posting-Host: ppp_064.unm.edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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

      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?

-- 
   http://www.unm.edu/~strider7
   <strider7 AT unm DOT edu>

- Raw text -


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