Advertisement
Geovanny

ProyectoArquitectura2, progra.asm

Dec 31st, 2012
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .model tiny
  2.  
  3. include macros.asm
  4.        
  5. .code  
  6.     .startup    
  7.     ; PRESENTACIÓN    
  8.    
  9.     ;mov ax, @data                
  10.     ;mov ds, ax
  11.  
  12.     dibujar_bandera
  13.  
  14.     limpiar_pantalla
  15.    
  16.     pintar_interfaz  
  17.    
  18.     pintar_about  
  19.     obtener_fecha
  20.                            
  21.     inicializar_mouse
  22.        
  23.     bucle:  
  24.                        
  25.         mov ax,3h ;Se obtiene el estado del boton derecho
  26.         int 33h              
  27.  
  28.         ; El estado del boton se guarda en el registro bx (si fue presionado)  
  29.  
  30.         cmp bx,1 ;1 para click izquierdo
  31.         je comprobar_x ; Si bx y 1 son iguales, el boton izquierdo fue presionado
  32.  
  33.         ;else  
  34.        
  35.         obtener_hora
  36.         print_location hora 20,6
  37.         jmp bucle ; Si el jump no hace nada, volver a verificar  
  38.  
  39.  
  40.  comprobar_x:
  41.         shr cx,3 ; división entre 8
  42.          
  43.         ; BOTON SALIR X ------------------------------
  44.         cmp cx,1
  45.         je comprobar_y  
  46.         cmp cx,2
  47.         je comprobar_y
  48.         cmp cx,3
  49.         je comprobar_y
  50.         cmp cx,4
  51.         je comprobar_y
  52.         cmp cx,5
  53.         je comprobar_y        
  54.         cmp cx,6
  55.         je comprobar_y  
  56.         cmp cx,7
  57.         je comprobar_y
  58.         cmp cx,8
  59.         je comprobar_y
  60.         cmp cx,9
  61.         je comprobar_y
  62.         cmp cx,10
  63.         je comprobar_y  
  64.         cmp cx,11
  65.         je comprobar_y  
  66.         cmp cx,12
  67.         je comprobar_y
  68.         cmp cx,13
  69.         je comprobar_y
  70.         cmp cx,14
  71.         je comprobar_y
  72.         cmp cx,15
  73.         je comprobar_y  
  74.         cmp cx,16
  75.         je comprobar_y
  76.         cmp cx,17
  77.         je comprobar_y  
  78.         cmp cx,18
  79.         je comprobar_y                  
  80.         ;else
  81.         jmp bucle
  82.  
  83.    
  84.     comprobar_y:
  85.  
  86.         shr dx,3 ; división entre 8    
  87.  
  88.         ; BOTON ABOUT Y --------------------------------------
  89.         cmp dx,1
  90.         ;si coincide
  91.         je pintar_panel_about  
  92.        
  93.         ; BOTON VIDEO Y --------------------------------------
  94.         cmp dx,3
  95.         ;si coincide
  96.         je pintar_panel_video  
  97.  
  98.         ; BOTON OS Y --------------------------------------
  99.         cmp dx,5
  100.         ;si coincide
  101.         je pintar_panel_os  
  102.  
  103.          ; BOTON PROCESADOR Y --------------------------------------
  104.         cmp dx,7
  105.         ;si coincide
  106.         je pintar_panel_procesador  
  107.  
  108.         ; BOTON MEMORIA Y --------------------------------------
  109.         cmp dx,9
  110.         ;si coincide
  111.         je pintar_panel_memoria
  112.  
  113.         ; BOTON HD Y --------------------------------------
  114.         cmp dx,11
  115.         ;si coincide
  116.         je pintar_panel_hd  
  117.        
  118.         ; BOTON SALIR Y --------------------------------------
  119.         cmp dx,13  
  120.         ;si coincide
  121.         je terminar  
  122.        
  123.         ;else
  124.         jmp bucle
  125.  
  126.     terminar:
  127.         mov ax,02h ;Oculta el apuntador del ratón
  128.         int 33h  
  129.        
  130.         ; Devuelve la consola a su estado normal          
  131.         mov ah,00h ; Establece el modo de texto
  132.         mov al,03h
  133.         int 10h
  134.    
  135.         .exit ; El conjunto de instrucciones para salir, incluidas en salir
  136.        
  137.    
  138. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement