Ensamblador - Corrección de codigo assembler

 
Vista:

Corrección de codigo assembler

Publicado por Manuel (1 intervención) el 21/03/2019 03:32:16
Hola, una pregunta, que tiene mal este código en ensamblador?


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
LIST=16F84A
INCLUDE (P16F84A.INC)
CONTA1 EQU 0X0C
CONTA2 EQU 0X0D
ORG 0x00
GOTO INICIO
ORG 0X05
 
INICIO bsf STATUS,5
       bsf TRISA,0
       bsf TRISA,1
       bsf TRISA,2
       clrf TRISB
       bcf STRATUS,5
       clrf PORTA
       clrf PORTB
BUCLE  movf PORTA,0
       movwf AUX
       btfsc STATUS,Z
       GOTO CERO
       Movlw b'0000001'
       Subwf AUX,0
       btfsc STATUS,Z
       GOTO UNO
       Movlw b'0000010'
       Subwf AUX,0
       btfsc STATUS,Z
       GOTO DOS
       Movlw b'0000011'
       Subwf AUX,0
       btfsc STATUS,Z
       GOTO TRES
       Movlw b'0000100'
       Subwf AUX,0
       btfsc STATUS,Z
       GOTO CUATRO
       Movlw b'0000101'
       Subwf AUX,0
       btfsc STATUS,Z
         GOTO CINCO
    Movlw b'00000110'
    subwf AUX,0
    btfsc STATUS,Z
    GOTO SEIS
    ;******* SIETE
    movlw b'00000110'
    movwf PORTB
    GOTO BUCLE
 
    CERO   movlw b'0000000'
           movwf PORTB
           GOTO BUCLE
 
    UNO    movlw b'00000001'
           movwf PORTB
           GOTO BUCLE
 
    DOS    movlw b'00000011'
           movwf PORTB
           GOTO BUCLE
 
    TRES    movlw b'00000111'
           movwf PORTB
           GOTO BUCLE
 
    CUATRO   movlw b'00001111'
           movwf PORTB
           GOTO BUCLE
 
    CINCO   movlw b'00011111'
           movwf PORTB
           GOTO BUCLE
 
    SEIS   movlw b'00111111'
           movwf PORTB
           GOTO BUCLE
 
    RETARDO  movlw 0xff
             movwf CONTA1;CONTADOR1 = 0XFF
    REP1     movlw 0xff
             movwf CONTA2;CONTADOR2 = 0XFF
    REP2    decfsz CONTA2,1
            GOTO REP2
            decfsz CONTA1,1
            GOTO REP1
            RETURN
            END
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder