diff --git a/bit.asm b/bit.asm new file mode 100644 index 0000000..e69de29 diff --git a/stdlib.asm b/stdlib.asm new file mode 100644 index 0000000..a87a0b2 --- /dev/null +++ b/stdlib.asm @@ -0,0 +1,30 @@ +; ===== INTRODUCTION ===== +; This is supposed to provide some standard library functionality for stock symphony. +; In particular its supposed to work with an unmodified ISA, that means some choices are not +; optimal (RA being stored in flags for example) + +; ===== ABI ===== + +; ----- CALLING CONVENTION ----- +; n.a. zr +; preserved: sp, r8 - r13 +; scratch: flags, r1 - r7 +; arguments: r1 - r7 (r1 = 1st argument, r6 = 6th arg/stack args, r7 = 7th arg/stack res) +; result: r1, r2 (r1 = low word, r2 = high word) +; return address: flags + +; ----- STACK ----- +; grows downwards from top of memory +; arguments are passed in reverse order with the stack so: +; lowest address = 1st stack arg +; highest address = last stack arg + +; ----- HEAP ----- +; i am not sure if there will ever be heap functionality, but to future proof: +; this library will use the label "heap_start" with the constant "heap_size" +; to determine properties of the heap +; you **have** to define those if you want this to compile + +; ===== TYPES ===== + +include bit \ No newline at end of file