Click here to Skip to main content
15,923,164 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalusing namespace in a c++ dll Pin
MihaiChioariu7-Aug-05 9:33
MihaiChioariu7-Aug-05 9:33 
GeneralBoost + regex Pin
Jack Puppy7-Aug-05 7:47
Jack Puppy7-Aug-05 7:47 
GeneralSNMP: Urgent help needed Pin
Mukhan7-Aug-05 6:27
Mukhan7-Aug-05 6:27 
GeneralRegarding thumb recognition Pin
Pearlking7-Aug-05 4:40
Pearlking7-Aug-05 4:40 
GeneralRe: Regarding thumb recognition Pin
Maximilien7-Aug-05 5:16
Maximilien7-Aug-05 5:16 
General2 vc7 problems..and 1 question Pin
YaronNir7-Aug-05 4:38
YaronNir7-Aug-05 4:38 
GeneralRe: 2 vc7 problems..and 1 question Pin
toxcct7-Aug-05 8:43
toxcct7-Aug-05 8:43 
GeneralRe: 2 vc7 problems..and 1 question Pin
YaronNir7-Aug-05 20:08
YaronNir7-Aug-05 20:08 
Generaldbf odbc Pin
_tasleem7-Aug-05 3:23
_tasleem7-Aug-05 3:23 
GeneralRe: dbf odbc Pin
David Crow8-Aug-05 8:37
David Crow8-Aug-05 8:37 
GeneralRe: dbf odbc Pin
_tasleem10-Aug-05 12:28
_tasleem10-Aug-05 12:28 
GeneralWS_TABSTOP and EDIT controls Pin
Luther Baker7-Aug-05 0:04
Luther Baker7-Aug-05 0:04 
GeneralRe: WS_TABSTOP and EDIT controls Pin
Anonymous7-Aug-05 2:55
Anonymous7-Aug-05 2:55 
GeneralRe: WS_TABSTOP and EDIT controls Pin
Luther Baker7-Aug-05 7:36
Luther Baker7-Aug-05 7:36 
GeneralRe: WS_TABSTOP and EDIT controls Pin
benft12-Oct-05 14:06
benft12-Oct-05 14:06 
GeneralError during compiler upgrade Pin
AnkurGupta_19816-Aug-05 22:16
AnkurGupta_19816-Aug-05 22:16 
GeneralRe: Error during compiler upgrade Pin
toxcct6-Aug-05 22:59
toxcct6-Aug-05 22:59 
Generalcalling int 21h from a __asm block of code Pin
CorvetteZ06066-Aug-05 21:54
CorvetteZ06066-Aug-05 21:54 
GeneralRe: calling int 21h from a __asm block of code Pin
John R. Shaw6-Aug-05 23:28
John R. Shaw6-Aug-05 23:28 
GeneralRe: calling int 21h from a __asm block of code Pin
CorvetteZ06067-Aug-05 3:37
CorvetteZ06067-Aug-05 3:37 
The assembly program was a stand alone application; it was not called from anywhere. I wanted to add some functionality to it, but it's been so long since I've programmed in asm that I've forgotten most of it. The compiler that was originally used to compile it was a86. It was written for the 286 intel processor. (16bit only) I'm familiar with most of the code and what it's supposed to do since I had left some comments here and there, but this is the first time I've ever tried to put asm and c++ in the same program.

Here is a block of code that's causing me problems:

;//;open file using handle (r/w)
lea dx, name
mov ax, 3D02h
int 0021h
jc end
xchg ax, bx

basically what it does is load the address of filename in memory into dx. name is a NULL terminated char array defined in the main() function. Then move 3D02 into ax. This will cause int21 to call function 3d which is the open filename command. The 02 byte in AL specifies to open the file in r/w mode. Then int21 is called to open the file. Afterwards the Carry flag is checked to see if the open was a success or failure. This should catch any errors with the open and prevent the program from crashing. (and yes, the label "end" is inside the same __asm block as the above code). Finally ax and bx are exchanged to put the file handle in bx. The next function called in asm code will require the handle be in bx, so might as well put it there now.

I debuged the above code and it crashes when it gets to the call to int21. I'm not sure what to do from here.

Also, I'm running Windows XP with a NTFS filesystem. When I run the asm code after it was compiled with a86, it runs fine. OMG | :OMG:

thanks!
GeneralRe: calling int 21h from a __asm block of code Pin
John R. Shaw8-Aug-05 18:39
John R. Shaw8-Aug-05 18:39 
GeneralRe: calling int 21h from a __asm block of code Pin
Alexander M.,7-Aug-05 4:38
Alexander M.,7-Aug-05 4:38 
GeneralRe: calling int 21h from a __asm block of code Pin
Gary R. Wheeler7-Aug-05 4:52
Gary R. Wheeler7-Aug-05 4:52 
GeneralRe: calling int 21h from a __asm block of code Pin
CorvetteZ06067-Aug-05 6:08
CorvetteZ06067-Aug-05 6:08 
GeneralRe: calling int 21h from a __asm block of code Pin
David Crow8-Aug-05 8:42
David Crow8-Aug-05 8:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.