GuidePedia

0
.MODEL SMALL
.STACK 100H

;DRAW A LINE IN ROW
DRAW_ROW MACRO X
LOCAL L1
MOV AH,0CH ;DRAW PIX
MOV AL,02 ;COLR
MOV CX,10 ;COL 10
MOV DX , X ;RW X
L1: INT 10H
INC CX ;NXT COL
CMP CX,301 ;BYND COL 300
JL L1
ENDM
;DRAW A LINE IN COL
DRAW_COLUMN MACRO Y
LOCAL L2
MOV AH,0CH ;DRAW PIX
MOV AL,02 ;COLR
MOV CX , Y ;COL Y
MOV DX,10 ;RW 10
L2: INT 10H
INC DX ;NXT RW
CMP DX,191 ;BYND RW 189
JL L2
ENDM

.CODE
SET_DISPLAY_MODE PROC
;SET DISPLAY MODE AND DRAW BOUNDRY
MOV AH,0 ;SET MODE
MOV AL,13H ;MODE ,320*200 COLRS
INT 10H
;DRAW BOUNDRY
DRAW_ROW 10
DRAW_COLUMN 300
DRAW_ROW 191
DRAW_COLUMN 10

RET
SET_DISPLAY_MODE ENDP

DELAY PROC

PUSH CX
PUSH DX
PUSH AX
MOV     CX, 1H
MOV     DX, 2500H
MOV     AH, 86H
INT     15H
POP AX
POP DX
POP CX

RET
DELAY ENDP


CIRCLE PROC
PUSH CX
PUSH DX
     
MOV AH,0CH
        INT 10H

        INC DX
        INT 10H

        INC CX
        INC DX
        INT 10H

        INC CX
        INT 10H

        INC CX
        DEC DX
        INT 10H

        DEC DX
        INT 10H

        DEC CX
        DEC DX
        INT 10H

        DEC CX
        INT 10H

POP DX
POP CX
RET
CIRCLE ENDP

ROUND PROC
PUSH CX
PUSH DX
CALL DELAY
CALL CIRCLE

ADD DX,5
CALL DELAY
        CALL CIRCLE

        ADD CX,5
        ADD DX,5
CALL DELAY
        CALL CIRCLE

        ADD CX,5
CALL DELAY
CALL CIRCLE

        ADD CX,5
        SUB DX,5
CALL DELAY
        CALL CIRCLE

        SUB DX,5
CALL DELAY
        CALL CIRCLE

        SUB CX,5
        SUB DX,5
CALL DELAY
CALL CIRCLE

        SUB CX,5
CALL DELAY
CALL CIRCLE


POP DX
POP CX
RET

ROUND ENDP

FLOWER PROC
PUSH CX
PUSH DX

CALL ROUND

ADD DX,16
        CALL ROUND

        ADD CX,16
        ADD DX,16
        CALL ROUND

        ADD CX,16
CALL ROUND

        ADD CX,16
        SUB DX,16
        CALL ROUND

        SUB DX,16
        CALL ROUND

        SUB CX,16
        SUB DX,16
CALL ROUND

        SUB CX,16
CALL ROUND


POP DX
POP CX
RET

FLOWER ENDP

FULL PROC
PUSH BX
PUSH CX
PUSH DX

MOV BL,13
L1:
CALL CIRCLE
CALL DELAY
ADD DX,5
DEC BL
JNZ L1

POP DX
POP CX
POP BX
RET
FULL ENDP

BAR PROC
PUSH BX
PUSH CX
PUSH DX

MOV BL,7
L3:
CALL CIRCLE
CALL DELAY
ADD CX,5
DEC BL
JNZ L3

POP DX
POP CX
POP BX
RET
BAR ENDP

MAIN PROC
CALL SET_DISPLAY_MODE
;;;;; 1 START ;;;;;
MOV CX,63
MOV DX,64
MOV AL,4
CALL ROUND
MOV CX,40
MOV DX,55
MOV AL,5
CALL FLOWER

MOV DX,100
MOV CX,70
MOV AL,02
CALL FULL
MOV CX,75
CALL FULL
MOV AL,04
MOV CX ,58
MOV DX,165
CALL BAR
;;;; 1 END ;;;;;;;

;;;; 2 START ;;;;;
MOV CX,143
MOV DX,64
MOV AL,3
CALL ROUND
MOV CX,120
MOV DX,55
MOV AL,6
CALL FLOWER

MOV DX,100
MOV CX,150
MOV AL,02
CALL FULL
MOV CX,155
CALL FULL
MOV AL,03
MOV CX ,138
MOV DX,165
CALL BAR
;;;;; 2ND ENDD;;;;

;;;;; 3RD START ;;;;
MOV CX,223
MOV DX,64
MOV AL,7
CALL ROUND
MOV CX,200
MOV DX,55
MOV AL,1
CALL FLOWER

MOV DX,100
MOV CX,230
MOV AL,02
CALL FULL
MOV CX,235
CALL FULL
MOV AL,7
MOV CX ,218
MOV DX,165
CALL BAR
;;;;; 3RD END ;;;;;;
MOV AH,04CH
INT 21H
MAIN ENDP
END MAIN


Program Output:


Post a Comment

 
Top