;   ####             #    #     # #
;   #   #            #    #       #          The FreeWare C library for
;   #   #  ##   ###  #  # #     # ###             RISC OS machines
;   #   # #  # #     # #  #     # #  #   ___________________________________
;   #   # ####  ###  ##   #     # #  #
;   #   # #        # # #  #     # #  #    Please refer to the accompanying
;   ####   ### ####  #  # ##### # ###    documentation for conditions of use
;   ________________________________________________________________________
;
;   File:    KernelSWIs.s.ReadModeVa
;   Author:  Copyright  1994 Jason Howat
;   Version: 1.00 (24 Jun 1994)
;   Purpose: Generic veneer to the Desk_OS_ReadModeVariable SWI.

        GET     Desk.sh.regdefs
        GET     h.swinos
        GET     Desk.sh.macros

; Desk_OS_ReadModeVariable(int mode, Desk_mode_variable variable, int *value);

        PREAMBLE
        STARTCODE Desk_OS_ReadModeVariable
;
        MOV     ip, sp
        STMFD   sp!, {lr}
        MOV     r3, r2
        SWI     Desk_SWI_OS_ReadModeVariable + Desk_XOS_Bit
        Desk_Error2_CheckV
        ;MOVVC   r0, #0
        ADRCS   r0, error
        BLCS	Desk_Error2_CheckOS
        
        CMP     r3, #0
        STRNE   r2, [r3]
        LDMFD   sp!, {pc}^
;
error   DCD     0
        =       "Invalid mode or variable number", 0
;
        END
