Menú

Código:

pila segment stack 'stack'
db 100h dup (?)
pila ends

datos segment
     titulo db 13,10,'CAMBIAR FONDO DE PANTALLA',13,10,10,'Menu:',13,10,10,'$'
     mensaje db '1.-Pantalla Azul y letras Rosas',13,10,'2.-Pantalla Morada y Letras Amarillas ',13,10,'3.-Pantalla Gris y Letras Celestes',13,10,'4.-Pantalla Roja y Letras Verdes',13,10,10,'Para salir, presione cualquier tecla...',13,10,'$'
datos ends

codigo segment ;segmento de codigo
assume cs:codigo, ss:pila, ds:datos
    inicio:
         mov ah,0
         mov al,3h
         int 10h
       
         mov ax,0600h
         mov bh,0fh
         mov cx,0000h
         mov dx,184Fh
         int 10h
       
         mov ah,02h
         mov bh,00
         mov dh,00
         mov dl,00
         int 10h

            mov ax,datos
            mov ds,ax
            lea dx,titulo
            mov ah,9h
            int 21h
         
            lea dx,mensaje
            mov ah,9h
            int 21h
         
            mov ah,08
            int 21h
         
            cmp al,49
            je llamarAzul
            cmp al,50
            je llamarMorado
            cmp al,51
            je llamarGris
            cmp al,52
            je llamarRojo
            jmp fin

            fin:
            mov ax,4c00h
            int 21h
         
            llamarAzul:
            CALL AZULPROC
         
            llamarMorado:
            CALL MORADOPROC
         
            llamarGris:
            CALL GRISPROC
         
            llamarRojo:
            CALL ROJOPROC
         
         
AZULPROC PROC NEAR
            mov ah,0
            mov al,3h
            int 10h
         
             mov ax,0600h
             mov bh,0fh
             mov cx,0000h
             mov dx,184Fh
             int 10h
           
             mov ah,02h
             mov bh,00
             mov dh,00
             mov dl,00
             int 10h
           
            mov ah,06h
            mov bh,1dh
            mov cx,0000h
            mov dx,184fh
            int 10h
         
            mov ax,4c00h
            int 21h
RET
AZULPROC ENDP

MORADOPROC PROC NEAR
             mov ah,0
             mov al,3h
             int 10h
           
             mov ax,0600h
             mov bh,0fh
             mov cx,0000h
             mov dx,184Fh
             int 10h
           
             mov ah,02h
             mov bh,00
             mov dh,00
             mov dl,00
             int 10h
           
            mov ah,06h
            mov bh,5eh
            mov cx,0000h
            mov dx,184fh
            int 10h
         
            mov ax,4c00h
            int 21h
RET
MORADOPROC ENDP
         
GRISPROC PROC NEAR
            mov ah,0
            mov al,3h
            int 10h
           
            mov ax,0600h
            mov bh,0fh
            mov cx,0000h
            mov dx,184Fh
            int 10h
           
            mov ah,02h
            mov bh,00
            mov dh,00
            mov dl,00
            int 10h
           
            mov ah,06h
            mov bh,7bh
            mov cx,0000h
            mov dx,184fh
            int 10h
         
            mov ax,4c00h
            int 21h
RET
GRISPROC ENDP
         
ROJOPROC PROC NEAR
             mov ah,0
             mov al,3h
             int 10h

             mov ax,0600h
             mov bh,0fh
             mov cx,0000h
             mov dx,184Fh
             int 10h

             mov ah,02h
             mov bh,00
             mov dh,00
             mov dl,00
             int 10h

            mov ah,06h
            mov bh,4ah
            mov cx,0000h
            mov dx,184fh
            int 10h

            mov ax,4c00h
            int 21h
RET
ROJOPROC ENDP
         
codigo ends
end inicio
 





Comentarios

Entradas más populares de este blog

1.4 Aspectos matemáticos de la graficación (Geometría Fractal)

Registros de propósito general

1.2 El procesador y sus registros internos