Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xfcasio/bento

A collection of macros intended at making assembly more convenient to write and a bit closer to C. Only for x86_64 linux and the FASM assembler (for now).
https://github.com/xfcasio/bento

assembly fasm

Last synced: 3 months ago
JSON representation

A collection of macros intended at making assembly more convenient to write and a bit closer to C. Only for x86_64 linux and the FASM assembler (for now).

Awesome Lists containing this project

README

        

🍱 bento (弁当)


A collection of macros intended at making assembly more convenient to write and a bit closer to C. Only for x86_64 linux and the FASM assembler (for now).

Example:

```asm
format ELF64 executable 3
include 'bento.inc'

segment executable readable
entry $
@mkstr hello_world, <"Hello, World", 0>
@mkstr nums, "123456789"

xor eax, eax
.if (eax = 0)
@iter1 r8, 0, 9
@iter2 rax, 0, 9
@iter3 rbx, 0, 9
mov qword [dummy], rbx
add qword [dummy], 48
write STDOUT, dummy, 1
@done3
write STDOUT, newline, 1
@done2
write STDOUT, newline, 1
@done1
.endif

puts hello_world
exit 0
@@

segment readable writeable
dummy: dq 0
newline: db 0xA
```

compile with:

```
$ fasm main.s
$ ./main
```