Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
software:upi_conventions [2016/06/14 10:20]
ex_writer [User-Defined Subroutines]
software:upi_conventions [2016/06/14 10:45]
ex_writer [Example: Space Fortress User Subroutine]
Line 125: Line 125:
 From system BIOS: From system BIOS:
  
-<​code>​The UPI has been extended to support user-supplied routines. If the call index provided is negative [or from $ff through $80] then the users dispatch table pointer (USERTB) is used [also UMARGT]. Note that the sign bit isn't zapped before being used as an index, this means that the users dispatch table pointer should point 128 bytes before the first entry.</​code>​+<​code>​The UPI has been extended to support user-supplied routines. ​ 
 +If the call index provided is negative [or from $ff through $80]  
 +then the users dispatch table pointer (USERTB) is used [also UMARGT]. ​ 
 +Note that the sign bit isn't zapped before being used as an index, ​ 
 +this means that the users dispatch table pointer should point  
 +128 bytes before the first entry.</​code>​
  
 Also: Also:
Line 190: Line 195:
  
 ; [...] ; [...]
 +        LD      HL,$1FA7
 +        LD      ($4FFD),​HL ​     ; $4FFD is USER Table Base + routine = JumP address
 +        LD      HL,​$1FE9 ​  
 +        LD      ($4FFB),​HL ​     ; $4FFB is User Mask ARGument Table + (routine / 2)
 +        LD      A,R
 +        AND     $1C
 +        LD      ($4F2A),A
 +L2FEE   ​LD ​     HL,​L2FEE ​       ; $2FEE is current program counter address ​
 +        PUSH    HL
 +        EI 
  
 ;  Call User's Macro Subroutine $80 ;  Call User's Macro Subroutine $80