Solved

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

Posted on 1998-09-10
8
315 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 …
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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 learn how to clear a vector as well as how to detect empty vectors in C++.

733 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