mamadjohny
دوشنبه 01 خرداد 1391, 00:49 صبح
من این برنامه رو تا اینجا نوشتم اما زمانی که روی یکی از شش تا مربع سمت راست کلیک می کنم باید داخل مربع بزرگ سفیدی که رسم میشه پیکسل هام رنگ بشه اما این کار درست انجام نمیشه
تا یادم نرفته این کد ناقصه اگر کسی بلده کمک کنه
;-----------Data Segment---------
data segment
lastvideo db ?
ends
;-----------Code Segment---------
code segment
start:
;-------Save V Mode----------
mov ah,0fh
int 10h
mov lastvideo,al
;-------Graphic Mode---------
mov ah,00
mov al,12h
int 10h
;-------Red Square ------
mov ah,0ch
mov al,4 ;Color
mov cx,20 ;Column
p2: mov dx,20 ;Row
p1: inc dx
cmp dx,40
int 10h
jnz p1
inc cx
cmp cx,40
jnz p2
;-------Green Square ------
mov ah,0ch
mov al,2 ;Color
mov cx,60 ;Column
p4: mov dx,20 ;Row
p3: inc dx
cmp dx,40
int 10h
jnz p3
inc cx
cmp cx,80
jnz p4
;-------Blue Square ------
mov ah,0ch
mov al,1 ;Color
mov cx,20 ;Column
p6: mov dx,60 ;Row
p5: inc dx
cmp dx,80
int 10h
jnz p5
inc cx
cmp cx,40
jnz p6
;-------Grey Square ------
mov ah,0ch
mov al,8 ;Color
mov cx,60 ;Column
p8: mov dx,60 ;Row
p7: inc dx
cmp dx,80
int 10h
jnz p7
inc cx
cmp cx,80
jnz p8
;-------White Square ------
mov ah,0ch
mov al,7 ;Color
mov cx,20 ;Column
p10: mov dx,100 ;Row
p9: inc dx
cmp dx,120
int 10h
jnz p9
inc cx
cmp cx,40
jnz p10
;-------Yellow Square ------
mov ah,0ch
mov al,14 ;Color
mov cx,60 ;Column
p12: mov dx,100 ;Row
p11: inc dx
cmp dx,120
int 10h
jnz p11
inc cx
cmp cx,80
jnz p12
;-------Exit ------
mov ah,0ch
mov al,5 ;Color
mov cx,20 ;Column
p14: mov dx,140 ;Row
p13: inc dx
cmp dx,160
int 10h
jnz p13
inc cx
cmp cx,40
jnz p14
;-------Clear Screen ------
mov ah,0ch
mov al,6 ;Color
mov cx,60 ;Column
p16: mov dx,140 ;Row
p15: inc dx
cmp dx,160
int 10h
jnz p15
inc cx
cmp cx,80
jnz p16
;-------Left Top Point ------
mov ah,0ch
mov al,15 ;Color
mov cx,100 ;Column
mov dx,20 ;Row
p17:inc dx
cmp dx,160
int 10h
jnz p17
;-------Left Bottom Point----
mov ah,0ch
mov al,15 ;Color
mov cx,100 ;Column
mov dx,160 ;Row
p18:inc cx
cmp cx,240
int 10h
jnz p18
;-------Right Bottom Point---
mov ah,0ch
mov al,15 ;Color
mov cx,240 ;Column
mov dx,160 ;Row
p19:dec dx
cmp dx,20
int 10h
jnz p19
;-------Right Top Point------
mov ah,0ch
mov al,15 ;Color
mov cx,240 ;Column
mov dx,20 ;Row
p20:dec cx
cmp cx,100
int 10h
jnz p20
;-------Exit-----------------
mov ax, 4c00h
int 21h
ends
end start
تا یادم نرفته این کد ناقصه اگر کسی بلده کمک کنه
;-----------Data Segment---------
data segment
lastvideo db ?
ends
;-----------Code Segment---------
code segment
start:
;-------Save V Mode----------
mov ah,0fh
int 10h
mov lastvideo,al
;-------Graphic Mode---------
mov ah,00
mov al,12h
int 10h
;-------Red Square ------
mov ah,0ch
mov al,4 ;Color
mov cx,20 ;Column
p2: mov dx,20 ;Row
p1: inc dx
cmp dx,40
int 10h
jnz p1
inc cx
cmp cx,40
jnz p2
;-------Green Square ------
mov ah,0ch
mov al,2 ;Color
mov cx,60 ;Column
p4: mov dx,20 ;Row
p3: inc dx
cmp dx,40
int 10h
jnz p3
inc cx
cmp cx,80
jnz p4
;-------Blue Square ------
mov ah,0ch
mov al,1 ;Color
mov cx,20 ;Column
p6: mov dx,60 ;Row
p5: inc dx
cmp dx,80
int 10h
jnz p5
inc cx
cmp cx,40
jnz p6
;-------Grey Square ------
mov ah,0ch
mov al,8 ;Color
mov cx,60 ;Column
p8: mov dx,60 ;Row
p7: inc dx
cmp dx,80
int 10h
jnz p7
inc cx
cmp cx,80
jnz p8
;-------White Square ------
mov ah,0ch
mov al,7 ;Color
mov cx,20 ;Column
p10: mov dx,100 ;Row
p9: inc dx
cmp dx,120
int 10h
jnz p9
inc cx
cmp cx,40
jnz p10
;-------Yellow Square ------
mov ah,0ch
mov al,14 ;Color
mov cx,60 ;Column
p12: mov dx,100 ;Row
p11: inc dx
cmp dx,120
int 10h
jnz p11
inc cx
cmp cx,80
jnz p12
;-------Exit ------
mov ah,0ch
mov al,5 ;Color
mov cx,20 ;Column
p14: mov dx,140 ;Row
p13: inc dx
cmp dx,160
int 10h
jnz p13
inc cx
cmp cx,40
jnz p14
;-------Clear Screen ------
mov ah,0ch
mov al,6 ;Color
mov cx,60 ;Column
p16: mov dx,140 ;Row
p15: inc dx
cmp dx,160
int 10h
jnz p15
inc cx
cmp cx,80
jnz p16
;-------Left Top Point ------
mov ah,0ch
mov al,15 ;Color
mov cx,100 ;Column
mov dx,20 ;Row
p17:inc dx
cmp dx,160
int 10h
jnz p17
;-------Left Bottom Point----
mov ah,0ch
mov al,15 ;Color
mov cx,100 ;Column
mov dx,160 ;Row
p18:inc cx
cmp cx,240
int 10h
jnz p18
;-------Right Bottom Point---
mov ah,0ch
mov al,15 ;Color
mov cx,240 ;Column
mov dx,160 ;Row
p19:dec dx
cmp dx,20
int 10h
jnz p19
;-------Right Top Point------
mov ah,0ch
mov al,15 ;Color
mov cx,240 ;Column
mov dx,20 ;Row
p20:dec cx
cmp cx,100
int 10h
jnz p20
;-------Exit-----------------
mov ax, 4c00h
int 21h
ends
end start