Ensamblador - Mostrar en colores diferentes el mayor de los dígitos

 
Vista:
sin imagen de perfil

Mostrar en colores diferentes el mayor de los dígitos

Publicado por Javier Alejandro (1 intervención) el 08/01/2020 22:35:55
Necesito saber como modificar el sig codigo para q me permita mostrar en colores diferentes el mayor d los digitos, las consonants y las vocales q aparecen como resultado.
El codigo conciste en introducir una cadena, y como resultado se muestra su longitud, si tiene ies("i") y se muestra la misma cadena.
El codigo lo dejo aki:


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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
.stack
.data
 
  cadena1 db 100 dup(' '),'$';
 
  msj db 'i$'
 
  msj3 db ' yes $ '
 
  msj4 db ' no $ '
 
  msj6 db 'Cadena a introdrucir: $'
 
.code
 
 mov ax, @data
 
 mov ds, ax
 
 mov ah,06h
 
 mov al,00h
 
 mov bh,07h
 
 mov cx,0000h
 
 mov dx,184fh
 
 int 10h
 
 
 mov ah,02
 
 mov dx,0000h
 
 mov bh,00
 
 int 10h
 
 mov ah,09
 
 mov dx,offset msj6
 
 int 21h
 
 
 
 
 lea SI,cadena1
 
 
 mov cx,100
 
 regresa:
 
    mov ah,07h
 
 
    int 21h
 
    cmp al,13
 
    je termina
 
    mov [SI],al
 
 
    inc SI
 
    inc bx
 
    mov dl,al
 
    mov ah,02h
 
 
    int 21h
 
    loop regresa
 
 
  termina:
 
 mov al,bl
 
 and ax,000fh
 
 and bx,00f0h
 
 shr bx,01
 
 mov ah,bl
 
 cmp al,0ah
 
 jb dejar
 
 daa
 
 inc ah
 
 
 dejar:
 mov bl,al
 
 mov al,ah
 
 cmp al,0ah
 
 jb decena
 
 daa
 
 mov dx,31h
 
 decena:
 
 mov bh,al
 
 and bx,0f0fh
 
 or bx,3030h
 
 mov cx,bx
 
 
 mov ah,02
 
 mov dx,0100h
 
 mov bh,00
 
 int 10h
 
 
 mov dl,ch
 
 mov dh,cl
 
 
 mov ah,02
 
 mov cx,01
 
 int 21h
 
 
 mov ch,dh
 
 mov dl,ch
 
 int 21h
 
 
mov si, 0
 
comienzo:
 
cmp msj[si], '$'
 
jz resultado
 
mov di, 0
 
comprobar:
 
mov al, cadena1[di]
 
cmp msj[si], al
 
jz seguir
 
inc di
 
cmp cadena1[di], '$'
 
jz final
 
loop comprobar
 
seguir:
 
inc si
 
loop comienzo
 
resultado:
 
mov dx, offset msj3
 
mov ah, 9
 
int 21h
 
jmp ending
 
final:
 
mov dx, offset msj4
 
mov ah, 9
 
int 21h
 
ending:
 
lea dx, cadena1
 
mov ah, 9
 
int 21h
 
 
 
mov ah, 0
int 16h
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