Advertisement
aureliocavalitto

Ejercicio 9 modificado AurelioCavalitto

Sep 15th, 2021
1,538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .MODEL SMALL
  2. .STACK
  3. .DATA  
  4.    
  5. caracter db "8" ; Ejercicio 9 Modificado
  6. digito db ?
  7. texto1 DB "Ingreso un numero", "$"      
  8. texto2 DB "No ingreso un numero","$"
  9.  
  10. .CODE
  11. inicio:
  12.    mov ax,@data ; Inicializar el segmento de datos
  13.    mov ds, ax
  14.    
  15.    mov dl,caracter
  16.    
  17.    cmp dl,"0"
  18.    jl noesNumero    
  19.    
  20.    cmp dl, "9"
  21.    jg noesNumero
  22.    
  23.    mov dx, offset texto1  ;Si es un numero lo
  24.    mov ah, 09h            ;imprime por pantalla
  25.    int 21h
  26.    
  27.    jmp final
  28.    
  29.    noesNumero:  
  30.       mov dx, offset texto2  ;Si no es un numero
  31.       mov ah, 09h            ;lo imprime por pantalla
  32.       int 21h
  33.      
  34.    final:
  35.    
  36.    mov ax,4C00h ; Terminar
  37.    int 21h
  38.    
  39. END inicio
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement