; MENUPROG.ASM
; (C)opyright Erdogan Tan. 31/10/2000

CODE_SEG_1	segment para public
		assume  CS:CODE_SEG_1, DS:CODE_SEG_1, SS:CODE_SEG_1, ES:CODE_SEG_1


                org    100h


;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
;±
;±		ENTRY POINT
;±
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±


;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
;±
;±		PROCEDURE proc_start
;±
;±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±

proc_start	proc	far

Start:
    call proc_clear_screen

loc_cursor_save:
         mov ah, 3
         int 10h
         mov word ptr [Cursor], cx

loc_cursor_off:
         mov ah, 1
         mov ch, 1
         mov cl, 0
         int 10h

    mov si, offset Pencere
    call proc_printmsg

    mov ah, 34
    mov al, 7
    mov dh, 112
    mov dl, 11
    call proc_bant

    mov ah, 29
    mov al, 10
    mov byte ptr [Cursor_Line], al
    mov dh, 112
    mov dl, 21
    call proc_bant

loc_repeat_get_char:
    xor ah, ah
    int 16h
    cmp ah, 72
    je  short loc_cursor_up
    cmp ah, 80
    je  short loc_cursor_down
    cmp al, 27
    je short loc_end_of_program
    cmp al, 13
    jne short loc_repeat_get_char

    mov ax, 0E07h
    int 10h

loc_end_of_program:

    mov cx, word ptr [Cursor]
    mov ah, 1
    int 10h

    int 20h

loc_cursor_up:
    cmp byte ptr [Cursor_Line], 10
    jna short loc_repeat_get_char
    mov al, byte ptr [Cursor_Line]
    mov ah, 29
    mov dh, 7
    mov dl, 21
    call proc_bant
    dec byte ptr [Cursor_Line]
    mov al, byte ptr [Cursor_Line]
    mov ah, 29
    mov dh, 112
    mov dl, 21
    call proc_bant
    jmp short loc_repeat_get_char

loc_cursor_down:
    cmp byte ptr [Cursor_Line], 16
    jnb short loc_repeat_get_char
    mov al, byte ptr [Cursor_Line]
    mov ah, 29
    mov dh, 7
    mov dl, 21
    call proc_bant
    inc byte ptr [Cursor_Line]
    mov al, byte ptr [Cursor_Line]
    mov ah, 29
    mov dh, 112
    mov dl, 21
    call proc_bant
    jmp short loc_repeat_get_char

proc_start      endp

proc_clear_screen proc near
    mov ah, 0Fh
    int 10h
    mov ah, 0
    int 10h

    retn

proc_clear_screen endp

Proc_Bant  proc near
; AH = Column , AL = Line , DH = Colour, DL = Lenght
; DH = 112 -> reverse  ; AH= 35 AL= 8 DL=8 
        push ax
        mov  cl, 160
        mul  cl
        mov  cx, ax
        pop  ax
        mov  al, ah
        xor  ah, ah
        shl  al, 1
        add  ax, cx
        push si
        push ax
        xor  ch, ch
        mov  cl, dl
        pop  si
        mov  ax, 0B800h
        push ds
        mov  ds, ax
tekrar_renk:
        mov  byte ptr [SI]+1, dh
        inc  si
        inc  si
        loop tekrar_renk
        pop  ds
        pop  si

        retn

proc_bant   endp

proc_printmsg   proc    near

loc_5:		; N-Ref=1
		lodsb				; Load byte at DS:SI to AL
		and	AL,AL			
		je	loc_6			; Jump if equal ( = )
		mov	AH,0Eh			
		mov	BX,7			
		int	10h			; BIOS Service func ( ah ) = 0Eh
						; Write char as TTY
						;AL-char BH-page BL-color
		jmp	short loc_5		
loc_6:		; N-Ref=1
		retn				

proc_printmsg         endp

Pencere:

dw 7 dup (0A0Dh)
db 25 dup (20h)
db "ÚÄÄÄÄÄÄÄÄ MAIN MENU ÄÄÄÄÄÄÄÄ¿"
db 0Ah, 0Dh
db 25 dup (20h)
db "³                           ³"
db 0Ah, 0Dh
db 25 dup (20h)
db "³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³"
db 0Ah, 0Dh
db 25 dup (20h)
db "³ ³  SYSTEM COMMAND LINE  ³ ³"
db 0Ah, 0Dh
db 25 dup (20h)
db "³ ³  BORLAND C++          ³ ³"
db 0Ah, 0Dh
db 25 dup (20h)
db "³ ³  VISUAL BASIC         ³ ³"
db 0Ah, 0Dh
db 25 dup (20h)
db "³ ³  AUTOCAD R12          ³ ³"
db 0Ah, 0Dh
db 25 dup (20h)
db "³ ³  PC TOOLS             ³ ³"
db 0Ah, 0Dh
db 25 dup (20h)
db "³ ³  WINDOWS              ³ ³"
db 0Ah, 0Dh
db 25 dup (20h)
db "³ ³  VISUAL BASIC         ³ ³"
db 0Ah, 0Dh
db 25 dup (20h)
db "³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³"
db 0Ah, 0Dh
db 25 dup (20h)
db "ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ"
db 0Ah, 0Dh, 0Dh, 0

Cursor:
dw 0

Cursor_Line:
db 0

CODE_SEG_1	ends

                end     start
