PicoBlaze Simulator in JavaScript

Off-topic talk on music, art, literature, games and forum games.
teo123
Master of the Forum
Posts: 1449
Joined: Tue Oct 27, 2015 3:46 pm
Diet: Vegan

Re: PicoBlaze Simulator in JavaScript

Post by teo123 »

This night, it occurred to me how I could simplify the algorithm I use to parse if-else-branches and while-loops in PicoBlaze Assembly. So, today, I implemented that simplified algorithm: https://github.com/FlatAssembler/PicoBl ... /parser.js
The resulting AST is, unless I am mistaken, the same for every possible input to the parser.
teo123
Master of the Forum
Posts: 1449
Joined: Tue Oct 27, 2015 3:46 pm
Diet: Vegan

Re: PicoBlaze Simulator in JavaScript

Post by teo123 »

Yesterday, I tried to reproduce this weird bug in the preprocessor in a minimal reproducible example, but failed: https://github.com/FlatAssembler/PicoBl ... S/issues/8
teo123
Master of the Forum
Posts: 1449
Joined: Tue Oct 27, 2015 3:46 pm
Diet: Vegan

Re: PicoBlaze Simulator in JavaScript

Post by teo123 »

I just merged the first pull request I got on my PicoBlaze Simulator: https://github.com/FlatAssembler/PicoBl ... JS/pull/10
Apparently, there was a bug in the way I implemented the `sra` bit-shifting directive. Still, GitHub forks and stars won't help me pass my cybernetics test next week.
teo123
Master of the Forum
Posts: 1449
Joined: Tue Oct 27, 2015 3:46 pm
Diet: Vegan

Re: PicoBlaze Simulator in JavaScript

Post by teo123 »

OK, in the meantime, that agustiza and I made a few automated tests using the JEST framework.
teo123
Master of the Forum
Posts: 1449
Joined: Tue Oct 27, 2015 3:46 pm
Diet: Vegan

Re: PicoBlaze Simulator in JavaScript

Post by teo123 »

I modified the header of my PicoBlaze assembler and emulator to mention Agustin Izaguirre as an author. I guess it looks more professional if it's immediately obvious that it's an international open-source project. Maybe it motivates somebody else to join us.
teo123
Master of the Forum
Posts: 1449
Joined: Tue Oct 27, 2015 3:46 pm
Diet: Vegan

Re: PicoBlaze Simulator in JavaScript

Post by teo123 »

I've tried to speed things up in my PicoBlaze Simulator by adding a checkbox enabling the user to disable updating registers and flags on every step. The "Fibonacci Sequence" example, on my machine, runs in 54 seconds if displaying registers and flags is enabled, and it runs in 27 seconds if they are disabled. That's a significant speed-up, but not as much as 12 times (down to 5 seconds) as Agustin Izaguirre claimed was possible to speed it up by disabling DOM manipulation.
TelepathyConspiracy
Junior Member
Posts: 82
Joined: Thu Dec 22, 2022 3:50 pm
Diet: Vegan

Re: PicoBlaze Simulator in JavaScript

Post by TelepathyConspiracy »

Sorry I didn't keep up, it's been forever, how did your project go? My html is a bit further along and can be downloaded directly single file now, do you know who did this forum? Very fast loads, I'm just using GAS and Google Drive
teo123
Master of the Forum
Posts: 1449
Joined: Tue Oct 27, 2015 3:46 pm
Diet: Vegan

Re: PicoBlaze Simulator in JavaScript

Post by teo123 »

TelepathyConspiracy wrote:Sorry I didn't keep up, it's been forever, how did your project go?
Well, a few important things have been going on with my PicoBlaze simulator in JavaScript:

1. I noticed that "Download Hexadecimal" doesn't work in WebPositive (the WebKit-based browser that comes with HaikuOS). Which is concerning as it suggests that perhaps it doesn't work in Safari either (because Safari is also WebKit-based).I don't have access to any iPhone or iMac to test that myself.
2. Agusting Izaguirre is no longer responding to my messages. Which means I am alone again.
3. I got a C from my Bachelor thesis, which describes that PicoBlaze simulator. The vast majority of students at my university get either A or B from their Bechelor thesis. In my opinion, it is very unfair that I got a C, because it shows that academia values sciency style of the documentation more than working software. But the good news is that I now have a diploma for my Bachelor degree.
4. My mentor told me to delete the documentation from GitHub, as it is supposedly a copyright infringement of the DABAR repository of Bachelor theses. Now only the presentation (in PPT, PPTX and ODP formats) is available on GitHub.
5. Recently, I noticed a bug causing the Program Counter labels not to be deleted when the next breakpoint is reached, and I fixed it.
teo123
Master of the Forum
Posts: 1449
Joined: Tue Oct 27, 2015 3:46 pm
Diet: Vegan

Re: PicoBlaze Simulator in JavaScript

Post by teo123 »

Today, I've found another easy-to-fix bug and fixed it: https://github.com/FlatAssembler/PicoBl ... /issues/21
teo123
Master of the Forum
Posts: 1449
Joined: Tue Oct 27, 2015 3:46 pm
Diet: Vegan

Re: PicoBlaze Simulator in JavaScript

Post by teo123 »

A few days ago, I noticed a very serious bug in the preprocessor of my PicoBlaze assembler. Namely, if the user misspells a preprocessor directive (e.g. `costant` instead of `constant`) inside a `while` loop or an `if` branching, the preprocessor would fail silently. I can't believe such a bug hasn't been noticed all until now. So, I made a new release with a fix to that problem.
Post Reply