www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/25/02:13:35

Message-ID: <3248E443.1A15@gbrmpa.gov.au>
Date: Wed, 25 Sep 1996 15:50:24 +0800
From: Leath Muller <leathm AT gbrmpa DOT gov DOT au>
Reply-To: leathm AT gbrmpa DOT gov DOT au
Organization: Great Barrier Reef Marine Park Authority
MIME-Version: 1.0
To: Martin <beable AT magna DOT com DOT au>
CC: djgpp AT delorie DOT com
Subject: Re: Inline assembler with parameters
References: <32489A06 DOT 3E14 AT magna DOT com DOT au>

> Gidday,

Look, you may be Australian, but maybe you should get it
right... :)  its G'day! Haven't you ever seen the add!!! ;)
 
>         I am trying to get going using inline assembler with DJGPP and I have a
> couple of problems/questions.

Been there, done that... 
 
>         Firstly, how do I represent HEX and binary numbers. Normally I would do
> somthinge like 10h(for hex) and 1011001b(for binary). I also
> tried creating a little routine, however it fails to compile :-(

I use 0x10 = 16 decimal
 
> void setvga(unsigned short mode)
> {
>     __asm__ __volatile__(" movw %0, %ax\n
>                            movb $0, %ah\n
>                            int $16 "
>                            :
>                            : "g" (mode)
>                            : "ax" );
> 
> }

You need TWO % signs to access the registers. ie:
	movw	%0, %%ax;
	movb	$0, %%ah;
	int		0x10;

Leathal.

- Raw text -


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