Author Topic: [Axe] BrainFuck 83+  (Read 5363 times)

0 Members and 1 Guest are viewing this topic.

Offline zero44

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 128
  • Rating: +21/-0
  • <!--//www.ustr.net/infrared/infrared1.shtml-->
    • View Profile
    • zero44
[Axe] BrainFuck 83+
« on: December 23, 2012, 03:55:36 pm »
Hey,

I made a parser and an emulator for BrainFuck language on calc.
Parser is not completed, so there are bugs : never use [][]

Feel free to send me bug reports / improvements ideas.

Enjoy

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: [Axe] BrainFuck 83+
« Reply #1 on: December 23, 2012, 03:58:39 pm »
nice, i guess 9 is > and 8 is < ?
And is there , ?

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: [Axe] BrainFuck 83+
« Reply #2 on: December 24, 2012, 05:16:20 am »
My brainfuck interpreters all have a break function. When you have an infinite loop you simply press a key and you break from the program.
If you like my work: why not give me an internet?








Offline zero44

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 128
  • Rating: +21/-0
  • <!--//www.ustr.net/infrared/infrared1.shtml-->
    • View Profile
    • zero44
Re: [Axe] BrainFuck 83+
« Reply #3 on: December 26, 2012, 04:19:31 pm »
Yes, I made a break function too.

Interpreter is fully complete (?) and supports ',' command, but it's badly done :(
I forgot to say that I added the * func (exit program) to the brainfuck, so when you compile a program it's recognized by parser as "hey, stop me NOW !" ;)

But the input fonction doesn't work actually in the parser.
And I fixed parser's loop bug, but not uploaded it .__.
« Last Edit: December 26, 2012, 04:23:57 pm by zero44 »
____________

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: [Axe] BrainFuck 83+
« Reply #4 on: December 26, 2012, 04:21:24 pm »
I started brainfuck madness >.<
lol
and it sounds cool, the interpreters/compilers

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: [Axe] BrainFuck 83+
« Reply #5 on: December 26, 2012, 04:33:54 pm »
You know what would be interesting, a BrainFuck compiler that takes brainfuck code and converts it into Axe code.  Then you would compile the generated Axe code for super speed!

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: [Axe] BrainFuck 83+
« Reply #6 on: December 26, 2012, 04:35:56 pm »
Brain=fucked
Do it Builderboy. NOW
Wait
That isn't too hard
lol, because of pointers :D

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: [Axe] BrainFuck 83+
« Reply #7 on: December 26, 2012, 04:36:35 pm »
Indeed, the wikipedia page even has a C equivalent to each of the symbols, and it's super easy haha.

Offline zero44

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 128
  • Rating: +21/-0
  • <!--//www.ustr.net/infrared/infrared1.shtml-->
    • View Profile
    • zero44
Re: [Axe] BrainFuck 83+
« Reply #8 on: December 26, 2012, 04:39:28 pm »
bf compiler which compiles to axe source ? for speed ? too easy and slow ^^ I'll surely do it.

but I have a bf compiler which compiles directly to hexa asm :) that's epic ..
you mean for example ++++++++ is compiled to +1+1+1+1+1+1+1+1 or to +8 ?
____________

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: [Axe] BrainFuck 83+
« Reply #9 on: December 26, 2012, 04:41:53 pm »
it would output something like
first
get some free space and point it to P
and set N equal to 0
and then for +
it would be {A+N}++
for - {A+N}--
for >
N++
for <
N--
for , some input to store to {A+N}
for .
text({A+N}>Char
for []
while {A+N}
code
end

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline zero44

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 128
  • Rating: +21/-0
  • <!--//www.ustr.net/infrared/infrared1.shtml-->
    • View Profile
    • zero44
Re: [Axe] BrainFuck 83+
« Reply #10 on: December 26, 2012, 04:47:00 pm »
this is what I said, easy.

in asm :
> 2C increase L register
< 2D decrease L
+ 56257E or somthing like this : take byte from address pointed by HL, increases and replace it
- guess it
. 7EEF0445 takes it to A and disps A as a char
, nothing yet
[ 7ECA**** jumps after ] if pointing zero
] 7EC2**** jumps after [ if pointing non-zero

Easy, I said. :)
____________

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: [Axe] BrainFuck 83+
« Reply #11 on: December 26, 2012, 04:59:26 pm »
Yeah making a Brainfuck to Asm compiler would probably be much easier now that I think about it haha.  The compiler could still be in Axe too! It just would have to do some annoying byte counting for the jumps.
« Last Edit: December 26, 2012, 05:00:00 pm by Builderboy »

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: [Axe] BrainFuck 83+
« Reply #12 on: December 26, 2012, 05:24:54 pm »
How do you create executables using axe software?
If you like my work: why not give me an internet?








Offline zero44

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 128
  • Rating: +21/-0
  • <!--//www.ustr.net/infrared/infrared1.shtml-->
    • View Profile
    • zero44
Re: [Axe] BrainFuck 83+
« Reply #13 on: December 27, 2012, 08:39:55 am »
...
I'm asking me if you understood ...
I created an on-calc compiler, written in Axe, which takes a BrainFuck source code program (prgmBF) and automatically compiles it to an asm program (prgmCALCFUCK) which is veryveryvery fast : you cannot see it displaying letters, for Hello World. And this compiler takes care of [[]] loops, but the online-released version creates a crashing asm program with [][] loops (a bug I've fixed yet, but not released)

Keoni29 : GetCalc(Name,Size)→Pointer example : GetCalc("prgmBF",1600)→P
And to make it an asm program, you'll have to be serious... and read an hexadecimal assembly tutorial (a sort of thing which can say you some things like saying that $C9 returns and $21 assign the 2-bytes following value to HL ...
« Last Edit: December 27, 2012, 08:43:33 am by zero44 »
____________

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: [Axe] BrainFuck 83+
« Reply #14 on: December 27, 2012, 08:56:28 am »
I know how machine code works, but I never learned z80 asm. Perhaps because I can't work with tasm/spasm/whichever outdated z-80 asm assemblers are out there. It'd be interesting to see a more modern interface for those. Iirc there was an oncalc assembler released.
If you like my work: why not give me an internet?