Closed mytechnotalent closed 3 years ago
micro:bit v1 had support for inline assembly, so we should add it to v2 (and it is very useful and a good teaching tool!).
But for the example above there's a simpler way to do it:
import machine
machine.mem32[NRF_FICR_BASE + DEVICEID_INDEX * 4]
Thanks @dpgeorge it really will be a good teaching tool as I teach ARM32 Reverse Engineering and I would love to do some work with the v2 in this regard as well.
You are correct working with the machine module is simpler however I am working with the bitio module which interfaces with CPython for AI/ML applications for the v2. This architecture does not have the machine module available to it so having the inline assembly allows myself and others to integrate any functionality at all with ease.
Enabled in ca485d2ccf79801d1d0761a9d126ddf7cf680d4d
It is extremely important that we have access to inline assembly to add customizations for example:
This allows inline assembly to be able to be integrated into the V2. Can we expose the flag such that we will be able to run the above code and the like @microbit-carlos?