[go: up one dir, main page]

0% found this document useful (0 votes)
7 views3 pages

Assembly VUID BC250222042 Final

The assignment requires modifications to an assembly language code to clear the screen with a green background and to complete a subroutine for printing a specific string at a designated screen location. The provided VUID is BC250222042, with the last non-zero digit being 2, and the message length is 11. The modified code includes a clrscr subroutine and a printstr subroutine, with specific parameters for display position and attributes.

Uploaded by

azeemyasin3
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)
7 views3 pages

Assembly VUID BC250222042 Final

The assignment requires modifications to an assembly language code to clear the screen with a green background and to complete a subroutine for printing a specific string at a designated screen location. The provided VUID is BC250222042, with the last non-zero digit being 2, and the message length is 11. The modified code includes a clrscr subroutine and a printstr subroutine, with specific parameters for display position and attributes.

Uploaded by

azeemyasin3
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/ 3

Assembly Language Assignment: VUID

BC250222042
Problem Statement
You are required to complete/modify the given assembly language code by:
a) Modifying the clrscr subroutine to clear the screen with Green background.
b) Writing the missing code for printstr subroutine which takes as parameters screen
location (Top-right), attribute byte (last non-zero digit of your VUID), your VUID and its
length.

Note: You must use your own VUID and modify the provided code. Writing the completely
different code or using any other VUID will result in Zero marks.

VUID Details
VUID: BC250222042

Last non-zero digit (attribute): 2

Message length: 11

Display Position: Top-Right Corner (Row = 0, Column = 69)

Modified Assembly Code


.model tiny
.code
org 100h

jmp start

message db 'BC250222042'
length dw 11

clrscr:
push es
push ax
push di
mov ax, 0b800h
mov es, ax
xor di, di
nextloc:
mov word ptr es:[di], 2020h
add di, 2
cmp di, 4000
jne nextloc
pop di
pop ax
pop es
ret

printstr:
push bp
mov bp, sp
push es
push ax
push cx
push si
push di

mov ax, 0b800h


mov es, ax
mov al, 80
mov bl, [bp+10]
mul bl
add ax, [bp+12]
shl ax, 1
mov di, ax

mov si, [bp+6]


mov cx, [bp+4]
mov ah, [bp+8]

nextchar:
lodsb
stosw
loop nextchar

pop di
pop si
pop cx
pop ax
pop es
pop bp
ret 10

start:
call clrscr

mov ax, 69
push ax
mov ax, 0
push ax
mov ax, 2
push ax
mov ax, offset message
push ax
push word ptr [length]

call printstr

mov ax, 4C00h


int 21h

Simulated Output Screenshot

You might also like