CodeWalrus

Development => Calculators => Calc Projects, Programming & Tutorials => Topic started by: Snektron on January 31, 2015, 08:11:12 PM

Title: [z80 asm] BrainVM
Post by: Snektron on January 31, 2015, 08:11:12 PM
So i got bored to day, and decided to make a Brainc Virtual Machine in z80
(ti 83+, 84+ etc). I haven't yet made a way to input code on the calculator, but it
has all the instructions.
The input code supports all alpha characters (including theta) and 1-9 (i should impelent 0, oops), + - * / ^ ( )
. and ,. character 10 is new line in the print code.
Title: Re: [z80 asm] BrainVM
Post by: Dream of Omnimaga on January 31, 2015, 11:11:14 PM
Nice. This is a very common project among calc coders but they are rarely in ASM. Do you plan to let people use the main editor like in Axe/Basic and SourceCoder?
Title: Re: [z80 asm] BrainVM
Post by: 岩倉 澪 on February 01, 2015, 12:05:44 AM
bf is a fun language to warp your brain, the one thing I didn't like about it was the cell size, I never wanted to implement routines to work on multibyte ints :P
Title: Re: [z80 asm] BrainVM
Post by: Dream of Omnimaga on February 01, 2015, 12:56:20 AM
Quote from: 岩倉 澪 on February 01, 2015, 12:05:44 AM
bf is a fun language to warp your brain
warp in another dimension? O.O
Title: Re: [z80 asm] BrainVM
Post by: Snektron on February 01, 2015, 11:39:24 AM
Quote from: DJ Omnimaga on January 31, 2015, 11:11:14 PM
Nice. This is a very common project among calc coders but they are rarely in ASM. Do you plan to let people use the main editor like in Axe/Basic and SourceCoder?
Hm not a bad idea actually. Maybe i can make it an app like axe and do some VAT magic.
Title: Re: [z80 asm] BrainVM
Post by: Dream of Omnimaga on February 01, 2015, 05:10:36 PM
By VAT logic what do you mean?
Title: Re: [z80 asm] BrainVM
Post by: Snektron on February 01, 2015, 05:26:02 PM
Well, selecting a program and running it via an app, kinda like selecting a program to compile wit Axe.
Title: Re: [z80 asm] BrainVM
Post by: Dream of Omnimaga on February 01, 2015, 05:29:37 PM
Oh OK. I thought you meant you would make the BF language support storing stuff in TI-OS BASIC variables or something.
Title: Re: [z80 asm] BrainVM
Post by: aetios on February 03, 2015, 07:11:20 AM
Nice project, Keoni learned me BF some time back and it's a fun language :D
Title: Re: [z80 asm] BrainVM
Post by: Snektron on February 03, 2015, 01:54:20 PM
Sometimes a little overwhelming though, but i guess it's called brainc for a reason.
Title: Re: [z80 asm] BrainVM
Post by: Dream of Omnimaga on February 03, 2015, 04:10:43 PM
Yeah apparently it's even harder than Z80 ASM, but it's the goal. I remember juju made a brainc interpreter a few years ago in TI-BASIC and when I looked at BF syntax on another site out of curiosity, I was like OMG!.
Title: Re: [z80 asm] BrainVM
Post by: Snektron on February 03, 2015, 05:25:12 PM
That's nothing. There is a language called Quantum Brainc.
(http://esolangs.org/wiki/Quantum_brainc (http://esolangs.org/wiki/Quantum_brainc)). But i think it's especially hard since
the instructions are so obscure. If you make some macros it would ne a lot easier :P
Btw, esolangs is a great site, there are some really interesting languages on there
http://esolangs.org/wiki/Joke_language_list (http://esolangs.org/wiki/Joke_language_list)
Title: Re: [z80 asm] BrainVM
Post by: Duke "Tape" Eiyeron on February 03, 2015, 05:55:48 PM
Your link goes to a blank page.
Title: Re: [z80 asm] BrainVM
Post by: Snektron on February 03, 2015, 06:34:49 PM
The first or the second one? (they both work with me)
Title: Re: [z80 asm] BrainVM
Post by: Duke "Tape" Eiyeron on February 03, 2015, 09:56:07 PM
The first one; Im mean that the esolang page for your esoteric language is avoid of any information.
Title: Re: [z80 asm] BrainVM
Post by: Snektron on February 03, 2015, 10:37:16 PM
That's weird :( but i don't really know what to do about that  ???
Title: Re: [z80 asm] BrainVM
Post by: 岩倉 澪 on February 04, 2015, 03:22:04 AM
The difficulty of bf is mostly superficial imo.
The syntax is obviously very unreadable and the primitives are extremely basic so one has to learn many idioms and patterns to construct normal programming constructs, and only having bytes to work with makes it very challenging to do operations of much use at all unless you emulate larger word sizes by writing multibyte routines.
Once you learn the tricks and build up some useful routines, if you structure the code intelligently with whitespace and make good use of comments, programming in it becomes very doable.
Title: Re: [z80 asm] BrainVM
Post by: Dream of Omnimaga on February 04, 2015, 04:29:09 AM
Would it be possible to just use Find/replace in Notepad to change every instruction to something closer to English or at least Z80 ASM, then once you are done coding, change them back to BF instructions? Or is that out of the question?
Title: Re: [z80 asm] BrainVM
Post by: 岩倉 澪 on February 04, 2015, 04:35:20 AM
Changing the names of the instructions doesn't really help too much, but it is very reasonable to use labels and variables and copy pasta routines to replace them manually (or automated) similiar to what an assembler does