PLLLLS SOLVE THIS ONE!I'm trying to make a program that give me a output of "abc" if i type c,"abcd" if i type d,"a" if i type a


/ Published in: Assembler
Save to your folder(s)



Copy this code and paste it in your HTML
  1. .model small
  2. .stack 64h
  3. .data
  4. msg db"Input a letter:$"
  5. msg1 db"Output:$"
  6. msga db"a$"
  7. msgb db"ab$"
  8. msgc db"abc$"
  9. .code
  10.  
  11. main:
  12. mov ax,@data
  13. mov ds,ax
  14.  
  15. mov ah,0003h
  16. int 10h
  17.  
  18. lea dx,msg
  19. mov ah,09h
  20. int 21h
  21.  
  22. mov ah,01h
  23. int 21h
  24.  
  25. mov bh,al
  26. int 21h
  27.  
  28. lea dx,msg1
  29. mov ah,09h
  30. int 21h
  31. jmp a
  32. a:
  33. cmp bh,"a"
  34. int 21h
  35. je aprint
  36. jne b
  37. aprint:
  38. lea dx,msga
  39. mov ah,09h
  40. int 21h
  41. jmp close
  42. b:
  43. cmp bh,"b"
  44. int 21h
  45. je bprint
  46. jne c
  47. bprint:
  48. lea dx,msgb
  49. mov ah,09h
  50. int 21h
  51. jmp close
  52. c:
  53. cmp bh,"b"
  54. int 21h
  55. je cprint
  56. jne c
  57.  
  58. cprint:
  59. lea dx,msgc
  60. mov ah,09h
  61. int 21h
  62. jmp close
  63.  
  64. close:
  65. mov ah,4ch
  66. int 21h
  67. end main

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.