qdosmsq:traps:trap_3:minf

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

qdosmsq:traps:trap_3:minf [2009/05/19 17:53] (current)
george.gwilt created
Line 1: Line 1:
 +====== FS_MDINF/​IOF_MINF ======
 +
 +
 +This trap returns information about the medium.
 +
 +^Call Parameters^^Return Parameters^^
 +|D0.B|$45|D0.L|Error return.|
 +|D1.L| |D1.L|Empty/​Good sectors.|
 +|D3.W|Timeout |D3.L|Preserved.|
 +|A0.L|Channel ID |A0.L|Preserved.|
 +|A1.L|Address of buffer|A1.L|End of medium name.|
 +===== Errors =====
 +
 +|ERR_NC|Not complete.|
 +|ERR_NO|Channel not open.|
 +
 +
 +===== Notes =====
 +  * All registers not shown above are not used on entry and are preserved on exit.
 +  * The channel ID in A0 must belong either to a file on the medium or to its directory.
 +  * The msw of D1 will  contain the number of empty 512 byte sectors on the medium. The number in D1.W is the total number of sectors available.
 +  * The buffer whose address is given in A1.L must be 10 bytes long. This will contain the medium name left justified and padded to the right with the space character ($20).  ​
 +
 +===== Example =====
 +The example below shows the use of this trap. It is assumed that A0 contains the ID either of a file on the medium or of its directory. Also it is assumed that buf(A6) is the address of a 10-byte buffer.
 +
 +<​code>​
 +info    moveq   #​fs_mdinf,​d0 ​   ; $45
 +        moveq   #​-1,​d3 ​         ; Timeout
 +        lea     ​buf(a6),​a1 ​     ; A 10-byte buffer
 +        trap    #3              ; Get the information
 +        tst.l   ​d0 ​             ; OK? . .
 +        bne     ​error ​          ; . . no!
 +</​code>​
 +
  
  • qdosmsq/traps/trap_3/minf.txt
  • Last modified: 2009/05/19 17:53
  • by george.gwilt