omega-bridge
Omega-first language interoperability: checked conversion backends and native language bindings
Brought by drakestapleton
omega-bridge / tests / native / v2 / fsout.om
| 1 | note fsout.om: an out parameter written before a trap. Freestanding ABI v2 copies the out buffer back |
| 2 | note only on status 0, so after the trap the caller's buffer must hold what it held before the call. |
| 3 | om2 |
| 4 | export fn fsout x ulong o out uchar 16 to ulong |
| 5 | put o 0 7 |
| 6 | if eq x 0 |
| 7 | trap 5 |
| 8 | end |
| 9 | ret add x 1 |
| 10 | end |