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

Assembly Code for String Display

The document contains assembly code that clears the screen and prints a message stored in memory. It defines procedures for clearing the screen and printing strings, utilizing the BIOS interrupt for output. The program starts execution by calling the screen clearing function and then prints the specified message before terminating.

Uploaded by

gluonerp1234
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 views3 pages

Assembly Code for String Display

The document contains assembly code that clears the screen and prints a message stored in memory. It defines procedures for clearing the screen and printing strings, utilizing the BIOS interrupt for output. The program starts execution by calling the screen clearing function and then prints the specified message before terminating.

Uploaded by

gluonerp1234
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

Code:

[org 0x0100]
jmp start

message: db 'BC230200414'
length: dw 11

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

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


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]

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, 4
push ax
mov ax, message
push ax
push word [length]

call printstr

mov ax, 0x4c00


int 0x21

Output:

You might also like