Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8513013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:26:16+00:00 2026-06-11T04:26:16+00:00

I have been given some vendor supplied driver code written in C that runs

  • 0

I have been given some vendor supplied driver code written in C that runs on DOS (yes DOS) to access hardware. I am trying to work out what this code does, so far without much success. In particular I am having problems understanding the following code

void (interrupt *oldcan)(void);

void  interrupt far  can_isr(void)
{
    /* function body */
}

I am guessing the first line defines a function pointer but I have never seen the interrupt word which I am assuming is some kind of DOS API function. I have never used DOS before, and the function definition above looks to me that it has 3 return types – void, interrupt and far which clearly is not possible. The function actually has void return type, but what is the meaning of interrupt far ?? Any assistance will be gratefully received.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T04:26:18+00:00Added an answer on June 11, 2026 at 4:26 am

    The interrupt keyword is (was) used to create an interrupt handler — i.e., this function was intended to be invoked by an interrupt. far means when it returns, it expects both CS and IP to be on the stack, and the interrupt keyword means it expects the flags register to have been pushed as well (all a given for anything that’s invoked via interrupt, but it’s also possible to simulate an interrupt by pushing the flags register, then doing a far jump).

    The most common use was probably for code that was going to use a serial port — the BIOS/DOS serial port handler would lose characters at higher speeds (anything above about 300 bps, originally) so you had to install a handler of your own. When a character showed up at the serial port, the serial port hardware would assert a line that interrupted the processor. Based on that, your interrupt handler routine would be invoked. Your code needed to read the data in from the serial port into memory (and do a few things like re-enabling the interrupt) and return.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have been given some code that does a URLRequest call which is really
I have been given some matlab code compiled using the .net compiler. I can
I have been given some generated code which looks like so: <form id=form1 method=post
I have been given the task of re-writing some libraries written in C# so
I have been given some 'reports' from another piece of software that contains data
I've been given some XML files that don't quite have a proper schema (I
I've been given some starter code for a project I have to complete in
I have been given some html that look like this (I have no control
I have been given some poorly formatted data and need to pull numbers out
I have been given some file name which can be like <filename>YYYYMMDD<fileextension> some valid

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.