Compare commits
6
Commits
memory-map
...
60e7b6209f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60e7b6209f | ||
|
|
33b7886e70 | ||
|
|
daf4168129 | ||
|
|
4bce47209a | ||
|
|
af5a750031 | ||
|
|
8e0fdf0d28 |
@@ -0,0 +1,25 @@
|
||||
# Contributing
|
||||
|
||||
## Code of Conduct
|
||||
Be nice, we are all just doing this to have fun
|
||||
|
||||
## General rules
|
||||
- All text (names, comments, etc.) has to be in English
|
||||
- You are responsible for ensuring that you have the rights for us to use the code you contribute to the project
|
||||
- follow the guidelines, for code, documentation, etc.
|
||||
- all code has to work with the standard symphony ISA
|
||||
|
||||
## Documenting Functions
|
||||
All functions in the standard library should follow the following outline:
|
||||
```asm
|
||||
; <description>
|
||||
; Arguments: <which register contains what argument>
|
||||
; Result: <what is the result, and where is it stored>
|
||||
; Clobbers: <list of registers that are clobbered>
|
||||
fn_label: <;SHOULD BE INLINED>
|
||||
CODE
|
||||
|
||||
```
|
||||
|
||||
Functions should be in the appropriate asm file, if you are unsure where functionality fits make a seperate file and ask in the pull request
|
||||
|
||||
@@ -1,3 +1,41 @@
|
||||
# symphony_stdlib
|
||||
# Symphony Stdlib
|
||||
|
||||
standard library for symphony
|
||||
This is a standard library for symphony.
|
||||
It is both intended as a practical toolkit to develop more complex software as well as a teaching resource.
|
||||
|
||||
If you just want to use the standard library [[stdlib.asm]] is your main header, include it after your code.
|
||||
You'll also need to include globals.asm in the first line of your main assembly file.
|
||||
|
||||
If you are using it as a learning resource have a look at the [teaching folder](teaching).
|
||||
|
||||
If you are intersted in contributing have a look at [[CONTRIBUTING.md]]
|
||||
|
||||
---
|
||||
|
||||
## ABI
|
||||
|
||||
### Calling Convention
|
||||
| class | registers |
|
||||
| ----- | --------- |
|
||||
| n.a. | zr |
|
||||
| preserved | sp, r8 - r12 |
|
||||
| scratch | flags, r1 - r7 |
|
||||
| arguments | r1 - r5, r6 = stack args, r7 = stack res |
|
||||
| result | r1 = low word, r2 = high word |
|
||||
| return address | r13 |
|
||||
|
||||
### 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
|
||||
|
||||
### Types
|
||||
|
||||
#### String
|
||||
Strings are stored in memory as null terminated sequences of bytes encoding ascii characters.
|
||||
They should be passed by reference.
|
||||
|
||||
#### Array
|
||||
Arrays are stored in memory with a reference to them being the tuple (pointer, length) stored in a register pair.
|
||||
Array elements may only have a size of 8/16/32 bits
|
||||
|
||||
Reference in New Issue
Block a user