This trap call allows a medium to be formatted. It returns the number of good sectors and the total number of sectors on the medium. The latter includes any bad sectors that were detected.
Call Parameters | Return Parameters | ||
---|---|---|---|
D0.B | $03 | D0.L | Error code. |
D1.L | Unused | D1.W | Number of good sectors. |
D2.L | Unused | D2.W | Total number of sectors, including bad ones. |
A0.L | Pointer to medium name. | A0.L | Corrupted |
ERR_OM | Out of memory. |
ERR_FF | Format failed. |
ERR_NF | File or device not found. |
ERR_IU | File in use. |
The following shows the use of this call to format a medium :
moveq #io_formt,d0 ; Trap code lea name,a0 ; Pointer to name of medium trap #2 ; Do the format tst.l d0 ; Test for errors bne.s error ; The format has failed. ;Carry on here - the format worked. name dc.w 12 ; Length of filename dc.b 'FLP1_Backups' ; Bytes of actual filename