; Public Domain cpu 8086 org 256 start: mov ah, 19h int 21h push ax xor dx, dx mov si, 81h .loop: lodsb cmp al, 13 je .end cmp al, 'A' jb .loop cmp al, 'z' ja .loop .letter: dec ax and al, 31 xchg dx, ax jmp .loop .end: add byte [msg.drive.patch], dl mov ah, 0Eh int 21h mov dx, msg.drive call disp_dx_msg mov si, 3 outerloop: mov ax, 4E00h mov dx, search mov cx, 8 innerloop: mov bp, ax int 21h jc .next call dump mov ah, 4Fh jmp innerloop .next: call dump dec si jnz outerloop pop dx mov ah, 0Eh int 21h mov ax, 4C00h int 21h dump: jc .fail .success: mov ax, bp xchg al, ah call disp_al_hex mov dx, msg.success.1 call disp_dx_msg mov al, [80h + 15h] call disp_al_hex mov dx, msg.success.2 call disp_dx_msg mov ax, [80h + 18h] call disp_ax_hex mov dx, msg.success.3 call disp_dx_msg mov ax, [80h + 16h] call disp_ax_hex mov dx, msg.success.4 call disp_dx_msg mov ax, [80h + 1Ah + 2] call disp_ax_hex mov dx, msg.success.5 call disp_dx_msg mov ax, [80h + 1Ah] call disp_ax_hex mov dx, msg.success.6 call disp_dx_msg mov dx, 80h + 1Eh mov di, dx mov cx, -1 xor ax, ax repne scasb not cx dec cx mov ah, 40h mov bx, 1 int 21h mov dx, msg.success.7 call disp_dx_msg retn .fail: xchg ax, bp xchg al, ah call disp_al_hex xchg ax, bp mov dx, msg.fail.1 call disp_dx_msg call disp_ax_hex mov dx, msg.fail.2 call disp_dx_msg retn disp_dx_msg: push ax mov ah, 09h int 21h pop ax retn disp_ax_hex: xchg al, ah call disp_al_hex xchg al, ah disp_al_hex: push cx mov cl, 4 rol al, cl call .nybble rol al, cl pop cx .nybble: push ax push dx and al, 15 add al, '0' cmp al, '9' jbe .got add al, 7 .got: xchg dx, ax mov ah, 02h int 21h pop dx pop ax retn msg: .drive: db "Drive " .drive.patch: db "A:",13,10,36 .fail.1: db "h: CY error, AX=",36 .fail.2: db "h",13,10,36 .success.1: db "h: NC, attrib=",36 .success.2: db "h, date=",36 .success.3: db "h, time=",36 .success.4: db "h, size=",36 .success.5: db "_",36 .success.6: db "h, name=",'"',36 .success.7: db '"',13,10,36 search: db "CON",0