CS401 Assigment
; print string using bios service
[org 0x0100]
jmp start
message: db 'Mc...... name'
; subroutine to clear the screen
clrscr: push es
push ax
push cx
push di
mov ax, 0xb800
mov es, ax ; point es to video base
xor di, di ; point di to top right column
mov ax, 0x0720 ; space char in normal attribute
mov cx, 3000 ; number of screen locations
cld ; auto increment mode
rep stosw ; clear the whole screen
pop di
pop cx
pop ax
pop es
ret
start:
call clrscr;
mov ah, 0x13 ; service 13 - print string
mov al, 1 ; subservice 01 ? update cursor
mov bh, 0 ; output on page 0
mov bl, 7 ; normal attrib
mov dx, 0x0F07 ; row 10 column 3
mov cx, 24 ; length of string
push cs
pop es ; segment of string
mov bp, message ; offset of string
int 0x10 ; call BIOS video service
mov ax, 0x4c00 ; terminate program
int 0x21
Comments
Post a Comment