Solved

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

Posted on 1998-09-10
8
311 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
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 

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
 

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

823 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