Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Find kernel
- push dx
- ;Number of fats * sectors per fat
- movzx eax, byte [number_of_fats]
- movzx ebx, word [sectors_per_fat]
- mul ebx
- ;Divide number of root dir entries by 16
- movzx ebx, word [number_of_root_dir_entries]
- shr ebx, 4
- add eax, ebx ;Add results
- movzx ebx, word [reserved_sectors]
- add eax, ebx ;Add reserved sectors
- ;C = eax / (sectors_per_track * num_heads)
- mov ebx, eax ;put LBA in ebx
- movzx eax, word [sectors_per_track]
- movzx ecx, word [num_heads]
- mul ecx
- mov esi, ebx ;Put LBA in esi
- mov edi, eax ;Put C in edi
- xchg eax, ebx
- xor edx, edx
- div ebx
- push ax
- ;H = (esi / sectors_per_track) % num_heads
- mov eax, esi
- movzx ebx, word[sectors_per_track]
- xor edx, edx
- div ebx
- push dx
- ;modulo: a - ((a / b) * b); ebx - LBA, edi - C
- movzx ebx, word[num_heads]
- xor edx, edx
- div ebx
- ;H is in edx
- pop bx
- add bx, 1 ;S
- pop cx ;C
- xor ax, ax
- mov es, ax
- mov ah,02h
- mov al,10
- mov ch, cl
- mov cl, bl
- mov dh, dl
- pop bx
- mov dl, bl
- mov bx, 0x8000
- int 13h
Add Comment
Please, Sign In to add comment