Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; multi-segment executable file template.
- data segment
- arr db 10 DUP(?)
- ends
- stack segment
- dw 128 dup(0)
- ends
- code segment
- start:
- mov ax, data
- mov ds, ax
- mov es, ax
- call input
- call min
- mov al,2
- int 21h
- mov ax, 4c00h ; exit to operating system.
- int 21h
- ends
- input proc
- mov cx,10
- mov si,offset arr
- again:
- mov al,1
- int 21h
- mov [si],al
- inc si
- loop again
- RET
- name EndP
- min PROC
- mov cx,9
- mov si,offset arr
- mov bl, arr[si]
- mov bh,0
- inc si
- again2:
- cmp [si],bl
- jc smaller
- abortmission:
- inc si
- loop again2
- jmp dontjump
- smaller:
- mov bl,[si]
- mov di,si
- jmp abortmission
- dontjump: RET
- min EndP
- end start ; set entry point and stop the assembler.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement