0% found this document useful (0 votes)
15 views19 pages

Assgnmnt 2

The document describes various BIOS interrupts and functions related to video modes, cursor positioning, scrolling, character input/output and string handling in assembly language. It includes functions for setting video modes, positioning and getting the cursor, scrolling windows, reading and writing characters and colors, teletype output, writing strings, input/output to standard devices and printer, and direct console input/output.

Uploaded by

uh123465
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views19 pages

Assgnmnt 2

The document describes various BIOS interrupts and functions related to video modes, cursor positioning, scrolling, character input/output and string handling in assembly language. It includes functions for setting video modes, positioning and getting the cursor, scrolling windows, reading and writing characters and colors, teletype output, writing strings, input/output to standard devices and printer, and direct console input/output.

Uploaded by

uh123465
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 19

1.

SET VIDEO
MODE
mov al, 13h

mov ah, 0

int 10h
2. BOX CURSOR / SETTING CURSOR POSITION
mov ch, 0 ;box cursor

mov cl, 7

mov ah, 1

int 10h

mov dh, 10 ;set cursor position

mov dl, 20

mov bh, 0

mov ah, 2

int 10h

int 10h

mov ah, 01h ;input

int 21h
3. GET CURSOR POSITION AND SIZE

mov ah, 01h

int 21h ;set cursor position

mov dh, 2

mov dl, 5

mov bh, 0

mov ah, 2

int 10h ; get cursor position and size

mov bh, 0 ;page number

mov ah, 03h

int 10h
4. Cursor position and size
mov ah, 01h

int 21h ;set cursor position

mov dh, 2

mov dl, 5

mov bh, 0

mov ah, 2

int 10h ; get cursor position and size

mov bh, 0 ;page number mov ah, 03h int 10h


5. GET CHARACTER WITHBOX CURSOR
mov bh, 0

mov bl, 0fh

mov ah, 01h

int 21h

mov al,'a'

mov cx,5
6. SCROLL UP/DOWN WINDOW
;Scroll up window

mov al, 10 ; Number of lines to scroll

mov bh, 0 ; Display page number

mov cx, 5; Top row

mov dx, 0608h ; Bottom right coordinates (row 6, column 8)

mov ah, 06h ;Function code for scrolling up

int 10h ; Call interrupt 10h to scroll up

; Scroll down window

mov al, 10 ; Number of lines to scroll

mov bh, 0 ; Display page number

mov cx, 5 ; Top row

mov dx, 0608h ; Bottom right coordinates (row 6, column 8)

mov ah, 07h ;Function code for scrolling down

int 10h ; Call interrupt 10h to scroll down


7. READ CHARACTER AND ATTRIBUTEATTHECURSOR POSITION
mov dh, 10; read character and attribute at cursor position. Firstly, set the cursor

position

mov dl, 20

mov bh, 0

mov ah, 2

int 10h

mov ah, 01h

int 21h

mov bh, 0

; read character

mov ah, 08h

int 10h
8. WRITE CHARACTER ONLYATTHECURSORPOSITION
; firstly, set the cursor position

mov dh, 20

mov dl, 20

mov bh, 0

mov ah, 2

int 10h

mov al, 'R'

mov bh, 0

mov cx, 5

mov ah, 0Ah

int 10h
9. CHANGE COLOR OF A SINGLE PIXEL

mov al, 13h

mov ah, 0

int 10h ; set graphics video mode.

mov al, 1100b

mov cx, 10

mov dx, 20

mov ah, 0ch

int 10h ; set pixel


10. GET COLOR OF A SINGLE PIXEL
mov al, 13h

mov ah, 0

int 10h ; set graphics video mode.

mov al, 1100b

mov cx, 10

mov dx, 20

mov ah, 0ch

int 10h ; set pixel.

mov cx, 10

mov dx, 20

mov ah, 0Dh

int 10h

; AL describes color of that pixel


11. TELETYPE OUTPUT
mov al, 'a'

mov ah, 0eh

int 10h
12. WRITE STRING
mov al, 1

mov bh, 0

mov bl, 00111011b ;binary number format

mov cx, msg1end- msg1 ; calculate message size

mov dl, 10

mov dh, 7

push cs

pop es

mov bp, offset msg1

mov ah, 13h

int 10h

jmp msg1end

msg1 db "HEYY, THERE!", 0Ah, 0 ; Add newline and null terminator

msg1end:
13. READ CHARACTER FROM STANDARD INPUT

mov ah, 1

int 21h
14. WRITE CHARACTER TO STANDARD OUTPUT
mov ah, 2

mov dl, 'u'

int 21h
15. OUTPUT CHARACTER TO PRINTER
mov ah,5

mov dl,'a'

int 21h
16. DIRECT CONSOLE INPUT OR OUTPUT
mov ah, 6

mov dl, 'a'

int 21h ; output character.

mov ah, 6

mov dl, 255

int 21h
17. CHARACTER INPUT WITHOUT ECHO TOAL
mov ah, 7

int 21h
18. OUTPUT OF A STRING AT DS:DX. STRING MUST BE TERMINATED BY ’$’
org 100h

mov dx, offset msg

mov ah, 9

int 21h

ret

msg db "hello world $"


19. INPUT OF A STRING TO DS:DX,

FIRST BYTE IS BUFFER SIZE, SECOND BYTE IS OF CHARS ACTUALLY READ


org 100h

mov dx, offset buffer

mov ah, 0ah

int 21h

jmp print

buffer db 10,?, 10 dup(' ')

print:

xor bx, bx

mov bl, buffer[1]

mov buffer[bx+2], '$'

mov dx, offset buffer + 2

mov ah, 9

int 21h

Ret

You might also like