fork download
  1. ;************* Andrea Vanessa Dorado Aliaga*************************
  2. name "Examen"
  3.  
  4. org 100h
  5.  
  6. jmp start
  7. ;*******************palabra*****************************************
  8. m1:
  9.  
  10. s db 'assembler '
  11.  
  12.  
  13. s_size = $ - m1
  14. db 0Dh,0Ah,'$'
  15.  
  16. start:
  17.  
  18. ;***************************Imprimiendo la palabra a analizar*************
  19. mov ah, 9
  20. mov dx, offset s
  21. int 21h
  22. ;*************************** declarando reg*****************************
  23. xor ah,ah
  24. xor al,al
  25. xor bh,bh
  26. xor bl,bl
  27. xor ch,ch
  28. ;***************************proceso**************************************
  29. ;****apuntando al ultimo****
  30. lea di, s
  31. mov si, di
  32. add si, s_size
  33. dec si ; point to last char!
  34. mov cx, s_size
  35. ;****comparando***
  36. cmp cx, 'a'
  37. add ah,1
  38.  
  39.  
  40. cmp cx, 'e'
  41. add al,1
  42.  
  43. cmp cx, 'i'
  44. add bh,1
  45.  
  46. cmp cx, 'o'
  47. add bl,1
  48.  
  49. cmp cx, 'u'
  50. add ch,1
  51.  
  52.  
  53. cmp ah,1
  54. jmp cont
  55.  
  56. je es_vocales ; single char is always palindrome!
  57.  
  58.  
  59. next_char:
  60. mov al, [di]
  61. mov bl, [si]
  62. cmp al, bl
  63. jne notiene_5
  64. inc di
  65. dec si
  66. loop next_char
  67.  
  68.  
  69.  
  70.  
  71. cont:
  72. add cl,1
  73. cmp cl,5
  74. ;jmp 5_vocales
  75.  
  76.  
  77.  
  78. es_vocales:
  79. ;*****************************Tiene 5 vocales**************************************!"
  80. mov ah, 9
  81. mov dx, offset msg1
  82. int 21h
  83. jmp stop
  84.  
  85. notiene_5:
  86. ;*****************************Solo se puede ordenar*********************************!"
  87. mov ah, 9
  88. mov dx, offset msg2
  89. int 21h
  90. stop:
  91.  
  92.  
  93. ; wait for any key press:
  94. mov ah, 0
  95. int 16h
  96.  
  97.  
  98. ret
  99.  
  100.  
  101. msg1 db " La palabra tiene las 5 vocales$!"
  102. msg2 db " Ordenando la palabra!$"
  103.  
Success #stdin #stdout 0.01s 2284KB
stdin
Standard input is empty
stdout
0