Solved

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

Posted on 1998-09-10
8
305 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
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.

708 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

16 Experts available now in Live!

Get 1:1 Help Now