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