You are on page 1of 2

Readkey MACRO MOV AH,00 INT 16h ENDM

SetCRT MACRO Mode MOV AH,00 MOV AL,Mode INT 10h ENDM

PutPixel MACRO X,Y,Warna PUSH AX PUSH BX PUSH CX PUSH DX MOV AH,12 ; Servis menggambar pixel MOV CX,X ; Posisi kolom atau X MOV DX,Y ; Posisi baris atau Y MOV AL,Warna ; Atribut Pixel INT 10h ; Gambar pixel tersebut ! POP DX POP CX POP BX POP AX ENDM GarisV MACRO X1,Y1,Panjang,Warna LOCAL Ulang PUSH DX PUSH CX MOV DX,Y1 MOV CX,Panjang Ulang: PutPixel X1,DX,Warna INC DX LOOP Ulang POP CX POP DX ENDM

GarisH MACRO X1,Y1,Panjang,Warna LOCAL Ulang PUSH CX PUSH DX

MOV DX,X1 MOV CX,Panjang Ulang: PutPixel DX,Y1,Warna INC DX LOOP Ulang POP DX POP CX ENDM Kotak MACRO X1,Y1,X2,Y2,Warna GarisH X1,Y1,X2-X1,Warna GarisV X1,Y1,Y2-Y1,Warna GarisV X2,Y1,Y2-Y1,Warna GarisH X1,Y2,X2-X1+1,Warna ENDM KotakW MACRO X1,Y1,X2,Y2,Warna LOCAL Ulang1,Ulang2 PUSH AX PUSH CX MOV AX,Y1+1 MOV CX,Y2-Y1-1 Ulang1: GarisH X1+1,AX,X2-X1-1,Warna INC AX LOOP Ulang1 POP CX POP AX ENDM

.MODEL SMALL .CODE ORG 100h Proses: SetCRT 13h Kotak 120,30,180,100,12 ; Gambar kotak Readkey KotakW 120,30,180,100,09 ; Warnai kotak Readkey SetCRT 03h INT 20h END Proses