;****************************************************** ; HDIDA : sous-programme assembleur pour HDID ;****************************************************** PUBLIC _GetID _text segment byte public 'CODE' assume cs:_text,ds:_text .286 hd_status1 equ byte ptr ds:74h hd_status2 equ byte ptr ds:8Ch hd_flags equ byte ptr ds:8Eh base equ 1F0h sgetid struc bp0 dw ? adr0 dw ? adrbuf dw ? sgetid ends getid equ [bp-bp0] _GetID proc push bp mov bp,sp push es push ds push si push di push ds pop es mov ax,40h mov ds,ax call sblock jnz fin call wint jnz fin mov cx,512/2 mov dx,base cld cli rep insw sti fin: mov al,hd_status1 xor ah,ah pop di pop si pop ds pop es pop bp ret sblock: mov hd_flags,0 irq14: cli in al,0A1h jmp short $+2 jmp short $+2 and al,10111111b out 0A1h,al jmp short $+2 jmp short $+2 in al,21h jmp short $+2 jmp short $+2 and al,11111011b out 21h,al jmp short $+2 jmp short $+2 sti mov dx,base+7 xor cx,cx @@: in al,dx mov hd_status2,al xor al,01011000b test al,11110000b loopnz @B jz ready mov hd_status1,20h ret ready: mov hd_status1,0 mov dx,base+6 mov al,00h out dx,al inc dx mov al,0ECh out dx,al xor al,al ret wint: mov ax,300 xor cx,cx @@: test hd_flags,80h loopz @B jnz wok dec ax jnz @B mov al,80h jmp short wend wok: xor al,al mov hd_flags,al wend: mov hd_status1,al or al,al ret _GetID ENDP _text ends end