FA - asks for help
Various knowledgeable members - offer help
FA - no that's not the answer I want
wash, rinse, repeat
Various knowledgeable members - offer help
FA - no that's not the answer I want
wash, rinse, repeat
PicoBlaze Simulator in JavaScript
|
FA - asks for help
Various knowledgeable members - offer help FA - no that's not the answer I want wash, rinse, repeat (August 12, 2022 at 4:37 pm)HappySkeptic Wrote:(August 12, 2022 at 1:41 pm)FlatAssembler Wrote: Whence am I supposed to know all those things? I am just a third-year computer science student. And I have also been using a hell lots of things we haven't been taught at the university in my program. Yeah. I have done some unit tests in the AEC-to-WebAssembly compiler, but I made no unit tests in the PicoBlaze Simulator, nor would I know how exactly to do those there. (August 12, 2022 at 3:16 pm)BrianSoddingBoru4 Wrote:(August 12, 2022 at 1:41 pm)FlatAssembler Wrote: Whence am I supposed to know all those things? I am just a third-year computer science student. And I have also been using a hell lots of things we haven't been taught at the university in my program. Well, in Osijek, there are two universities teaching Computer Science, the FERIT university (the one I am attending) and the MATHOS university, and the FERIT university is considered much more prestigious. (August 15, 2022 at 6:55 am)FlatAssembler Wrote:(August 12, 2022 at 3:16 pm)BrianSoddingBoru4 Wrote: If you’ve been at this for three years and don’t understand performance tests, maybe you should enroll in a different CS programme. The school is doing a dandy job of educating you if you feel the need to go to an atheist forum, as well as other social media platforms for help. RE: PicoBlaze Simulator in JavaScript
August 15, 2022 at 9:35 am
(This post was last modified: August 15, 2022 at 9:39 am by bennyboy.)
(August 15, 2022 at 6:44 am)FlatAssembler Wrote: Thank you, it would be a good thing to speed up the assembler a bit. But the assembler is, at least for the test programs, already running at an acceptable speed. It is the simulator that is running way too slowly.Well, at least this file was commented, so it's slightly more readable. It still seems to me that so many if/else statements is likely to cause trouble-- though if you're only running programs limited to 4KB, it's hard to believe that even an inefficient algorithm would take more than a split second. Anyway, instead of so many repeated conditionals, I'd recommend using a large "switch": Code: var codebyte = currentDirective & 0xff000; It's (much) better to generate a lookup table on compile than to keep constantly doing new comparisons. (I'm not so sure how much this will actually affect processing a small amount of data though). (August 15, 2022 at 6:57 am)arewethereyet Wrote:What does "dandy" mean?(August 15, 2022 at 6:55 am)FlatAssembler Wrote: Well, in Osijek, there are two universities teaching Computer Science, the FERIT university (the one I am attending) and the MATHOS university, and the FERIT university is considered much more prestigious. (August 15, 2022 at 9:35 am)bennyboy Wrote:(August 15, 2022 at 6:44 am)FlatAssembler Wrote: Thank you, it would be a good thing to speed up the assembler a bit. But the assembler is, at least for the test programs, already running at an acceptable speed. It is the simulator that is running way too slowly.Well, at least this file was commented, so it's slightly more readable. It still seems to me that so many if/else statements is likely to cause trouble-- though if you're only running programs limited to 4KB, it's hard to believe that even an inefficient algorithm would take more than a split second. I have always thought switch-case and large else-if statements compiled into the same assembly code. (August 16, 2022 at 12:38 pm)FlatAssembler Wrote: I have always thought switch-case and large else-if statements compiled into the same assembly code. It depends on the language and how many items are in the switch statement. Best case, the switch turns into a lookup table or map of jump instructions. Worst case they are the same. That makes switch the smart choice, as well as making the code more readable. RE: PicoBlaze Simulator in JavaScript
August 16, 2022 at 5:39 pm
(This post was last modified: August 16, 2022 at 6:14 pm by bennyboy.)
(August 16, 2022 at 12:38 pm)FlatAssembler Wrote: I have always thought switch-case and large else-if statements compiled into the same assembly code.That doesn't make sense. If you have a series of say 100 if/else statements, it is going to have to evaluate those one-by-one as part of the control flow of the app. But a switch statement can be evaluated as a single flow item. Look at your code-- how will you ever arrive at those items near the end of your long if/else chains? There's no way but for the CPU to go through all of those many evalutions one-by-one. Now, I'm not an expert in computer languages. I can imagine that a very clever compiler will realize that all your conditional statements are being performed on the same object, and just generate a lookup table. But I'd be pretty surprised if that were the case with JavaScript running in a browser. And EVEN IF they compiled the same (which I really do doubt), the appearance of code matters, too. A switch is easier to read. (November 14, 2020 at 3:35 pm)FlatAssembler Wrote: Can anybody here diagnose why the layout breaks in Firefox for Android when in the Landscape mode? Why are you always asking us to do your homework for you?
Nay_Sayer: “Nothing is impossible if you dream big enough, or in this case, nothing is impossible if you use a barrel of KY Jelly and a miniature horse.”
Wiser words were never spoken. |
« Next Oldest | Next Newest »
|
Possibly Related Threads... | |||||
Thread | Author | Replies | Views | Last Post | |
A weird bug in the preprocessor of PicoBlaze Simulator in JavaScript | FlatAssembler | 81 | 9431 |
December 19, 2023 at 4:46 pm Last Post: BrianSoddingBoru4 |
|
Reformatting tools for JavaScript | FlatAssembler | 0 | 450 |
June 14, 2020 at 10:13 am Last Post: FlatAssembler |
|
Anatomy of religion in RELIGION SIMULATOR game | gravitysoftware | 12 | 3390 |
February 8, 2015 at 12:52 pm Last Post: c172 |
|
Analysis of a Facebook social engineering/Javascript "hack" | Autumnlicious | 4 | 3496 |
March 2, 2011 at 9:29 am Last Post: fr0d0 |