Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .model tiny
- .code
- .startup
- Org 100h
- Jmp Short Start
- Vector Dw 2, 3, 6, 16, 20
- N Equ 5
- Two Dw 2
- Lowest Dw ?
- One Dw 1
- Zero Dw 0
- Is_init Dw 0
- Start:
- Xor Bx, Bx
- Mov Cx, N
- S:
- Mov Ax, Vector[Bx]
- div Two
- Cmp Dx, Zero
- jne is_odd
- Add Bx, 2
- Loop S
- jmp _exit
- is_odd:
- mov ax, is_init
- cmp ax, zero
- je first_assing
- mov ax, Vector[bx]
- cmp ax, Lowest
- jl assign
- Add Bx, 2
- Loop S
- jmp _exit
- assign:
- mov Lowest, ax
- Add Bx, 2
- Loop S
- jmp _exit
- first_assing:
- mov ax, Vector[bx]
- inc is_init
- mov Lowest, ax
- Add Bx, 2
- Loop S
- jmp _exit
- _exit:
- mov ax, is_init
- cmp ax, zero
- jne _exit2
- mov ax, zero
- Mov Lowest, ax
- _exit2:
- Mov Ax, Lowest
- ;.exit 0
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement