Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- model tiny
- .code
- org 100h
- start:
- jmp main
- handler_for_r1 proc
- cmp ax, 80f0h
- mov ax, error_code_ok
- jne end1
- end1:
- iret
- handler_for_r1 endp
- handler_for_r2 proc
- cmp ax, 81f1h
- mov ax, error_code_ok
- jne end2
- end2:
- iret
- handler_for_r2 endp
- main:
- get_args:
- xor bx, bx
- mov si, 82h
- mov bx, 2fh
- cmp [si], bl
- jne afail
- inc si
- xor bx, bx
- mov bx, 30h
- cmp [si], bl
- je r1
- xor bx, bx
- mov bx, 31h
- cmp[si], bl
- je r2
- jmp afail
- r1:
- mov ah, magic_num1
- mov al, magic_func1
- int 2fh
- cmp ax, error_code_ok
- je installed
- mov ah, 25h
- mov al, 2fh
- mov dx, offset handler_for_r1
- int 21h
- mov dx, offset r1
- int 27h
- jmp installed
- r2:
- mov ah, magic_num2
- mov al, magic_func2
- int 2fh
- cmp ax, error_code_ok
- je installed
- mov ah, 25h
- mov al, 2fh
- mov dx, offset handler_for_r2
- int 21h
- mov ah, 31h
- mov al, 01h
- mov dx, offset r2
- int 21h
- afail:
- mov ah, 9h
- lea dx, argmess
- int 21h
- ret
- installed:
- mov ah, 9h
- lea dx, msg_n_inst
- int 21h
- ret
- finish:
- mov ah, 9h
- lea dx, msg_inst
- int 21h
- ret
- magic_num1 db 80h
- magic_num2 db 81h
- magic_func1 db 0f0h
- magic_func2 db 0f1h
- error_code_ok dw 0ffh
- argmess db "Error: This programm needs args", 24h
- msg_n_inst db "Allready installed", 0dh, 0ah, '$'
- msg_inst db "Resident installed", 0dh, 0ah, '$'
- end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement