I was wondering if there was a way to insert Machine Code into a GPC Program. The reason is that I'm trying to duplicate Borland Pascal's Port array by using 2 functions, one for port input, one for port output. My problem is that when I type "asm( 'inb %al, %dx' );" the compiler says "386 instruction not recognized" I tried using an INLINE statement, that didn't work either, I even tried "asm( '$EC' );" which is the machine code equivalent, still nothing, then I tried "asm( 'db $EC' );" which didn't do it either. 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!
See ya! Orlando Llanes
----------------------------------------------------------------------/ Msg 199706041515.SAA20339@santra.hut.fi,A.ECKLEDER@P-ANDY.line.org,Machine Code... ---------------------- forwarded by a.eckleder@chateau.line.org -- /
o> array by using 2 functions, one for port input, one for port output. My o> problem is that when I type "asm( 'inb %al, %dx' );" the compiler says o> "386 instruction not recognized" I tried using an INLINE statement, that the problem you have is very simple: just swap the two operands and the thing will do fine :) gnu-pascal inline assembler is at&t syntax,which uses all operands reverse to the normal intel syntax,e.g. "mov ax,0000h" in intel-syntax becomes "movw 0x0000,%ax" in at&t-syntax
andy
/------------------- A.ECKLEDER@CHATEAU.LINE.ORG ---------------------\ Who is 'General Failure' - And why is he reading my harddisk ? ------------------ Andreas Eckleder@2:2480/816.32 -------------------/ ## CrossPoint v3.1 ##