bc230209391 CS401P Assignment-2

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Namra Saleem

BC230209391
Computer Architecture
And
Assembly Language Programming (CS401p)
Assignment No. 2

Assembly code:

[org 0x0100]
jmp start
Name: db 'Namra Saleem'
VUID: db 'bc230209391'
Length: dw 11
FirstHalfVUID: db 'bc2302'
SecondHalfVUID: db '09391'
Length1: dw 6
Length2: dw 5
clrscr: push es
push ax
push cx
push di
mov ax, 0xb800
mov es, ax
xor di, di
mov ax, 0x0720
mov cx, 2000
cld
rep stosw
pop di
pop cx
pop ax
pop es
ret
printstr: push bp
mov bp, sp
push es
push ax
push cx
push si
push di
mov ax, 0xb800
mov es, ax
mov al, 80
mul byte [bp+10]
add ax, [bp+12]
shl ax, 1
mov di, ax
mov si, [bp+6]
mov cx, [bp+4]
mov ah, [bp+8]
cld
nextchar: lodsb
stosw
loop nextchar
pop di
pop si
pop cx
pop ax
pop es
pop bp
ret 10
start: call clrscr
mov ax , 40
push ax
mov ax, 12
push ax
mov ax, 2h
push ax
mov ax, FirstHalfVUID
push ax
push word [Length1]
call printstr
mov ax, 46
push ax
mov ax, 12
push ax
mov ax, 6h
push ax
mov ax, SecondHalfVUID
push ax
push word [Length2]
call printstr
int 0x20
⦁ Screenshot showing required output.

You might also like