Machine Code..._(re)

Fri, 2 May 1997 14:38:02 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_01BC5706.700928C0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Orlando Llanes  wrote:

> My problem is that when I type "asm( 'inb %al, %dx' );" the compiler
says "386
> instruction not recognized" 

AAAHhrrrgg!!! :)) I posted in this mailing-list the my GPC ASM
documentation 
yesterday. SOURCE and DEST operands in At&t syntax are ALWAYS 
swapped!!!!!!

>I tried using an INLINE statement, that didn't work either,

Yes, it don't work, not as in BP, however.

> I even tried "asm( '$EC' );" which is the machine code
> equivalent, still nothing, then I tried "asm( 'db $EC' );

The GPC equivalent of the BP

Inline($EC);         --->>>>>  is   ------>>>> Asm(" .byte 0xEC");

> I understand that GPC was meant to be cross platform, but I need
> port access. I also know that I could link it externally, but I don't
want
> to have to do that unless it's absolutely necessary :( Thanks in
advance!

Get my ASM documentation at
http://www.geocities.com/SiliconValley/Vista/6573/index.html
if you haven't it yet. Otherwise, inportw and inportb procedure are in
attachment...

> See ya!

                                                                          
             Ciao,  PredatorZ.
-- 
[<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<]
|  Codename: PrEdAtOr~Z;   Sex: Male;     Status: Free coder |
*              E-mail: predatorzeta@geocities.com                      *
|    URL: http://www.geocities.com/SiliconValley/Vista/6573      |
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>]

------=_NextPart_000_01BC5706.700928C0
Content-Type: application/octet-stream; name="port.pas"
Content-Transfer-Encoding: 7bit
Content-Description:  (PAS File)
Content-Disposition: attachment; filename="port.pas"


Type
Byteint = __byte__ Integer;
Byte = __unsigned__ Byteint;
Shortint =__short__ Integer;
Word16 = __unsigned__ Shortint;

Function Inportw(port : integer) : word16;
var temp : word16=0;
begin
Asm("inw %%dx, %%ax" : "=a" (temp) : "d" (port));
Inportw:=temp;
end;

Function Inportb(port : integer) : byte;
var temp : byte=0;
begin
Asm("inw %%dx, %%al" : "=a" (temp) : "d" (port));
Inportb:=temp;
end;



------=_NextPart_000_01BC5706.700928C0--


PredatorZeta (predatorzeta@geocities.com)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es