
ayuda con entrada de numeros
Publicado por Mauro (1 intervención) el 02/05/2018 06:51:11
buenas noches tengo este codigo en lenguaje de ensamblador pero quiero es que el mensaje (ingrese un numero) se repita si no que solo salga una ves por numero y tambien como hago que me iguale a cero ya que me piden que el numero ingresado se verifique si es par o impar igual a cero.
gracias:
gracias:
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
name "NPI"
org 100h
jmp inicio:
msj db 'Ingrese un numero: ','$'
n1 db ' Es un Numero Par', 0ah, 0dh, '$'
n2 db ' Es un Numero Impar', 0ah, 0dh, '$'
n3 db ?
;direccion de datos.
inicio proc far
mov ax, @data
mov ds,ax
; solicitar numeros al usuario.
mov ah,09h ; peticion
lea dx,msj ; carga la direccion.
int 21h; llamada al dos
leer:
mov ah, 0
int 16h
mov n3[0], al
sub al, 30h
and al, 0001b
cmp al, 0h
je par
jne impar
par:
mov dl, n3[0]
mov ah, 2
int 21h
lea dx, n1
mov ah, 9
int 21h
jmp inicio
impar:
mov dl, n3[0]
mov ah, 2
int 21h
lea dx, n2
mov ah, 9
int 21h
jmp inicio:
ret
Valora esta pregunta


0