0% found this document useful (0 votes)
2K views

Bios Interrupt Programming

This document summarizes a lecture on programming BIOS and DOS interrupts in C/C++. It discusses using the int86 function to access BIOS interrupts for video output (INT 10h), memory (INT 12h), and disk I/O (INT 16h). It also covers programming the DOS INT 21h interface and accessing CPU registers like segments and flags. Examples are provided using the REGS structure to interface with low-level hardware from C/C++ code. Attendees are encouraged to download old Borland compilers that support this interface method under Windows.

Uploaded by

saliksiddiqui
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views

Bios Interrupt Programming

This document summarizes a lecture on programming BIOS and DOS interrupts in C/C++. It discusses using the int86 function to access BIOS interrupts for video output (INT 10h), memory (INT 12h), and disk I/O (INT 16h). It also covers programming the DOS INT 21h interface and accessing CPU registers like segments and flags. Examples are provided using the REGS structure to interface with low-level hardware from C/C++ code. Attendees are encouraged to download old Borland compilers that support this interface method under Windows.

Uploaded by

saliksiddiqui
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Lecture 37

Programming DOS, BIOS,


Hardware with C/C++:
BIOS and DOS Interrupt Programming

Dan Stormont
Utah State University
4/18/05
Overview
• Programming BIOS Interrupts
• Using int86 to access BIOS INT 10h
• Using int86 to access BIOS INT 12h
• Using int86 to access BIOS INT 16h
• Programming DOS INT 21h in C/C++
• Accessing segment registers
• Accessing the carry flag
Programming BIOS
Interrupts
• The REGS structure allows access to 8- and 16-
bit registers, if defined by the compiler
Programming BIOS
Interrupts
• The REGS structure from
the Mazidi and Mazidi
text
Programming BIOS
Interrupts
• The REGS structure as
#ifndef _REG_DEFS
defined in Borland C++ 4.0 #define _REG_DEFS

– This is in the dos.h header struct WORDREGS {


unsigned int ax, bx, cx, dx, si, di, cflag, flags;
};

struct BYTEREGS {
unsigned char al, ah, bl, bh, cl, ch, dl, dh;
};

union REGS {
struct WORDREGS x;
struct BYTEREGS h;
};

struct SREGS {
unsigned int es;
unsigned int cs;
unsigned int ss;
unsigned int ds;
};

struct REGPACK {
unsigned r_ax, r_bx, r_cx, r_dx;
unsigned r_bp, r_si, r_di, r_ds, r_es, r_flags;
};

#endif /* _REG_DEFS */
Programming BIOS
Interrupts
• A compiler that I’ve found to
work under Windows XP that
you can get access to is
Borland Turbo C or Turbo C++
• Go to the Borland website and
download either Turbo C 2.01
or Turbo C++ 1.1 from the
Borland museum
• It’s a free download and it does
work for the examples in the
book under Windows XP
Using int86 to access
BIOS INT 10h
Using int86 to access
BIOS INT 10h
Using int86 to access
BIOS INT 12h
Using int86 to access
BIOS INT 16h
Programming
DOS INT 21h in C/C++
Accessing Segment
Registers
Accessing the Carry Flag
• The carry flag (only) can be accessed
using int86, int86x, intdos, or intdosx and
the following instruction
Next Class

• On Wednesday, we’ll cover PC Hardware


Programming

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy