MT_ALCHP/SMS_ACHP
This trap allocates an area in the common heap.
Call Parameters | Return Parameters |
D0.B | $18 | D0.L | Error return |
D1.L | Number of bytes needed | D1.L | Number of bytes allocated |
D2.L | Job owner | D2.L | Undefined |
D3.L | 0 or "ACSI" | D3.L | Undefined |
A0 | | A0 | Base address of area |
Errors
ERR_IMEM | Out of memory |
ERR_IJOB | Job does not exist |
Notes
All registers are used except D4-7 and A4-7.
The value in D3 is only used for ATARI TT (or similar machines with ST RAM and Fast RAM). If D3 = "ACSI" memory is allocated in ST compatible RAM and not in Fast RAM. This requires SMSQ.
Example
moveq #18,d0 ; MT_ALCHP
move.l #$400,d1 ; Number of bytes needed
moveq #-1,d2 ; This job
trap #1 ; Allocate the area
tst.l d0 ; OK? . .
bne oops ----> ; , , no!
... ; Do something here.