Write
an assignment on screen functions 06H (Scroll screen up), 07H
(Scroll screen down) of BIOS INT 10H and program to simulate CLS (Clear Screen)
command.
About screen (video display):
The display supports a text mode containing 25 lines
with 80 characters per line.
A block of memory is reserved by display adapter and
is referred as video RAM.
Each character on the screen actually occupies 2 bytes
of video RAM.
The first is the ASCII codes for character to be
displayed on the screen, along with it second is the attribute byte.
Attribute byte:
It is a one byte information, about the foreground and background
The 8 bits of attribute byte are assigned as follows:
Bits 6 – 4 are used for background, and Bits 2 – 0 are
used for foreground
Therefore there are 4000 bytes associated with one video
page.
BIOS INT 10H:
►
Function
00h: set video mode
When the BIOS interrupt 10h along with the above
function value is executed, the video mode i.e. the display size changes.
There are 2 modes of our concern mode1 and mode 3.
Mode3 is the default mode in which the CGA adapter is
able to display 25 rows and 80 columns on the screen.
But If mode1 is
selected, then the CGA will display 25 rows and 40 columns on the screen.
To select the mode of display, AL register must be
loaded with either 1 or 3.
► Function
02H : set cursor position
This interrupt is used to place the cursor (dos
prompt) at any desired position on the text screen.
For its occurrence AH must be loaded with the function
value 02H
The cursors new row and column numbers must be loaded
in DH and DL registers respectively.
Function 0AH: write character to
screen
►
This interrupt allows us to write individual
characters or group of them to the screen at the current cursor position.
►
Register AH must be loaded with 0Ah.
►
The ascii code for the screen character must be
placed in AL
►
The number of characters written to the screen
must be placed in CX register.
Function 09h: write
character/attribute to screen
►
This interrupt also writes a character on the
display screen. The added feature is to control the attribute of the character.
►
AH must be loaded with 09h
►
AL must be loaded with the ASCII value of the
character to be displayed on the display screen.
►
BL must be loaded with characters attribute.
►
CX must be loaded with number of characters to
write
Function 06h/07H: scroll current
page up/ scroll current page down
►
Whenever we press enter the screen moves up by
one line, but dos prompt remains at the bottom of the screen.
►
This is done by copying data within the video
RAM from one group of locations to another.
►
This process is performed automatically for us
by function 06h
►
Seven registers are used to control the
operation of this interrupt
AH = 06h/07h
AL = No. of rows to scroll up/down
BH = Attribute used
CH = row number at top of region
CL = column number at top of left
region
DH = row number at bottom of region
DL = column number at bottom right of region
all final year students are informed to submit their manual on friday on or before 9 am
ReplyDelete