Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

VC++ inline assembler error

Status
Not open for further replies.

anotherbrick

Full Member level 4
Full Member level 4
Joined
Jan 10, 2009
Messages
213
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Location
Istanbul , Turkey
Activity points
3,105
I am trying to compile this code with VC++6.0

Code:
__asm{
        mov   bl,9
        mov     ax,0204h
        int     31h
        mov     dword ptr [oldint09+0],edx
        mov     word ptr [oldint09+4],cx
        mov   ecx,cs
        mov     edx,offset int09
        mov     ax,0205h
        int     31h  }
but it gives error at this line
-----------------
mov ecx,cs error C2443: operand size conflict
-----------------
isnt the ECX and CS all 32 bit in pentium ?

why it gives error ?
 

arthur0

Full Member level 2
Full Member level 2
Joined
Nov 28, 2003
Messages
131
Helped
49
Reputation
98
Reaction score
36
Trophy points
1,308
Location
Stockholm, Sweden
Activity points
1,218
As far as I know, CS is a 16-bit register, but used together with IP to point to a 32-bit address space (CS:IP is 32-bit).

Arthur
 

anotherbrick

Full Member level 4
Full Member level 4
Joined
Jan 10, 2009
Messages
213
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Location
Istanbul , Turkey
Activity points
3,105
hello , thank you for your answer

what I am trying to do is
to capture an hardware interrupt
in protected mode

especially I must do this in VC++6.0 win32 console application with help of inline assembler - after I do this I will run the application in protected mode dos
anybody can give an example how to do this ?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top