XVARS
Info
XVARS is a primitive which returns value or ptr without any compute for the kernel. XVALUES do almost the same than XVARS, but all values returned by XVALUES are computed, and may return an allocated struct.
Get the max of process number
ldx #KERNEL_XVARS_KERNEL_MAX_PROCESS ; Value = 8
BRK_KERNEL XVARS
; 'A' contains the max process number managed by kernel
; Also 'Y' contains the max FP handled by kernel
Get the number max opened file
ldx #KERNEL_XVARS_KERNEL_MAX_PROCESS ; Value = 8
BRK_KERNEL XVARS
; 'Y' contains the max file pointer handled by kernel
; and also in 'A' contain the number max of the process available
Get the list of the process
.include "telestrat.inc"
ldx #KERNEL_XVARS_PID_LIST_PTR ; Value = $0A
BRK_KERNEL XVARS
; A and Y contains the ptr of the list of current pid.
; If 0 is set, the slot is available and there is no process
; The end of the list is defined with #KERNEL_XVARS_KERNEL_MAX_PROCESS
rts
Get the binary version of the kernel
.include "telestrat.inc"
KERNEL_XVARS_CURRENT_VERSION_BINARY = $06
ldx #KERNEL_XVARS_CURRENT_VERSION_BINARY
BRK_KERNEL XVARS
; A contains the id of the kernel
; Below the information
rts
.define KERNEL_VERSION_2022_3 $00
.define KERNEL_VERSION_2022_4 $01
.define KERNEL_VERSION_2022_4_1 $02
.define KERNEL_VERSION_2023_1 $03
.define KERNEL_VERSION_2023_2 $04
.define KERNEL_VERSION_2023_3 $05
.define KERNEL_VERSION_2024_1 $06
.define KERNEL_VERSION_2024_4 $07