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…?

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.

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.

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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.