www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/27/13:32:16

Message-Id: <36361198.A9F6E8E7@cableol.co.uk>
Date: Tue, 27 Oct 1998 18:31:52 +0000
From: The Allens <allen DOT asjp AT cableol DOT co DOT uk>
X-Mailer: Mozilla 4.04 [en] (Win95; I)
Mime-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: Converting Intel asm to AT&T syntax
References: <713cu6$msm$1 AT supernews DOT com>
Reply-To: djgpp AT delorie DOT com

Sorry, can't convert your code, as I'm terrible at AT&T style asm.
There is a tutorial for it at 
http://brennan.home.ml.org/programming/
which is helpful (Maybe I should read it properly some time....)

		Peter Allen

Thiessen wrote:
> 
> Hi,
> First of all, I hope this isn't the wrong newsgroup to post this in.
> I am trying to learn the AT&T syntax of inline assembly.  I need to convert
> some inline assembly functions to the AT&T syntax because DJGPP doesn't
> support the way I have it below.  I can't figure it out
> since I am unfamiliar with any kind of assembly language.
> The code is below.  If anyone could help convert it so I would know what to
> do for future programs that use inline assembly,or if anyone could reccomend
> a link to a site that can explain what I am trying to learn I would
> appreciate it.
> ****************************************************************************
> **
> /*This is the code for four functions:
> get_mode(),
> save_mode(unsigned char mode),
> pset(int x,int y,unsigned char color),
> and
> line(int x1,int y1,int x2,int y2,unsigned char color).*/
> 
> /*get_mode*/
> unsigned char get_mode(void)
> {
>     unsigned char mode;
>     _asm mov ah,0fh
>     _asm int 10h
>     _asm mov mode,al
>     return(mode);
> }
> /*save_mode*/
> void set_mode(unsigned char mode)
> {
>     _asm mov ah,00
>     _asm mov al,mode
>     _asm int 10h
> }
> /*pset*/
> void pset(int x,int y,unsigned char color)
> {
>     _asm mov ah,0ch
>     _asm mov al,color
>     _asm mov cx,x
>     _asm mov dx,y
>     _asm int 10h
> }
> /*line*/
> void line(int x1,int y1,int x2,int y2,unsigned char color)
> {
>     int x,y;
>     for(y=y1;y<=y2;y++)
>         pset(x1,y,color);
> }
> ****************************************************************************
> ***
> Thanks

- Raw text -


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