qdosmsq:traps:trap_3:vers

Differences

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

Link to this comparison view

qdosmsq:traps:trap_3:vers [2009/06/01 11:23] (current)
george.gwilt created
Line 1: Line 1:
 +====== IOF_VERS ======
 +
 +
 +This trap sets or reads the file version number.
 +
 +^Call Parameters^^Return Parameters^^
 +|D0.B|$4E|D0.L|Error return.|
 +|D1.L|Version |D1.L|Version.|
 +|D3.W|Timeout |D3.L|Preserved.|
 +|A0.L|Channel ID |A0.L|Preserved.|
 +
 +===== Errors =====
 +Any I/O sub system errors including ​
 +|ERR_NC|Not complete.|
 +
 +
 +
 +===== Notes =====
 +  * All registers not shown above are not used on entry and are preserved on exit.
 +  * D1.L has three initial values:
 +    *-1 causes the file version number to be returned in D1.L.
 +    *0 causes the the file version number to be set to its current value and returned in D1.L.
 +    *1 to 65535 causes the value in D1.L to be set as the new version number. The value in D1.L is preserved on return.
 +  *If the version number is set by this trap, it will not be incremented when the file is closed, or flushed.
 +
 +===== Example =====
 +The example below shows the use of this trap call to set the version number of a file in D7.L and prevent its being incremented when the file is closed.
 +
 +<​code>​
 +vers    moveq   #​io_open,​d0 ​    ; $01
 +        moveq   #​-1,​d1 ​         ; This job
 +        moveq   #​0,​d3 ​          ; OPEN
 +        lea     ​name,​a1 ​        ; Name of file 
 +        trap    #2              ; Open the file
 +        tst.l   ​d0 ​             ; OK? . .
 +        bne     ​error ​          ; . . no!
 +        moveq   #​0,​d1 ​          ; To find the version number
 +        moveq   #​-1,​d3 ​         ; Timeout
 +        moveq   #​iof_vers,​d0 ​   ; $4E
 +        trap    #3              ; Find the version
 +        tst.l   ​d0 ​             ; OK? . .
 +        bne     ​error ​          ; . . no!
 +        move.l ​ d1,d7           ; Set the version number in D7.L
 +        moveq   #​io_close,​d0 ​   ; $02
 +        tst.l   ​d0 ​             ; OK? . .
 +        bne     ​error ​          ; . . no!
 +
 +
 +name    dc.w    name_e-name-2 ​  ; Length of name
 +        dc.b    "​flp1_klok"​
 +name_e ​ ds.b    0        ​
 +</​code>​
 +
  
  • qdosmsq/traps/trap_3/vers.txt
  • Last modified: 2009/06/01 11:23
  • by george.gwilt