Giter VIP home page Giter VIP logo

bf64's Introduction

A brainfuck interpreter for the c64.
All instructions are supported.
Loops cannot be nested more than 255 times.

To enter programming mode POKE 259, 00 then run the program.
In this mode simply enter each instruction (E to Exit).
To enter execute mode POKE 259, 01. The program will now run.
To enter debug print mode POKE 259, 64. The program will now be printed to the screen.
To change the starting location of the code area poke 2061 and 2062 with a new location.
To change the data location poke 2063 and 2064.

Memory locations (in hex):
inst_ptr	FB
data_ptr	FD
next_inst	FF
init_magic	100
temp	101
repl_flag	103
file_name_ptr	104
file_name_ptr_r	106
file_name_ptr_w	108
flogical_r	10A
flogical_w	10B
flogical	10C
fdevice_r	10D
fdevice_w	10E
fdevice	10F
fsecondary_r	110
fsecondary_w	111
fsecondary	112

bfcode_ptr	80D
bfdata_ptr	80F

Repl flag values:
; repl flag
; possible values:
;   00 -> code input mode
;   7th bit = 1 -> output current instruction during execution
;   6th bit = 1 -> ouput program
;   5th bit = 1 -> skip menu
;
;   the following file commands requires the user to set up file_name, flogical, fsecondary and fdevice
;   4th bit = 1 -> set file as input
;   3rd bit = 1 -> set file as output
;   2nd bit = 1 -> load prg from file to bfcode_ptr
;   1st bit = 1 -> save bfcode_ptr contents to file until \0
;
;   0th bit = 1 -> execute code



FAQ:

Q: Why though?
A: Because I can.

Q: How can I run my own program?
A: Simply assemble the rom and .incbin your bf file in the bfcode section.

Q: What is the expected test output of test.bf

A: 0 0 5 5 1 57 0 0 0

bf64's People

Contributors

unlink2 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.