Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

reading sectors,track,#of sectors from 3.5 floppy

Hi i am new to this so I don't know where to start



my program complies but it doesn't do any output

I am not also sure about if it actually reading a track I want to produce a hexadicaml dump

of sectors on a disk.. the program is to read from keyboard with prompts, the starting track

starting head, the starting sector, and number of sectors, if the number of desired sector exceeds the

remaining number in teh track, then after finishing head 0 go to head 1 in the same track after finishing head 1 go to

head 0 in the next track..



this is what i did so far i need help on what to do next.



;THIS PROGRAM PRODUCES READS FROM THE KEYBOARD STARTING WITH TRACK, THE STARTING

;HEAD, THE STARTING SECTOR AND THE NUMBER OF SECTORS, AND YOUR READING IT FROM

;DISK A. THE OUTPUT OF THIS PROGRAM CONTAIN 16 BYTES FIRST AS A 2-DIGIT HEXADECIMAL

;NUMBERS SEPARTED BY A BLANK SPACE AND THEN THE 16 BYTES AS CHARACTERS. IF THEY ARE

;BETWEEN 20H AND 7EH IT PUTS A DOT THERE..

;------------------------------------

STK SEGMENT PARA STACK 'STACK'

DB 256 DUP(?)

STK ENDS

;-------------------------------------

SECTOR_SIZE =512

DRIVE_A =0

TRACKS = 80

SECTORS= 18

ENTIES_PER_SECTOR = (SECTOR_SIZE * SECTORS)

SIZES =9216

DAT SEGMENT

;NUMBUF DB 4, (?), 4 DUP(?)

NUMBUF DW ((ENTIES_PER_SECTOR)) DUP(?)

;NUM DW (SIZES)

ONE DB "ENTER THE STARTING TRACK->", '$'

TWO DB "ENTER THE STARTING HEAD->", '$'

THREE DB "ENTER THE STARTING SECTOR->", '$'

FOUR DB "ENTER THE NUMBER OF SECTORS->", '$'

SAVEONE DB ?

SAVETWO DB ?

SAVETHREE DB ?

SAVEFOUR DB ?

DAT ENDS

;-------------------------------------------

COD SEGMENT

;-------------------------------------------

NEWLINE PROC NEAR ;FUNCTION TO GO TO NEWLINE

MOV DL, 0AH

MOV AH, 02H

INT 21H

MOV DL, 0DH

MOV AH, 02H

INT 21H

RET

NEWLINE ENDP

;-------------------------------------------------

CLEAR PROC NEAR ;FUNCTION TO CLEAR THE SCREEN

MOV AX, 0600H

MOV BH, 07

MOV CX, 0000

MOV DX, 184FH

INT 10H

RET

CLEAR ENDP

;-----------------------------------------------------

CURSOR PROC NEAR ;SETS THE CURSOR

MOV AH, 02

MOV BH, 00

MOV DH, 00

MOV DL, 00

INT 10H

RET

CURSOR ENDP

;--------------------------------------------------

TRACK PROC NEAR ;FUNTION TO PRINT ONE

MOV AH, 09H

MOV DX, OFFSET ONE

INT 21H

MOV AH, 0AH

INT 21H

MOV DX,OFFSET SAVEONE

RET

TRACK ENDP

;---------------------------------------------------

HEAD PROC NEAR ;FUNCTION TO PRINT TWO

MOV DX, OFFSET TWO

MOV AH, 09H

INT 21H

MOV AH, 0AH

INT 21H

MOV DX, OFFSET SAVETWO

RET

HEAD ENDP

;--------------------------------------------------

SECTOR PROC NEAR ;FUNCTION TO PRINT THREE

MOV DX, OFFSET THREE

MOV AH, 09H

INT 21H

MOV AH, 0AH

INT 21H

MOV DX, OFFSET SAVETHREE

RET

SECTOR ENDP

;--------------------------------------------------

NUMSECTOR PROC NEAR ;FUNCTION TO PRINT FOUR

MOV DX, OFFSET FOUR

MOV AH, 09H

INT 21H

MOV AH, 0AH

INT 21H

MOV DX, OFFSET SAVEFOUR

RET

NUMSECTOR ENDP

;-----------------------------------------------------

MAIN PROC FAR

ASSUME SS:STK, DS:DAT, CS:COD

CALL CLEAR ;CLEARS THE SCREEN

CALL CURSOR ;SETS CURSOR



MOV AX, DAT

MOV DS, AX

CALL TRACK ;CALLING FUNCTIONS HERE

CALL NEWLINE

CALL HEAD

CALL NEWLINE

CALL SECTOR

CALL NEWLINE

CALL NUMSECTOR

CALL NEWLINE

MOV CH, SAVEONE ;WHATEVER THEY ENTERED MOVES INTO THESE REGISTERS

MOV DH, SAVETWO

MOV CL, SAVETHREE

MOV AL, SAVEFOUR

MOV DL, DRIVE_A ;FLOPPY

MOV AH, 02H ;READ SECTORS INTO MEMORY

INT 13H

MOV AH, 03H

INT 13H

;MOV CH, SAVEONE

;MOV DH, SAVETWO

;MOV CL, SAVETHREE

;MOV AL, SAVEFOUR

;MOV DL, DRIVE_A ;FLOPPY

;MOV AH, 03H ;WRITES SECTORS FROM MEMORY

;INT 13H



;------------------------------------------

MOV AH, 4CH ;EXITS DOS

INT 21H

MAIN ENDP

COD ENDS

END MAIN





thanks Sunny




Sign In or Register to comment.