;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;rws.s ;; ;;written by, soni.malik@gmail.com ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; global _readSectors global _writeSectors _readSectors: ;The usual creation of stack frame. push bp mov bp, sp ;Clobbered registers push ax push bx push cx push dx push es ;The register pair ES:BX wil hold the address of the buffer ;where the sector/s will be read in. mov bx, [bp + 0x06] mov ax, [bp + 0x08] mov es, ax ;Other service parameters. mov ah, 0x02 ;Int 0x13 service number. mov al, [bp + 0x0e] ;Number of sectors to read. mov ch, [bp + 0x0d] ;Track/cylinder number. mov cl, [bp + 0x0c] ;Starting sector number. mov dh, [bp + 0x0a] ;Head number. mov dl, [bp + 0x0b] ;Drive number. int 0x13 ;Copy the return status. mov bx, [bp + 0x10] mov [bx], ax ;Restoring all the clobbered registers. pop es pop dx pop cx pop bx pop ax mov sp, bp pop bp retf _writeSectors: push bp mov bp, sp mov sp, bp pop bp retf