Page 5 of 5

Re: Sunday, February 12, 2017

Posted: Sat Feb 18, 2017 12:30 pm
by TownEater
And I was feeling crazy for posting the suggestion to write your own JIT compiler last devlog! I've always loved making code from as scratch as possible, and it's something I definitely want to do someday, but I've just never gotten around to it.

Re: Sunday, February 12, 2017

Posted: Sun Feb 19, 2017 5:16 pm
by erf
It is very interesting to hear about your progress, benchmarking and your endeavour into various programminng languages, compilers etc. but i'm just curious if you tried everything when it comes to algorithms, data structures, parallelizing, instancing etc. Moving more stuff to the graphics API ( Vulkan ? ). Or if its not possible to scale down certain aspects of LT, before spending time on extreme performance optimizations as you seem to be doing now?

* i have not been following the threads lately, so i'm sorry in advance if this has already been discussed

Re: Sunday, February 12, 2017

Posted: Mon Feb 20, 2017 10:35 am
by N810
Wonder if Josh overslept today... :think:

Re: Sunday, February 12, 2017

Posted: Mon Feb 20, 2017 10:40 am
by IronDuke
Or he's making a glorious wall of text right now. :ghost:

--IronDuke

Re: Sunday, February 12, 2017

Posted: Tue Feb 21, 2017 1:41 am
by LindseyReid
JoshParnell wrote:
Detritus wrote:
JoshParnell wrote:55 89 e5
Hrrm... :think:
JoshParnell wrote:b8 39 05 00 00 5d c3
Hrrm... :think:
See below..
ruok wrote:1337 post indeed Josh :geek:
:clap: :clap: :clap:

Hahaha somebody got it woohoo!!! :D Great first post, welcome to the forums ruok :thumbup:

(More responses on the way, but for now, this ^ . I just woke up. Yayy Monday :squirrel: )
Josh seems to be taking his time, so I'll post my best guess.

I immediately recognized it as disassembled x84 assembly, which I have little to no experience with :P I first tried using a table to lookup each instruction's assembly representations, but after translating the first one, got really impatient and just ran it through a disassembler instead, lol:

55 89 e5
push ebp
mov ebp,esp

b8 39 05 00 00 5d c3
mov eax,0x539
pop ebp
ret

Which I'm pretty sure are basic instructions at the beginning and end of every function to push memory onto the stack to make room for the function, and then de-allocate that space and return once the function is done.

So that's just his super nerdy way of saying "begin post" and "end post".

1337 indeed.

Re: Sunday, February 12, 2017

Posted: Tue Feb 21, 2017 5:10 am
by HappyGhecko
Hah, it still pays off to visit this forum now and then. :ghost:

also
Grumblesaur wrote:Wasn't X Rebirth a truckload of awful on release anyway?
it still is.

Re: Sunday, February 12, 2017

Posted: Tue Feb 21, 2017 6:57 am
by charnode
HappyGhecko wrote:Hah, it still pays off to visit this forum now and then. :ghost:

also
Grumblesaur wrote:Wasn't X Rebirth a truckload of awful on release anyway?
it still is.
The only game ever that I actively removed from my Steam games list for good. That's how much of a trainwreck it was. Colossal failure.

Re: Sunday, February 12, 2017

Posted: Tue Feb 21, 2017 3:32 pm
by LindseyReid
Plofre wrote: Nice one, tried the same and gave up.
Looking at the code it actually sets up a standard stack frame for the function's local variables, then at the end loads 0x539 into eax, which represents the return value of the function.
Fly safe, commanders
Yes, that's what I said, so we are in violent agreement :)

Re: Sunday, February 12, 2017

Posted: Tue Feb 21, 2017 3:34 pm
by Talvieno
Well done! :D I looked at it for a while and couldn't figure it out. Never occurred to me to try assembly.

Re: Sunday, February 12, 2017

Posted: Wed Feb 22, 2017 9:53 am
by JoshParnell
Grats to femnode for the correct explanation :clap:

Code: Select all

/* My post is the function: */
void devlog (void) { return 1337; }
Though frankly only two lines were necessary for such a simple function (that uses no stack space):

Code: Select all

mov eax, 1337
ret
I included the prototypical x86-32 prologue and epilogue anyway as hints to those who might google the hex strings. Those hex sequences are so common in 32-bit disassemblies that googling them would actually clue you in to what it all means :)

Also
AlexWasLike wrote:... got really impatient and just ran it through a disassembler instead ...
It's the same online assembler/disassembler that I use to check the correctness of my emitted machine code. This site is awesome, bookmark it if you work with reversing or are just interested in asm :squirrel:

Maybe more asm / machine code puzzles in future logs...

Re: Sunday, February 12, 2017

Posted: Wed Feb 22, 2017 10:06 pm
by Flatfingers
First I tested if it was ASCII. Nope.

Then I tried EBCDIC. Also nope. (Well, you never know.)

Then I looked up 80x86 op codes, but I couldn't find 0x55 in any of the references I had at hand. It's been too long since I wrote TSRs, obviously.

Then I looked up 68x0x op codes, but no 0x55 there, either. (Again, you never know.)

Then I decided that you can't fix stupid, and went and did something else less embarrassing.

Nice that I was on the right track at one point, though -- grats to those who clevered it out proper-like!