From 868844f71007e4bcee508f51f362968ef77a6a3f Mon Sep 17 00:00:00 2001 From: pantonshire Date: Sat, 26 Jul 2025 15:43:02 +0100 Subject: [PATCH] add calling convention notes --- docs/call_conv.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 docs/call_conv.md diff --git a/docs/call_conv.md b/docs/call_conv.md new file mode 100644 index 0000000..c7e7d9a --- /dev/null +++ b/docs/call_conv.md @@ -0,0 +1,10 @@ +# Calling convention +## boot0 +I'm not sticking to any particular calling convention for boot0, since we have to golf to fit in +440 bytes. Whatever's most convenient. + +## boot1 +- Arguments: ax, cx, dx, stack +- Return value: ax, cf for booleans +- ax may be clobbered. All other registers are preserved +- Callee cleanup (i.e. the function pops stack arguments when returning)