qdosmsq:vectors:putp

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
qdosmsq:vectors:putp [2009/02/11 12:04]
george.gwilt
qdosmsq:vectors:putp [2009/02/11 14:54] (current)
george.gwilt Link added
Line 1: Line 1:
 +====== BP_LET/SB_PUTP - Vector $120 ======
 +
 +This vector allows a parameter to either a machine code procedure or function to be changed.
 +
 +^Call Parameters^^Return Parameters^^
 +|D0.L|Unused |D0.L|Error code.|
 +|D1.L|Unused |D1.L|Corrupted.|
 +|D2.L|Unused |D2.L|Corrupted.|
 +|D3.L|Unused |D3.L|Corrupted.|
 +|A0.L|Unused |A0.L|Corrupted.|
 +|A1.L|Unused |A1.L|Corrupted.|
 +|A2.L|Unused |A2.L|Corrupted.|
 +|A3.L|Pointer to parameter |A3.L|Preserved.|
 +|A6.L|SuperBASIC pointer |A6.L|May be changed.|
 +
 +===== Errors =====
 +|ERR_BP|Bad Parameter.|
 +
 +===== Notes =====
 +  * All registers not shown above are not used on entry and are preserved on exit.
 +  * (A3,A6.L) points to the parameter's entry in the [[qdosmsq:sbinternal:nametab|Name Table]].
 +  * The updated value of the parameter must be put onto the maths stack.
 +
 +===== Example =====
 +The example below shows an integer parameter being halved.
 +<code>
 +        move.w  CA_GTINT,A2     ; CA_GTINT vector address.       
 + jsr (a2) ; Put the parameter on the maths stack.
 + bne.s Error_handler ; Oops!
 +        asr     (a1,a6.l)       ; Halve the parameter.
 +        movea.w BP_LET,(a2)     ; BP_LET vector address.
 +        jsr (a2)            ; Put the new value from the maths stack. 
 + bne.s Error_handler ; Oops!
 +</code>
 +
  
  • qdosmsq/vectors/putp.txt
  • Last modified: 2009/02/11 14:54
  • by george.gwilt