Showing posts with label bouncing ball assembly language. Show all posts
Showing posts with label bouncing ball assembly language. Show all posts

Saturday, April 5, 2014

Moving CAR in ASSEMBLY LANGUAGE

int 10h is a video BIOS interrupt that is older than dirt and cannot be accessed from user mode in current operating systems

.model small
.stack 64
.data
tik dw ?
a db 05h
b db 05h
c db 08h
d db 0fh
e db 06h
f db 12h
str db '   0     0 ','$'
ctr db 00
.code
main proc far
mov ax,@data
mov ds,ax
pawan:
mov ah,00h
mov al,03h
int 10h
inc ctr
mov ah,02h
mov bh,00
mov dh,09h
mov dl,b
int 10h
mov ah,09h
lea dx,str
int 21h
mov ax,600h
mov bh,61h
mov cx,0a00h
mov dx,0aaah
int 10h
mov ax,600h
mov bh,30h
mov ch,a
mov cl,b
mov dh,c
mov dl,d
int 10h
mov ch,07h
mov cl,e
mov dl,f
int 10h
inc b
inc d
inc e
inc f
call delay
cmp ctr,60
jne pawan
mov ah,4ch
int 21h
main endp


delay proc near
mov ah,00h
int 1ah
mov tik,dx
add tik,1h
b10:
mov ah,00h
int 1ah
cmp tik,dx
jge b10

ret
delay endp

end main

Saturday, March 15, 2014

moving screen box in 8086

.model small
.stack 64
.data
point1a dw 510h
point1b dw 1520h      ;coordinate of box
tik dw ?
.386
.code
main proc near

mov ax,@data
mov ds,ax



a10:
mov ax,0600h          ;set disply
mov bh,52h              ; 5 background color ,2 forehead color
mov cx,point1a          ; x1, y1
mov dx,point1b           ;x2, y2
int 10h

call delay                      ;delay of 1 sec

inc point1a                 ; move point forward for   next disply
inc point1b
mov dl,cl                
mov ax,0600h            ; erase starting row of box
mov bh,00h
int 10h

cmp cl,63          
jb a10


mov ax,4c00h
int 21h
main endp

delay proc near

pusha


mov ah,00h         ;give system time
int 1ah

mov tik,dx           ;in dx  
add tik,12h         ; store in tik  (1 sec= 12h value)  ,system time+1sec
b10:
mov ah,00h
int 1ah

cmp tik,dx            ;execute loop until 1sec over
jge b10

popa
ret
 delay endp
end main

Contributors

Translate