SHOW:
|
|
- or go back to the newest paste.
1 | - | ORG $1000 |
1 | + | ORG $1000 |
2 | START: ; first instruction of program | |
3 | ||
4 | MOVE.L #CELDAS,A3 | |
5 | REINICIO | |
6 | MOVE.B #4,D4 ;CONTADOR | |
7 | BUCLE1 | |
8 | MOVE.L #1,D1 | |
9 | MOVE.B (A3)+,D2 ;COGEMOS UN ELEMENTO EN D2 | |
10 | LSL.L D2,D1 ;OBTENEMOS LA POTENCIA DE 2 | |
11 | ||
12 | JSR IMPRIME | |
13 | ||
14 | * MOVE.L #3,D0 | |
15 | * TRAP #15 ;IMPRIME EL NÚMERO DIRECTAMENTE | |
16 | ||
17 | * JSR ESPACIO | |
18 | ||
19 | SUB.B #1,D4 | |
20 | BNE BUCLE1 ¿VAN 4? | |
21 | ||
22 | CMP.L #CELDAS+16,A3 ¿ESTAN TODAS? | |
23 | BEQ COMPLETO | |
24 | ||
25 | JSR SALTOLIN ;SALTA LINEA SIGUIENTE | |
26 | JMP REINICIO | |
27 | ||
28 | ||
29 | COMPLETO | |
30 | ||
31 | ||
32 | * Put program code here | |
33 | ||
34 | SIMHALT ; halt simulator | |
35 | ||
36 | ESPACIO MOVE.L #6,D0 | |
37 | MOVE.B #' ',D1 | |
38 | TRAP #15 | |
39 | RTS | |
40 | ||
41 | IMPRIME CMP.B #1,D1 ;¿ES UN VACIO? | |
42 | BEQ PRINVACIOS | |
43 | ||
44 | MOVE.L #20,D0 | |
45 | MOVE.L #6,D2 | |
46 | TRAP #15 ;IMPRIME DEJANDO SIEMPRE 6 ESPACIOS | |
47 | RTS | |
48 | ||
49 | PRINVACIOS | |
50 | MOVE.L #14,D0 | |
51 | MOVE.L #VACIOS6,A1 | |
52 | TRAP #15 | |
53 | RTS | |
54 | ||
55 | SALTOLIN MOVE.L #6,D0 | |
56 | MOVE.L #$A,D1 ;AVANCE LINEA | |
57 | TRAP #15 | |
58 | MOVE.L #$D,D1 ;RETORNO CARRO | |
59 | TRAP #15 | |
60 | RTS | |
61 | ||
62 | * Put variables and constants here | |
63 | ||
64 | *CELDAS DS.B 16 *Reservo 16 posiciones de las celdas | |
65 | ||
66 | ||
67 | CELDAS DC.B 1,1,2,7 | |
68 | DC.B 0,0,0,1 | |
69 | DC.B 1,2,0,0 | |
70 | DC.B 3,1,0,1 | |
71 | ||
72 | VACIOS6 DC.B ' ',0 | |
73 | ||
74 | END START ; last line of source |