www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/26/22:39:13

From: rcouto AT arrakis DOT es (Rafa Couto)
Newsgroups: comp.os.msdos.djgpp
Subject: asm() tutorial & problem
Date: Fri, 27 Sep 1996 01:35:44 GMT
Organization: SantaTecla
Message-ID: <3249f20b.3507235@nntp.arrakis.es>
NNTP-Posting-Host: 194.224.107.117
Lines: 36
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

	Hi everybody :-)

	Info pages does not give very info about gas... Is there any
gxx.asm() tutorial over i386?

	Is needed to push all registers when a asm stament is started?
or only DS, (E)BP registers like other compilers...

	and the problem: opcode LES does not exist :-??

typedef	unsigned char Byte;

void put_pixel (int x, int y, Byte color, void * buffer) {
  asm (
    "pushw	%di		\n"
    "pushw	%dx		\n"
    "pushw	%ax		\n"
    "pushw	%es		\n"
    "les		$_buffer, %di	\n"	// error
    "addw	$_x, %di		\n"
    "movw	$_y, %dx	\n"
    "movw	%dx, %ax	\n"
    "shlw		$8, %dx		\n"
    "shlw		$6, %ax		\n"
    "addw	%dx, %ax	\n"
    "addw	%ax, %di	\n"
    "movb	$_color, %al	\n"
    "stosb			\n"
    "popw	%es		\n"
    "popw	%ax		\n"
    "popw	%dx		\n"
    "popw	%di		\n"
    );
};

	Thanks in advance, saludos, RC

--
Rafa Couto   (Santa Tecla)
<mailto:rcouto AT arrakis DOT es> <http://www.arrakis.es/~rcouto>
snail-mail:  P.O. Box 24 // 36780 A Guarda (PO) // Spain
PGP Fingerprint: E6.BF.11.EF.FE.55.38.B1  CF.7E.93.80.58.E5.9F.A3

- Raw text -


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