943,569 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 2431
  • C++ RSS
Dec 28th, 2006
0

What is the purpose of registers

Expand Post »
09)What is the purposes of register used in c++.in c++ help they are used more examples and they are used memory addresses……How can we find the specific functions of memory addresses used in programming?Ex int() and int86() functions…..

#include<stdio.h>
#include<iostream.h>
#include<conio.h>
#include<dos.h>

#define VIDEO 0x10

void movetoxy(int x, int y)
{
union REGS regs;

regs.h.ah=2;
regs.h.dh=y;
regs.h.dl=x;
regs.h.bh=0;
int86(VIDEO,&regs,&regs);
}

void main ( )
{
clrscr();
movetoxy(35,10);
cout<<”Hello”;
getch();
}

at the start defined a constant with 0x10 I ask what is the purpose of that 0x10 what is the purpose of the address?
Is that a memory address? how we get to know about a task of a given memory address as a programmer? is there documentations? Is there where to find these things…?
Similar Threads
Reputation Points: 8
Solved Threads: 0
Newbie Poster
nuwan243 is offline Offline
15 posts
since Dec 2006
Dec 28th, 2006
0

Re: What is the purpose of registers

0x10 is an interrupt vector, which is a hard-coded memory address where an interrupt handler begins. This can only be used in old 16-bit MS-DOS programs.

Here are assembly language tutorials. If you want to learn interrupts then you will need to know basic assembly language.


Here is information about int 21 functions

If you google for "dos interrupts" you will find info on other interrupts.
Last edited by Ancient Dragon; Dec 28th, 2006 at 10:33 am.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,947 posts
since Aug 2005
Dec 29th, 2006
0

Re: What is the purpose of registers

0x10 is an interrupt vector, which is a hard-coded memory address where an interrupt handler begins. This can only be used in old 16-bit MS-DOS programs.
An older C/C++ compiler can build these programs even on Windows XP machines. And for the most part they will still work. The Command Line is still DOS-based and emulated the interrupt vectors.

Here are assembly language tutorials. If you want to learn interrupts then you will need to know basic assembly language.
That's not quite true. You don't really need to know assembler as long as you know how to access the REGS structure. It's all taken care of for you.
Moderator
Reputation Points: 3275
Solved Threads: 890
Posting Sage
WaltP is online now Online
7,716 posts
since May 2006
Dec 29th, 2006
0

Re: What is the purpose of registers

Click to Expand / Collapse  Quote originally posted by WaltP ...
An older C/C++ compiler can build these programs even on Windows XP machines
That is not what I said. I said those interrupts can only be used in 16-bit MS-DOS programs, which requires a 16-bit compiler. The interrupts can not be used if the program is built with any 32 or 64 bit compiler targeted for either MS-Windows or *nix.

Click to Expand / Collapse  Quote originally posted by WaltP ...
That's not quite true. You don't really need to know assembler as long as you know how to access the REGS structure. It's all taken care of for you.
Well, tell me how anyone can now how to populate the REGS structure if he knows absolutely nothing about assembly language??? True he doesn't need to know about many assembler instructions, but he does need to know a lot about the interrupts he is attempting to access.
Last edited by Ancient Dragon; Dec 29th, 2006 at 11:12 pm.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,947 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: twenty one game
Next Thread in C++ Forum Timeline: turbo c processor fault





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC