> Please excuse the slight off topic question. I am trying to
> use bcc for a
> couple of small routines. There needs to be some assembly in
> it, and I
> need to pass arguments back and forth. I tried the following:
>
> #define BDOOR_MAGIC 0x564D5868
> #define BDOOR_CMD_GETVERSION 10
> #define BDOOR_PORT 0x5658
>
> typedef unsigned short uint16;
> typedef unsigned uint32;
>
> void
> getVersion(version, magic)
> uint32 *version; uint32 *magic;
> {
> uint32 v;
> uint32 m;
>
>
> #asm
> push eax
> push ebx
> push ecx
> push edx
>
> mov eax, BDOOR_MAGIC
> mov ecx, BDOOR_CMD_GETVERSION
> mov dx, BDOOR_PORT
> in eax, dx
> mov v, eax
> mov m, ebx
>
> pop edx
> pop ecx
> pop ebx
> pop eax
> #endasm
>
> *version = v;
> *magic = m;
>
> }
>
> But this returns and no symbol for v and m. Could someone be
> kind enough
> to show me how to pass varibles from c to assembly and back?
Havn't been using bcc for quite some time, but as far as I can rember
something very similiar to what you're trying should work.
What version are you using?
Try to use asm{ instead of #asm. You could also do it the other
way around, using the registers from C. All the registers are
available from C but I don't remember the syntax, try _EAX
or _eax.
If this was to no help; i'll be happy to check my old sources
and manuals for you.
/Klas