Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *-----------------------------------------------------------
- * Title : RATON GRAFICO X-Y
- * Written by : FULGENCIO
- * Date :
- * Description:
- *-----------------------------------------------------------
- ORG $1000
- START: ; first instruction of program
- * * Este codigo adicional es para pintar un rectangulo de color cambiante
- * MOVE.L #87,D0 *PINTA PANTALLA DE NUEVO COLOR
- * MOVE.L #150,D1
- * MOVE.L #350,D2
- * MOVE.L #200,D3
- * MOVE.L #400,D4
- * TRAP #15
- *****************************
- RATON MOVE.L #61,D0
- MOVE.L #0,D1
- TRAP #15 *Comprueba estado del ratón
- BTST #0,D0 * Este bit corresponde con el botón left
- BEQ RATON * Si no hay left-click repite lectura
- * D1 = COOR_Y|COOR_X ; Hay que separar
- SWAP D1
- MOVE.W D1,D2 * D2.W=COOR_Y
- CLR.W D1
- SWAP D1 * D1.W=COOR_X
- MOVE.L #83,D0
- TRAP #15 * OBTIENE COLOR DE LA COORDENADA X,Y = (D1,D2)
- MOVE.L D0,D7 * GUARDA COLOR EN D7
- MOVE.L #14,D0
- MOVE.L #XIGUAL,A1
- TRAP #15
- MOVE.L #3,D0 * PRESENTA COORDENADA X=D1
- TRAP #15
- MOVE.L #14,D0
- MOVE.L #YIGUAL,A1
- TRAP #15
- MOVE.L #3,D0 * PRESENTA COORDENADA Y=D2
- MOVE.L D2,D1 * COPIA EN D1 PORQUE ES EL QUE PRESENTA LA TASK3
- TRAP #15
- MOVE.L #14,D0
- MOVE.L #COLOR,A1
- TRAP #15
- MOVE.L #15,D0 * PRESENTA COLOR EN HEXA (TASK 15)
- MOVE.L D7,D1
- MOVE.L #16,D2 * HEXADECIMAL (BASE 16)
- TRAP #15
- *Esto calcula el nuevo color para el rectangulo cambiante
- * ADD.L #$80,D7
- * MOVE.L #81,D0
- * MOVE.L D7,D1 * NUEVO COLOR
- * TRAP #15
- *******************
- JMP START
- SIMHALT ; halt simulator
- * Put variables and constants here
- XIGUAL DC.B 13,10,13,10,'X=',0
- YIGUAL DC.B 13,10,'Y=',0
- COLOR DC.B 13,10,'COLOR=',0
- END START ; last line of source
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement