Page 1 of 1

SYSTEM.VMSR, SYSTEM.VMRS

Posted: Mon Jun 02, 2025 10:29 am
by gray
Astrobe for RP2350 uses 'SYSTEM.VMSR(0)' in the initialisation of the FPU (module Main). This SYSTEM procedure is not documented in SYSTEM.def, but the disassembly makes its function clear:

Code: Select all

SYSTEM.VMSR(0);
02000H          movs     r0,#0
0EEE10A10H      vmsr     fpscr,r0
If there's 'SYSTEM.VMSR' there is probably 'SYSTEM.VMRS' as well :) and indeed:

Code: Select all

SYSTEM.VMRS(1)
02001H          movs     r0,#1
0EEF10A10H      vmrs     r0,fpscr
I would have expected 'SYSTEM.VMRS' to take the target general register as argument, but the assembly code disagrees. Also, I don't really understand this code. I don't think 'movs r0,#1' has any effect.

What do I miss here? Thanks.

PS: Are there any other SYSTEM procedures not listed in SYSTEM.def, both for the RP2350 and the RP2040?

Re: SYSTEM.VMSR, SYSTEM.VMRS

Posted: Mon Jun 02, 2025 11:06 am
by gray
Another attempt:

Code: Select all

VAR x: INTEGER;
SYSTEM.VMRS(x)
0F8DF0008H      ldr.w    r0,[pc,#8] -> 24
06800H          ldr      r0,[r0]
0EEF10A10H      vmrs     r0,fpscr
Shouldn't this be something like this (using the same pc-offset for x):

Code: Select all

vmrs     r0,fpscr
ldr.w    r1,[pc,#8] -> 24
str      r0,[r1]

Re: SYSTEM.VMSR, SYSTEM.VMRS

Posted: Mon Jun 02, 2025 9:46 pm
by cfbsoftware
Sorry - support is not provided for "undocumented features".