0% found this document useful (0 votes)
3 views

cs401_100%correct_Assignmentsolution_Fall2024

This document contains an assembly language program for a computer architecture course, authored by Muhammad Ayaz. The program includes functions to clear the screen and print a string to the screen using BIOS interrupts. It is structured with a clear organization and comments for readability.

Uploaded by

osamasdesign21
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)
3 views

cs401_100%correct_Assignmentsolution_Fall2024

This document contains an assembly language program for a computer architecture course, authored by Muhammad Ayaz. The program includes functions to clear the screen and print a string to the screen using BIOS interrupts. It is structured with a clear organization and comments for readability.

Uploaded by

osamasdesign21
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

Assignment No.

2
Semester: Fall 2024
CS401 Computer Architecture and Assembly Language
Programming
100% correct solution Made by Muhammad Ayaz

Don’t copy paste ready your own solution\

Solution
[org 0x0100]

jmp start

message: db 'Bc123456789'
length: dw 11

clrscr:
push es
push ax
push di
mov ax, 0xb800
mov es, ax
mov di, 0

nextloc:
mov word [es:di], 0x2720
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, 0xb800

MUHAMMAD AYAZ 03429311964


mov es, ax
xor ax, 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]

nextchar:
mov al, [si]
mov [es:di], ax
add di, 2
add si, 1
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, 9
push ax
mov ax, message
push ax
push word [length]

call printstr

mov ax, 0x4c00


int 0x21

MUHAMMAD AYAZ 03429311964


MUHAMMAD AYAZ 03429311964

You might also like