What happen in registers Internaly using as in csl() function


 
Thread Tools Search this Thread
Top Forums Programming What happen in registers Internaly using as in csl() function
# 1  
Old 03-14-2007
What happen in registers Internaly using as in csl() function

Dear
i do not understand that function used for clear screen (given below)
cls
{
union REGS i,o;
i.h.ah=6;
i.h.al=0;
i.h.ch=0;
i.h.cl=0;
i.h.dh=24;
i.h.dl=79;
i.h.bh=7;
int86(16,&i,&o);
}
In Above function Registers are used(i think) but why and internally what the do for clearing the screen , i do not understand.
# 2  
Old 03-14-2007
This won't work in UNIX - it's ancient TURBO C code for PC's running under DOS.

The short answer is that this code calls the BIOS with interrupt #16, with some values
pushed into registers that tell it what to do with the screen driver.
# 3  
Old 03-15-2007
Quote:
Originally Posted by brain_full
Dear
i do not understand that function used for clear screen (given below)
cls
{
union REGS i,o;
i.h.ah=6;
i.h.al=0;
i.h.ch=0;
i.h.cl=0;
i.h.dh=24;
i.h.dl=79;
i.h.bh=7;
int86(16,&i,&o);
}
In Above function Registers are used(i think) but why and internally what the do for clearing the screen , i do not understand.
This is the ugly way of clearing your screen
Code:
system("clear");

really ugly!!! Smilie
# 4  
Old 03-15-2007
Code:
char escape=27;
printf("%c[2J", escape);

uses the tty driver and ANSI escape codes to clear the screen.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

When downloading a webpage by curl, what happen?

Hello, when im downloading an webpage from command line (CLI) by curl or wget the target website is loaded like i load it from browser? meaning target server connect to database and render data from mysql? Or only static content is downloaded? (2 Replies)
Discussion started by: postcd
2 Replies

2. Programming

what would happen if a process wrote to its own stdin?

what would happen if a process wrote to its own stdin? #include<unistd.h> #include<fcntl.h> int main() { if((write(STDIN_FILENO,"arrgh!",6))==-1) { perror("error writing to file"); } } output: $ gcc temp.c $ ./a.out arrgh!$ (9 Replies)
Discussion started by: c_d
9 Replies

3. Solaris

changing registers of the child process

hi,'m using the 5.11 kernel version on amd64 architecture, 32-bit. i need help on the following issues 1)a proper structure to represent the register structure in the architecture 2)a function which would change the register values of the child when the control is with the parent.. ptrace_setregs... (0 Replies)
Discussion started by: sayaproj
0 Replies

4. UNIX for Dummies Questions & Answers

whats happen when we create new user

hi frndz I wanna knw exatly what happen when we create new user... which directories are created ?? which files are modified ?? thanx.... (2 Replies)
Discussion started by: luckypower
2 Replies

5. Linux

About the registers.

Is there any way to find how many registers are there in my system. I am using Intel(R) Pentium(R) 4 CPU 3.00GHz. My OX is GNU linux. (2 Replies)
Discussion started by: lakshmananindia
2 Replies

6. UNIX for Dummies Questions & Answers

how to read and write device registers

hello friends, While in the process of writing device drivers, i am facing problem in reading and writing device registers.I got base address of those mapped device registers. Can i add offset of those registers to that Base address to get access of those... (1 Reply)
Discussion started by: sriram.ec
1 Replies

7. UNIX for Dummies Questions & Answers

What would happen if. . .

Hi, Could someone please tell me what would happen if the following were entered into the command line: rm -i /books/*.* rm /books/* Many thanks! (3 Replies)
Discussion started by: crispy
3 Replies

8. Programming

Any one can tell me how this happen?

The #1 Online Store for Louis Vuitton Replicas is: http://www.opichina.com.cn. We offer Louis Vuitton Replicas and more! Whatever you call it: LV Bags, LV Replicas, Louis Vuitton Fake, Louis Vuitton Knockoffs, Louis Vuitton Bag, Louis Vuitton Purse, Louis Vuitton Wallet, Louis Vuitton Shoes,... (10 Replies)
Discussion started by: jiangyanna
10 Replies

9. UNIX for Dummies Questions & Answers

what happen when changing Hostname?

I 'm using RH 7.2 Genome in the Network Configuration I change therer are two places one for static hostname for my machine and in DNS hostname I don't know what happen when restarting my PC when connecting using dialer I can't browse the Internet also I can't use sendmail .......Server timeout... (2 Replies)
Discussion started by: atiato
2 Replies
Login or Register to Ask a Question