LibAsm/README.md

23 lines
1.5 KiB
Markdown
Raw Permalink Normal View History

2025-01-24 18:09:38 +00:00
# LibAsm
This not-so-awfully-creatively-named repository is a collection of various common routines and data abstractions,
the kind you might find in a standard C library, however written in assembly.
It is *not* an implementation of libc, or any other standard C library, because I want to have the freedom to implement everything in my own way, face the challenges of creating my own abstractions, and perhaps have the ability to cut my own corners as well :)
Each function will be available as its own file, intended to make it easy to import only the ones you need within a project.
The overall ambition is to be able to use this library to losslessly abstract the most-optimal instructions one would normally write by hand - but with an easier manner of use, e.g. providing macros and functions to do everything that's required.
Ultimately, it may be impossible to fully equal "the most optimal code" when using functional calls and generic abstractions, since each problem may have more optimal corner-cuttings which result from eliminating the parts that aren't necessary from the generic implementation, but without having to worry about any usual C-related standards, we can still perhaps make a good crack at the problem nevertheless!
2025-01-24 18:48:22 +00:00
## Usage
To compile a particular file to an object:
```bash
gcc -c -g strcpy.S
```
To then link to an executable (only if there is a \_start symbol defined somewhere):
```bash
ld strcpy.o
```
WIP: I am still working on specifying a custom entry point so we don't have to play along with GNU Assembler's desires.