Utilice lenguaje ensamblador para comparar los dos dígitos ingresados en el teclado y mostrar los resultados.
El siguiente programa funciona para números sin signo. Como referencia:
Fragmento de código
assume?cs: code
org?100h
start:
jmp?bbb
msg1db?10,13,'por favor?input?x:','$'
msg2db?10,13,'por favor?input?y:', '$'
xdb?
ydb?0
msg3db?10, 13, 'x=y', '$'
msg4db?10,13,'xgt;y','$'
msg5db?10,13,'xlt;y','$'
bbb:
push?cs
pop?ds
lea?dx, msg1
mov?ah, 09h
int? h
mov?ah, 1
int?21h
sub?al, 30h
mov?ah, 0
mov?bl, 10
mul?bl
mov?cl, al
mov?ah, 1
int?
sub?al .30h
mov?ah, 0
add?al, cl
mov?byte?ptr [x], al
lea?dx, msg2
mov?ah, 09h
int?21h
mov?ah, 1
mov?
sub?al, 30h
mov?ah, 0
mov?bl, 10
mul?bl
mov?cl, al
mov?ah, 1
int?h
sub?al , 30h
mov?ah, 0
add?al, cl
mov?byte?ptr[y], al
mov?bl,byte?ptr[x]
sub?al,bl
jz?l1
jc?l2
jmp ?l3
l1:
lea?dx, msg3
mov?ah, 9
int?h
jmp?exit1
l2:
lea?dx, msg4
mov?ah, 9
int?21h p> p>
jmp?exit1
l3:
lea?dx, msg5
mov?ah, 9
int?
;jmp?exit1
salida1:
mov?ah, 4ch
int?21h
códigos
end?