Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- array macro digit
- MOV SI,OFFSET digit
- CALL search;
- endm
- org 100h
- .data
- insert db 'insert value$'
- value db 'how many value you want to insert?$'
- message db 'Enter 5 value $'
- msg2 db 'Enter a value for search$'
- y db 'found$'
- n db 'not found$'
- dd db 'Digit$'
- arr dw '?'
- .code
- main proc
- mov ax,@data
- mov ds,ax
- mov dx,offset value
- mov ah,09h
- int 21h
- mov ah,01h
- int 21h
- mov dl,al
- sub dl,48
- mov si,offset arr
- mov cl,dl
- loop1:
- MOV AH,01H
- INT 21H
- MOV BL,AL
- mov [si],bl
- inc si
- loop loop1
- mov ah,02;
- mov dl,10
- int 21h
- mov dl,13
- int 21h
- mov cl,dl
- array arr
- ret
- main endp
- search proc
- mov ah,02;
- mov dl,10
- int 21h
- mov dl,13
- int 21h
- mov dx,offset msg2
- mov ah,09h
- int 21h
- MOV AH,01H
- INT 21H
- MOV BL,AL
- loop2:
- cmp bl,[si]
- je show
- inc si
- loop loop2
- jmp no_found
- show:
- mov ah,02;
- mov dl,10
- int 21h
- mov dl,13
- int 21h
- mov ah,02
- mov dl,[si]
- int 21h
- mov dx,offset y
- mov ah,09h;
- int 21h
- ret
- no_found:
- mov ah,02;
- mov dl,10
- int 21h
- mov dl,13
- int 21h
- mov ah,02
- mov dl,bl
- int 21h
- mov dx,offset n
- mov ah,09h
- int 21h
- ret
- search endp
- end main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement