Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Converting diskette LBA to CHS

// description of your code here

Put LBA address in AX and get your results in CL, CH and DH.

;-----------------------------------------------------------------------------;
;		DISKETTE_LBA_TO_CHS(AX LBA) CL Head, CH Cylinder, DH Sector   ;
;-----------------------------------------------------------------------------;
diskette_lba_to_chs:
	xor dx, dx
	mov bx, 18
        div bx
	push dx				; = Stack(1)			
	mov dx, ax
        shr ax, 2
	mov cl, al
	mov ch, dl
	pop dx				; = Stack(0)
	inc dl
	mov dh, dl
	ret
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS