Saturday, March 15, 2014

color change of screen in 8086

color change of screen if press 1
.model small
.stack 64
.data
clor db 10h
.code
main proc near

mov ax,@data
mov ds,ax

mov ax,3h           ; clear screen
int 10h

a10:
mov ax,0600h         ;set disply
mov bh,clor
mov cx,0000h           ; x1,y1
mov dx,184fh             ;x2,y2
int 10h
add clor,10h                  ;change background color

mov ah,8h                  ; ikeyboard nput
int 21h
cmp al,'1'                      ; if 1 press then color change otherwise exit
je a10

mov ax,4c00h
int 21h

main endp
end main

No comments:

Post a Comment

Contributors

Translate