Advertisement
Guest User

Untitled

a guest
Dec 11th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. .model tiny
  2. .code
  3. .startup
  4. Org 100h
  5. Jmp Short Start
  6. Vector Dw 2, 3, 6, 16, 20
  7. N Equ 5
  8. Two Dw 2
  9. Lowest Dw ?
  10. One Dw 1
  11. Zero Dw 0
  12. Is_init Dw 0
  13. Start:
  14. Xor Bx, Bx
  15. Mov Cx, N
  16. S:
  17. Mov Ax, Vector[Bx]
  18. div Two
  19. Cmp Dx, Zero
  20. jne is_odd
  21. Add Bx, 2
  22. Loop S
  23. jmp _exit
  24. is_odd:
  25. mov ax, is_init
  26. cmp ax, zero
  27. je first_assing
  28. mov ax, Vector[bx]
  29. cmp ax, Lowest
  30. jl assign
  31. Add Bx, 2
  32. Loop S
  33. jmp _exit
  34. assign:
  35. mov Lowest, ax
  36. Add Bx, 2
  37. Loop S
  38. jmp _exit
  39. first_assing:
  40. mov ax, Vector[bx]
  41. inc is_init
  42. mov Lowest, ax
  43. Add Bx, 2
  44. Loop S
  45. jmp _exit
  46. _exit:
  47. mov ax, is_init
  48. cmp ax, zero
  49. jne _exit2
  50. mov ax, zero
  51. Mov Lowest, ax
  52.  
  53. _exit2:
  54. Mov Ax, Lowest
  55. ;.exit 0
  56. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement