Solved

getvet(),setvector() how were made in assembler language??

Posted on 1998-09-10
8
306 Views
Last Modified: 2011-09-20
hi!
 i need know how the getvect() and setvec() "C/C++" functions were made in assembly language ??  
(by example MS-Macro Assembler , MASM)
please writte the assembly code!!!!

Thanks again!!
0
Comment
Question by:uart8250
  • 3
  • 3
  • 2
8 Comments
 
LVL 22

Expert Comment

by:nietod
ID: 1172477
Why?  If you are running on a platform that supports them (like I suspect win16 does) then use the C/C++ version.  If not, you can't use assembly version either.

I have no documenation for the functions since they are not available in win32, but if you describe them I could write them for you.  Note however, that they can't be run from win32.
0
 
LVL 1

Accepted Solution

by:
Bonev earned 20 total points
ID: 1172478
These functions are useful generally in MS-DOS based programs.
There are two ways to implement them:
1) Using the MS-DOS functions 35h (get) and 25h (set).
2) Direct access to the interrupt vector table, that is located at memory location 0x0000:0x0000. Each vector occupies 2 16-bit words representing the segment (2nd word) and the offset (1st word) of the interrupt service routine.

0
 
LVL 1

Expert Comment

by:Bonev
ID: 1172479
Example:
To get the address of interrupt 21h
mov ax, 3521h
int 21h
; DS is the segment
; DX is the offset

To set the address of interrupt 21h
mov ax, 2521h
; NewISR21 is the ISR you want to use instead of the current handler
mov es, seg NewISR21
mov bx, ofs NewISR21
int 21h

0
 

Author Comment

by:uart8250
ID: 1172480
Thanks Bonev... Now,  what I can do?? becouse, I use Visual C/C++  5.0 (32bits) and
I need the setvect( ) , getvect( ) functions.

Thanks Again!!
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:uart8250
ID: 1172481
Thanks nietod... Now, What I can do?? becouse , I use Visual C/C++ (32bits) and
I need the setvect( ), getvect( ) functions!!   any idea??

Thanks Again!!
0
 
LVL 1

Expert Comment

by:Bonev
ID: 1172482
Is your program MS-DOS based or not?
0
 
LVL 22

Expert Comment

by:nietod
ID: 1172483
What can I do?  Well for a start, you can try to obtain a working answer rather than accepting one that is useless...

The problem is that interrupts really can't be used by an application in a protected mode environment.  The OS won't allow you to alter the interrupt dispatch table.  And even if you could alter it, your program (and most likely the whole system) would crash when the interrupt is called anyways.  The operating system and device drivers can use interrupts, but that is a different matter.  They are designed to be able to handle them.

What is it that you are hoping to do.?
0
 
LVL 22

Expert Comment

by:nietod
ID: 1172484
The program is a 32 bit windows program.  That is the only thing that VC 5 can produce.  If it wasn't a 32 bit program, then he could just use the getvect.setvect functions.  
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now