Files
symphony_stdlib/stdlib.asm
T
2026-08-30 09:26:24 +02:00

30 lines
1.0 KiB
NASM

; ===== 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