CS401 Assignment 2
CS401 Assignment 2
[org 0x0100]
jmp start
message: db 'BC220421085'
length: dw 11
clrscr:
push es
push ax
push di
mov es, ax
mov di, 0
nextloc:
add di, 2
jne nextloc
mov di, 79
sub di, cx
shl di, 1
mov ax, 3
mov bx, ax
shl bx, 60
shl ax, 2
add bx, ax
add di, bx
shl di, 1
print_vuid:
mov [es:di], ax
add si, 1
add di, 2
loop print_vuid
pop di
pop ax
pop es
ret
printstr:
push bp
mov bp, sp
push es
push ax
push cx
push si
push di
mov es, ax
mov bx, ax
shl bx, 6
shl ax, 2
add bx, ax
add di, bx
shl di, 1
print_loop:
mov [es:di], ax
add si, 1
add di, 2
loop print_loop
pop di
pop si
pop cx
pop ax
pop es
pop bp
ret 10
start:
call clrscr
mov ax, 7
push ax
mov ax, 4
push ax
mov ax, 5
push ax
push ax
call printst
mov ax, 0x4c00
int 0x21
Output: