; Build from examples/: ; ../utils/mcpu-as -o model-lifecycle.o model-lifecycle.s ; ../utils/mcpu-ld --stack-size=512 -o model-lifecycle model-lifecycle.o ; ; Run one INIT-only pass or one LIFE step: ; ../utils/mcpu-run --init-only --int-reg=r64@0x00000 model-lifecycle ; ../utils/mcpu-run --steps=1 --int-reg=r64@0x00000 model-lifecycle ; ; Expected outputs: 40 and 42 respectively. ; ; LibCPU lifecycle/model-segment example. ; cpu-run --steps=1 --int-reg=r64@0x00000 model-lifecycle -> 42 ; cpu-run --init-only --int-reg=r64@0x00000 model-lifecycle -> 40 .control model_step: .real 64, 1.0 .input external_delta: .integer 64, 2 .output current_state: .integer 64, 0 .trace telemetry_state: .integer 64, 0 .init _start: LDI r64@0x00000, 40 END .text _life: loop: LEA r64@0x00008, external_delta LOADP r64@0x00010, r64@0x00008 IADD r64@0x00000, r64@0x00000, r64@0x00010 LEA r64@0x00018, current_state STOREP r64@0x00018, r64@0x00000 LEA r64@0x00020, telemetry_state STOREP r64@0x00020, r64@0x00000 END JMP loop .fini _fini: END