;EXTRA FUNCTIONS
DUMP_REGISTERS:	
	PUSH AX
	PUSH DX
	PUSH CX
	PUSH BX
	PUSH AX	
	
	MOV AH, 0X0E
	MOV AL, ' '
	INT 0X10
	MOV AL, 'A'
	INT 0X10
	MOV AL, 'X'	
	INT 0X10
	MOV AL, '='
	INT 0X10	
	POP AX
	PUSH AX
	MOV AL, AH
	CALL WIRTE_AL_INT10_E
	POP AX
	CALL WIRTE_AL_INT10_E
	
	MOV AH, 0X0E
	MOV AL, ' '
	INT 0X10
	MOV AL, 'B'
	INT 0X10
	MOV AL, 'X'	
	INT 0X10
	MOV AL, '='
	INT 0X10	
	POP AX
	PUSH AX
	MOV AL, AH
	CALL WIRTE_AL_INT10_E
	POP AX
	CALL WIRTE_AL_INT10_E
	
	MOV AH, 0X0E
	MOV AL, ' '
	INT 0X10
	MOV AL, 'C'
	INT 0X10
	MOV AL, 'X'	
	INT 0X10
	MOV AL, '='
	INT 0X10	
	POP AX
	PUSH AX
	MOV AL, AH
	CALL WIRTE_AL_INT10_E
	POP AX
	CALL WIRTE_AL_INT10_E
	
	MOV AH, 0X0E
	MOV AL, ' '
	INT 0X10
	MOV AL, 'D'
	INT 0X10
	MOV AL, 'X'	
	INT 0X10
	MOV AL, '='
	INT 0X10	
	POP AX
	PUSH AX
	MOV AL, AH
	CALL WIRTE_AL_INT10_E
	POP AX
	CALL WIRTE_AL_INT10_E
	
	MOV AH, 0X0E
	MOV AL, 0X0D
	INT 0X10
	MOV AL, 0X0A
	INT 0X10	
	POP AX
	RET
;;;;;;;;;;;;;;;;;;;;;;;
;WRITE TO SCREEN;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;
WIRTE_AL_INT10_E:

	PUSH AX
	PUSH BX
	PUSH CX
	PUSH DX

	MOV BL, AL

	MOV DH, AL
	MOV CL, 0X04
	SHR DH, CL

	MOV AL, DH
	AND AL, 0X0F
	CMP AL, 0X09
	JA LETTER_HIGH

	ADD AL, 0X30
	JMP PRINT_VALUE_HIGH

	LETTER_HIGH:
	ADD AL, 0X37

	PRINT_VALUE_HIGH:
	MOV AH, 0X0E
	INT 0X10

	MOV AL, BL
	AND AL, 0X0F
	CMP AL, 0X09
	JA LETTER_LOW

	ADD AL, 0X30
	JMP PRINT_VALUE_LOW

	LETTER_LOW:
	ADD AL, 0X37

	PRINT_VALUE_LOW:
	MOV AH, 0X0E
	INT 0X10

	POP DX
	POP CX
	POP BX
	POP AX

	RET

WAIT_1:
	PUSH CX
	MOV CX, 0XFFFF
  .LOOP1:
	LOOP .LOOP1
	POP CX
	RET

WAIT_8:
	PUSH CX
	MOV CX, 8
  .LOOP1:
	PUSH CX
	MOV CX, 0XFFFF
  .LOOP2:
	LOOP .LOOP2
	POP CX
	LOOP .LOOP1
	POP CX
	RET
	
WAIT_16:
	PUSH CX
	MOV CX, 16
  .LOOP1:
	PUSH CX
	MOV CX, 0XFFFF
  .LOOP2:
	LOOP .LOOP2
	POP CX
	LOOP .LOOP1
	POP CX
	RET
	
WAIT_32:
	PUSH CX
	MOV CX, 32
  .LOOP1:
	PUSH CX
	MOV CX, 0XFFFF
  .LOOP2:
	LOOP .LOOP2
	POP CX
	LOOP .LOOP1
	POP CX
	RET

WAIT_64:
	PUSH CX
	MOV CX, 64
  .LOOP1:
	PUSH CX
	MOV CX, 0XFFFF
  .LOOP2:
	LOOP .LOOP2
	POP CX
	LOOP .LOOP1
	POP CX
	RET

WAIT_128:
	PUSH CX
	MOV CX, 128
  .LOOP1:
	PUSH CX
	MOV CX, 0XFFFF
  .LOOP2:
	LOOP .LOOP2
	POP CX
	LOOP .LOOP1
	POP CX
	RET
	
	
WAIT_512:
	PUSH CX
	MOV CX, 512
  .LOOP1:
	PUSH CX
	MOV CX, 0XFFFF
  .LOOP2:
	LOOP .LOOP2
	POP CX
	LOOP .LOOP1
	POP CX
	RET



