Skip to content
/ asmbf Public
forked from kspalaiologos/asmbf

The only true brainfuck-targetting assembler.

License

Notifications You must be signed in to change notification settings

esovm/asmbf

This branch is 550 commits ahead of, 1152 commits behind kspalaiologos/asmbf:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d132f59 · Apr 28, 2020
Apr 17, 2020
Mar 2, 2020
Apr 13, 2020
Apr 23, 2020
Apr 13, 2020
Apr 21, 2020
Apr 17, 2020
Apr 14, 2020
Apr 17, 2020
Apr 13, 2020
Apr 14, 2020
Apr 17, 2020
Apr 15, 2020
Dec 31, 2019
Apr 18, 2020
Apr 28, 2020
Apr 17, 2020
Oct 2, 2019
Apr 27, 2020
Apr 10, 2020
Feb 26, 2020
Apr 8, 2020
Apr 18, 2020
Dec 31, 2019
Apr 10, 2020
Apr 14, 2020
Apr 16, 2020
Apr 15, 2020

Repository files navigation

                                                      .oooo.    .o8        .o88o. 
                                                    .dP""Y88b  "888        888 `" 
                .oooo.    .oooo.o ooo. .oo.  .oo.         ]8P'  888oooo.  o888oo  
               `P  )88b  d88(  "8 `888P"Y88bP"Y88b      .d8P'   d88' `88b  888    
                .oP"888  `"Y88b.   888   888   888    .dP'      888   888  888    
               d8(  888  o.  )88b  888   888   888  .oP     .o  888   888  888    
               `Y888""8o 8""888P' o888o o888o o888o 8888888888  `Y8bod8P' o888o   
                                                                                  
                                                                                  
                                                                                  
The only true brainfuck assembler. Produces small and efficient brainfuck code based on instruction choice.
With C preprocessor wired up, named labels and all the features you'd expect from a normal assembly, it's ready
for your use. The standard library is currently being constructed and you may contribute to make it even better.
Floating point support is being planned and worked on. Please refer to doc/ for detailed documentation.

https://esolangs.org/wiki/Asm2bf - in-depth explanation of asm2bf inner workings and programming techniques.
                                   serves as a documentation aswell. article.txt contains a mirror of this article.
examples/                        - who doesn't love learning by examples?
test/                            - unit tests for the entire toolchain.
rave/                            - an efficient brainfuck interpreter made specifically for executing asm2bf code.

asm2bf was used to create a JSON formatter webservice:
https://github.com/KrzysztofSzewczyk/JSONFormatter/blob/master/jsonformatter.asm

also, a subleq interpreter approach has been taken:
https://github.com/KrzysztofSzewczyk/SqEMU/blob/master/dev-sqemu.s

------------------------------------------ Get a taste of it! ------------------------------------------

#function bf_while(reg) print("nav " .. reg); print("raw .["); end
#function bf_wend(reg) print("nav " .. reg); print("raw .]"); end

; branchless* bitness test.
; r1 <= interpreter's bitness
; r2 <= trashed
@bitness
	clr r1
	mov r2, 1
$(bf_while("r2"))
	inc r1
	asl r2
$(bf_wend("r2"))
	ret

; Note: We say branchless, because there are no explicit jumps.
;       There is a branch (a brainfuck loop), but it's not in a
;       logical sense (no label is made, no jmp is executed).

--------------------------------------- Installation Instruction ---------------------------------------

1. Pull the repository from github: `git clone https://github.com/KrzysztofSzewczyk/asmbf'
2. Build asm2bf: `make all'
3. Drop asm2bf into your home directory: `make setup'
4. Optional: Add `~/.asmbf' into your PATH.

About

The only true brainfuck-targetting assembler.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 68.3%
  • Brainfuck 16.1%
  • Python 6.1%
  • Java 5.4%
  • Assembly 2.2%
  • Lua 1.0%
  • Other 0.9%