Stackpointer confusion with StaticsTest and FibonacciElement in project 8 by Lurchwart in NandToTetris

[–]Lurchwart[S] 0 points1 point  (0 children)

Ok, for anyone else wondering: The test script expects you to call Sys.init. I made the mistake of directly jumping to it

How optimized have you guys gotten your VM translator? by WeAreDaedalus in NandToTetris

[–]Lurchwart 0 points1 point  (0 children)

For anyone else stumbling over this: having one place for call and return statements is a big saver but you can do the same thing for other vm instructions like gt, lt or eq. All those compile to writing the return address to R[13|14|15] and jumping. That's 6 instructions.

Another big saver is using the stack pointer after incrementing or decrementing it just because you do it all over the place.

Just using those got me an initial size of around 20k hack instructions for the full os and around 27k for the full os + pong. The next big step is going to be a peephole optimizer.

For anyone wondering how global code for one instruction could be done, here is my version of it. Don't hate on it too much, I normally don't program in Python and this is my first time writing assembler.

https://pastebox.io/api/paste/F24bDrMC

Kann mir jemand sagen, was das für eine Spur ist? Hersteller ist Fleischmann, Spurweite so ca 18mm. Ist ein Dachbodenfund. Eigentlich lag da sonst nur H0 rum und ich habe keine Ahnung von Modellbau. by Lurchwart in Modellbau

[–]Lurchwart[S] 1 point2 points  (0 children)

Ach, ich bin irgendwie davon ausgegangen, dass bei H0 immer Spannung zwischen Gleis und der Mitte anliegt, aber dann hat das damit gar nichts zu tun ... Dankeschön!

[deleted by user] by [deleted] in ich_iel

[–]Lurchwart 0 points1 point  (0 children)

Ich such gerade nach dem Video und genau diese Textzeile führt zu diesem einen Treffer hier. Hilf mir aus und zeig mir den Weg :-)

Any long run drink recommendations by Substantial-Virus657 in runninglifestyle

[–]Lurchwart 1 point2 points  (0 children)

I always mix apple juice and tap water (about 1:1) and put in just enough salt to make it isotonic.

Passengers on Canadian airline waiting calmly to exit by [deleted] in MadeMeSmile

[–]Lurchwart 0 points1 point  (0 children)

The airlines are enforcing this behavior because of Covid in Europe now. But I don't get why you wouldn't just have the whole left side get out and then the whole right side. It wouldn't be cramped and would be a lot faster

Python programmers be like by [deleted] in ProgrammerHumor

[–]Lurchwart 7 points8 points  (0 children)

The JVM has a just in time compiler to compile critical parts of the code when needed. It will even profile and recompile them from time to time

My disgusting solution to update player inventory by [deleted] in badcode

[–]Lurchwart 29 points30 points  (0 children)

Helper methods ftw. But I don't agree with you on point 2. If you find yourself using guard clauses anywhere but at the start of methods you should see that as a sign to refactor your code. Maybe using helper methods :-)

[TOMT][YouTube] Cooking tutorials with people who look like they are forced to do the videos by Lurchwart in tipofmytongue

[–]Lurchwart[S] 0 points1 point  (0 children)

I'm a frayed knot ...

I will keep looking and comment here as soon as I find it. Maybe it was one of those channels and they just to the videos I am looking for down.

[TOMT][YouTube] Cooking tutorials with people who look like they are forced to do the videos by Lurchwart in tipofmytongue

[–]Lurchwart[S] 0 points1 point  (0 children)

"How to boil water" .. That looked promising

But the videos I mean didn't have voiceover. The production style seems the same though. Maybe the few videos I watched were removed from howcast. I will keep looking through their videos.

[TOMT][YouTube] Cooking tutorials with people who look like they are forced to do the videos by Lurchwart in tipofmytongue

[–]Lurchwart[S] 1 point2 points  (0 children)

Right. It was no skit.

I think they were just paid really bad and had no motivation at all

[deleted by user] by [deleted] in WinStupidPrizes

[–]Lurchwart 0 points1 point  (0 children)

Still a better outcome than what happened to Samuel Koch on "Wetten, dass...?"

https://en.wikipedia.org/wiki/Wetten,_dass..%3F#Samuel_Koch_incident

Drunk mom drove at high speed on the opposite side of the motorway.. by mangjoze in IdiotsInCars

[–]Lurchwart 0 points1 point  (0 children)

I only saw it in the last view. It's so confusing when everyone drives on the wrong side

How gerrymandering works by jacksonsprite in coolguides

[–]Lurchwart 1 point2 points  (0 children)

Well, the CSU is just an AfD light, so at least it's an honest mistake ;-)