:
: i try that you said, take a look here :
:
: #include "stdio.h"
:
: int main(int argc,char *argv[]){
: asm{
: mov dx,934h
: in eax,dx
: }
: }
:
: the disassembler says :
: +++++++++++++++++++ ASSEMBLY CODE LISTING ++++++++++++++++++
: //********************** Start of Code in Object .text **************
: Program Entry Point = 0040100C (ASMTEST.EXE File Offset:0000960C)
: :00401000 55 push ebp
: :00401001 8BEC mov ebp, esp
: :00401003 66BA3409 mov dx, 0934
: :00401007 ED in ax, dx
: :00401008 33C0 xor eax, eax
: :0040100A 5D pop ebp
: :0040100B C3 ret
:
: don't accept EAX , i'm using BCC32 version 5.5 tlink v5 or ilink32 v7
: and link as win32 console
:
: in your opinion is safe to create a dll for direct I/O using C++,
: or i must use ASM code instead ?
: and last is this correct ?
:
: in eax,dx =?= in ax,dx
: in ax,dx ; do i read i long in this way ?
:
:
:
:
I see... You have weird (or rather wrong) code generation there... strange...
There is a command allowing to inject the code bytes straight into C/C++ code WITHOUT compiler interpreting them in any way - sometimes I found it very useful. For example: your code translates into following bytes:
66BA3409 MOV DX, 0934h
ED IN EAX, DX
The very same will be achieved by this:
__emit__ (0x66, 0xBA, 0x34, 0x09, 0xED);
I just hope that BCC32 has this __emit__() command.