QDOS Internals

Anything you never knew you wanted to know about the Sinclair QL.

User Tools

Site Tools


qdosmsq:traps:trap_1:arpa

MT_ALRES/SMS_ARPA

This trap allocates space in the resident procedures area.

Call ParametersReturn Parameters
D0.B$0ED0.LCorrupted?
D1.LNumber of bytes required.D1.LCorrupted.
D2.LUnused. D2.L Corrupted.
D3.LUnused. D3.L Corrupted.
A0.LUnused. A0.L Base address of allocated memory.
A1.LUnused. A1.L Corrupted.
A2.LUnused. A2.L Corrupted.
A3.LUnused. A3.L Corrupted.

Errors

ERR_NCNot complete (usually means some jobs have been EXEC'd.)
ERR_OMOut of memory

Notes

  • All registers not shown above are not used on entry and are preserved

on exit.

  • This trap is how the SuperBasic function RESPR works. It allocates space in the resident procedures area, but only if there are no jobs running.

Example

The following shows the use of this call.

        moveq   #mt_alres,d0      ; Trap code
        move.l  #1024,d1          ; 1 Kbyte required in resident procedure space
        trap    #1                ; Allocate the space
        tst.l   D0                ; Did it work ?
        bne.s   oops              ; No, handle errors
                                  ; All ok, use tha space allocated from (A0) onwards.
        :
        :
qdosmsq/traps/trap_1/arpa.txt · Last modified: 2009/01/30 11:53 by norman