Table of Contents
VGA- Scroll ABC in Horizontal Row – Assembly Language Code
[su_box title=”SCROLL ABC” style=”bubbles” box_color=”#1d318d”]
org 100h
.data
pos dw 0
pos2 dw 3998
flag dw 0
var1 db 61h
var2 db 61h
.code
xor ax,ax
mov es,ax
cli
mov es:9*4,myisr
mov es:9*4+2,cs
sti
mov ah,0
mov al,3
int 10h
mov ax,0b800h
mov es,ax
mov ah,08h
mov al,61h
mov es:0,ax
loop1:
cmp flag,0
jne exit1
call scroll
exit1:
jmp loop1
scroll proc
mov ax,0b800h
mov es,ax
start:
cmp pos,158
jle tp
mov pos,0
tp:
mov di,pos
mov ah,08h
mov al,var1
mov es:di,ax
add pos,6
inc var1
cmp var1,’z’
jle end
mov var1,’a’
start2:
cmp pos2,3840
jge tp2
mov pos2,3998
tp2:
mov di,pos2
mov ah,08h
mov al,var2
mov es:di,ax
sub pos2,6
inc var2
cmp var2,’z’
jle end
mov var2,’a’
end2:
ret
end:
ret
scroll endp
myisr:
push ax
in al,60h
cmp al,19h
je chang_flag
exit:
mov al,20h
out 20h,al
pop ax
iret
chang_flag:
xor flag,1
jmp exit
skip:
ret
[/su_box]