Hi all,
I need to write a ISR using Microsoft VC++ 2005. The proplem is I did
not found any hint on how to do it. I can register any function as a
ISR and it will be called by the hardware interrupt, interrupt 8
(timer) i.e., works fine in my little example progam. But the problem
is the compiler ends every function with RETN, after disassembling the
result of the compilation this can be seen easiely.
Every function starts and ends with:
push ebp //function entry
mov ebp,esp
....
pop ebp
retn //function exit
That's pretty fine for regular functions but as an interrupt handler
the function first of all should save all used registers, EAX is not
save by VC++ since its holding the return value, but ISR doesn't have
any return value. And second it needs to end with a IRETD !!!
Does anyone of you know how to solve this problem, maybe it points out
the VC++ is not the appropiated tool for my project. BTW, I do use VC++
only as editor and compiler, I do not program for windows, I just
generate code which can be executed in protected mode.
Many thanks,
Daniel 5 4257
mysli wrote:
push ebp //function entry
mov ebp,esp
That ... doesn't look like C++.
You will get the best results on a forum that discusses programming the
Win32 kernel. This newsgroup is only qualified to take a stab at C++. If
someone took a stab at your question, there aren't enough other regulars
here who could review their answer.
--
Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
As I mentioned in my last sentence, I'm not programming for Windows
therefore anything regarding WinAPI / Win32 Kernel won't help my
either. But I agree my question is maybe to specific to the Microsoft
Compiler although I'm not using it to compile windows programs but own
developped protected mode programs.
But thanks for letting my know that I'm wrong here.
Daniel
Phlip schrieb:
mysli wrote:
push ebp //function entry
mov ebp,esp
That ... doesn't look like C++.
You will get the best results on a forum that discusses programming the
Win32 kernel. This newsgroup is only qualified to take a stab at C++. If
someone took a stab at your question, there aren't enough other regulars
here who could review their answer.
--
Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
mysli wrote:
As I mentioned in my last sentence, I'm not programming for Windows
therefore anything regarding WinAPI / Win32 Kernel won't help my
either.
"I do not program for windows, I just generate code which can be executed in
protected mode."
Microsoft named their OS after their windows, and "protected mode" implies
.... kernelly things. So your last sentence was insufficient to distinguish
the exact group you should target!
Further, wedging interrupt service routines went out of style with MS-DOS,
so you really ought to find a more modern way to do what you need.
One worse way would be to get a compiler that can target 16-bit programs
that run in the "DOS Box" emulation environment. Two that come to mind are http://www.delorie.com/djgpp/ and its 16-bit tools, and MS's old free
version of Visual C++ 1.5 or similar. Then you can wedge all the interrupts
you like, and the emulator will let you think the CPU actually gives a s--t
what you are interrupting. ;-)
--
Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Thanks anyway, I got the solution already.
Phlip schrieb:
mysli wrote:
As I mentioned in my last sentence, I'm not programming for Windows
therefore anything regarding WinAPI / Win32 Kernel won't help my
either.
"I do not program for windows, I just generate code which can be executed in
protected mode."
Microsoft named their OS after their windows, and "protected mode" implies
... kernelly things. So your last sentence was insufficient to distinguish
the exact group you should target!
Further, wedging interrupt service routines went out of style with MS-DOS,
so you really ought to find a more modern way to do what you need.
One worse way would be to get a compiler that can target 16-bit programs
that run in the "DOS Box" emulation environment. Two that come to mind are http://www.delorie.com/djgpp/ and its 16-bit tools, and MS's old free
version of Visual C++ 1.5 or similar. Then you can wedge all the interrupts
you like, and the emulator will let you think the CPU actually gives a s--t
what you are interrupting. ;-)
--
Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: linesh.gajera |
last post by:
Hi Guys,
I am creating a Windows service that call a routine at given interval.
Once routine is complete, windows service should wait for 5 minutes and
then call the routine again. I was using System.Timers.Timer but i had
to remove it because of known bug(842739). Now i am using
System.Threading.Timer. It executes routine fine but the delay time is
sporadic, sometimes it executes routine after 5 minutes, sometimes 10
minuete, 13...
|
by: LordHog |
last post by:
Hello all,
I have a little application that will be used for test environment
that utilizes the CAN Messaging. The application will capture and then
decode the CAN message that are received. In the API reference material
the device will generate an interrupt which the user much provide an
interrupt service routine with the entry pointed at the interrupt 0x16
vector ( Address = 0x0083 ). Is it possible to write an interrupt
service...
|
by: Groundskeeper |
last post by:
I can't seem to get a custom UnhandledException handler working for a
Windows Service I'm writing in VB.NET. I've read the MSDN and tried
various different placements of the AddHandler call, to no avail.
Here's the code I'm using, all of which is in the main service class:
Protected Overrides Sub OnStart(ByVal args() As String)
AddHandler AppDomain.CurrentDomain.UnhandledException, _
|
by: Hartmut |
last post by:
Hi guys out there...,
I am not shure if this is the right forum for my Question.
Have a problem using my own Keyboard interrupt handler. The handler
works
fine as long as i do not press keys like pause, arrow keys etc. My
system
returns with a stack overflow.
Is there something i have overseen in my keyboard Interrupt Service
|
by: Sunil Varma |
last post by:
Hello all,
I wrote a Windows Service in VC.NET 2005
I want to debug the solution.
I tried as mentioned in the following link.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconintroductiontontserviceapplications.asp
But, when I started the service I got a message box saying that the
service is being stopped.
| |
by: German Koninin |
last post by:
Hi there.
I just installed VC++ 2005. I was using VC++ 6 before.
So I need to create a Windows Service. I tried to use wizard but code that
was generated seems to be a .Net related. In fact I expected that VC++ mean
normal VC++ just like it was in the early days. So currently I have two
questions:
1. How to create in VS 2005 Widows Service project that will be running just
ordinar VC++.
2. And second is there some good example of how to...
|
by: Eirik Midttun |
last post by:
I have seen quite a few times that C programs contain a file named
isr.c or files named a_isr.c, b_isr.c where a and b are hardware that
generate interrupts. Obviously these files contain code to be executed
on interrupts and is most common in embedded application.
My own preference is a different one. If I write a scheduler that uses
a timer, I would keep the timer interrupt code together with the code
that does the initialisation, adds...
|
by: grup.epoo |
last post by:
Hello,
I am trying to program an specific ISR (interrupt service routine) at
IRQ8 in order to get interrupts generated from a pci-device (which i
am using its driver on my c++ application).
This device active the IRQ8 (its installed there) when a event occurs.
I want to execute my routine when this event occurs.
So... I have to program the interrupt service vector? It is possible
|
by: Russ |
last post by:
I have a Web Service that was originally created with .NET VC 2003,
and subsequently converted to the 2005 version. It works fine when
built as a debug version, and run on the workstation it was built on.
Now I want to build a release version so I can deploy it to Windows
2003 server. This project is compiled with "/clr:oldSystax". I've
run into several problems and I am not sure all of the things I am
discovering are related. Any help...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |