www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/05/18:14:03

From: Martin Str|mberg <ams AT ludd DOT luth DOT se>
Message-Id: <200001052219.XAA01187@father.ludd.luth.se>
Subject: Re: Assembler documentation
To: djgpp AT delorie DOT com (DJGPP)
Date: Wed, 5 Jan 100 23:19:15 +0100 (MET)
X-Mailer: ELM [version 2.4ME+ PL15 (25)]
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

Charles Wood said:
> I found the docs, maybe I'm stupid (I hope not) but I'm not getting the %1
> thing.
> 
> here's a sample asm function I need to inline in DJGPP please help if you
> can, from this example I should be okay from there on:
> 
> this doesn't so anything, it just covers the basics:
> 
>     char clear_and_v_plus_1(char v) {
>         __asm {
>             mov ax,0x3
>             int 0x10
>             mov al,v
>             inc al
>             mov v,al
>             };
>         };
> 
> Thank you very much for taking the time to write a GAS inline assembler
> routine
>     to do this for me.

Alas, I'm not very fluent in inline assembly, but if I'm not mistaken
you've not got everything else either.

The lines "mov al,v
           inc al
           mov v,al" says load v with the value of register al,
increment al load register al with v. Don't you want it the other way
around?

In a similar vein, "mov ax,0x3" loads 0x3 with the value of ax. I
don't know if 0x3 means literal 0x3 or the address 0x3, but either way
it won't work (you can't change the value 3 or you probably don't want
to write at address 3).


Right,

							MartinS

- Raw text -


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