I want to create a pong game in EMU-8086 COMPILER ,in this program I have just created a ball and applies a function with increasing time (1/100 millisecond) ,ball moves from left to right but when I emulate the program it takes bit long time to create a ball and then going very slowly from left to right kindly tell me how to speed up the program
;IMP LINKS
;=======FOR INT 10H FUNCTIONS==========
;https://en.wikipedia.org/wiki/INT_10H#:~:text=List%20of%20supported%20functions%20%20%20%20Function,End%20s%20...%20%2017%20more%20rows%20
;https://stanislavs.org/helppc/int_10.html
;======INT 21H FUNCTIONS==============
; http://spike.scu.edu.au/~barry/interrupts.html#ah2c
org 100h
.MODEL SMALL
.STACK 100H
.DATA
BALL_X DW 0AH ;FOR X-AXIS
BALL_Y DW 0AH ;FOR Y-AXIS
BALL_SIZE DW 04h ;size of the ball (width and height)
TIME_AUX DB 0 ;VARIABLE USED FOR CHECKING IF THE TIME HAS CHANGED OR NOT
.CODE
main proc
MOV AX,@DATA
MOV DS,AX
;INT 10h commands
MOV AH,00h ; for configuration to video mode
MOV AL,13h ; for 320x200 256 color graphics (MCGA,VGA)
INT 10h ;FOR EXECUTING PROGRAM
;for background color
; MOV AH,0Bh ; SET CONFIGURATION
; MOV BH,00h ; to bg color
; MOV BL,0Dh ; dh=pink color
; INT 10h ; executing function
;=========================
;FOR TIME
CHECKTIME:
MOV AH,2CH ;CONFIGURING TIME
INT 21H ; CH = hour CL = minute DH = second DL = 1/100 seconds
CMP DL,TIME_AUX ;IS THE CURRENT TIME EQUAL TO THE PREVIOUS ONE
JE CHECKTIME ;IF IT'S SAME THEN CHECK AGAIN
;IF ITS DIFFERENT THEN DRAW,MOVE ETC
MOV TIME_AUX,DL
INC BALL_X
CALL DRAWBALL
JMP CHECKTIME ;AFTER EVERYTIHING CHECK TIME AGAIN
MOV AH,4CH
INT 21H
DRAWBALL PROC
;BALL LOCATION
MOV CX,BALL_X ;set X-AXIS LOCATION (X)
MOV DX,BALL_Y ; set Y-AXIS LOCATION (Y)
DRAWBALL_HORIZONTAL:
;for pixel INFORMATION
MOV AH,0CH ; for configuring graphic pixel
MOV AL,0Fh ; for white color pixel
MOV BH,00h ; for page number
INT 10H
INC CX ;PRINTING PIXEL/DOT UNTIL 4COL IN 1ST ROW
MOV AX,CX ;CX-BALL_X>BALL_SIZE (THEN WO GO TO THE NEXT LINE)
SUB AX,BALL_X
CMP AX,BALL_SIZE
JNG DRAWBALL_HORIZONTAL
MOV CX,BALL_X ; CX REGISTER GOES BAX TO INITIAL COLUM
INC DX ; FOR GOING TO NEXT LINE
MOV AX,DX
SUB AX,BALL_Y
CMP AX,BALL_SIZE
JNG DRAWBALL_HORIZONTAL
RET
DRAWBALL ENDP
END PROC
ret