Better HN
topnewbestaskshowjobs
Log inSign up

tomhee

73 karma · joined Jan 17, 2025 (1y ago) · 16 submissions

Submissions

comment 1y ago · link · parent

Nice job! Just started my own too.

comment 1y ago · link · parent

@alok-g I'll be happy to explain - You don't understand it correctly. The flipjump assembly syntax does allow relating to an address with offsets/more advanced stuff, but that doesn't add anything to.the language. It' just adds comfort to the programmer - it's basically like adding labels to an assembly language - it's possible to write assembly without them, just much less convenient.

The power of flipjump results in self modifying code. If I jump to a address that have the [flip 0, jump 0x1000], then I'll get to 0x1000 afterwards, right? But if I flip some specific bit in this instruction before jumping to it, it will become [flip 0, jump 0x1080]. You can call this instruction "memory bit", and the part of jumping to it and resulting in one of two possible addresses 0x1000/0x1040 based on a specific bit in it - "read the memory bit". The action is reading as you get to different place based on the value stored in this instruction. This "read" can also be seen as an "if". How you write then? For example writing "1" whould be doing a "read", and in the "read 0" case - do a flip to this address, and in the "read 1" case don't flip this memory address bit.

comment 1y ago · link · parent

Alright - https://github.com/tomhea/flip-jump/wiki/Learn-FlipJump#memo...

comment 1y ago · link · parent

Do you have any article that I can read about it? Sounds interesting!

comment 1y ago · link · parent

The power is within the self modification of the code. The jump might be implemented by a multiplexer, though it can be implemented in other ways too.

comment 1y ago · link · parent

That's cool! And that's possible. Do you have any more data to read about it?

comment 1y ago · link · parent

If you have an answer I'd be happy to hear it!

comment 1y ago · link · parent

There actually was one with subleq: https://www.google.com/amp/s/blog.attify.com/flare-4-ctf-wri...

comment 1y ago · link · parent

Sure!

https://github.com/tomhea/flip-jump/wiki/Learn-FlipJump

This will let you understand how to implement the very basic "if" in flipjump.

I tried to make it as easy for newcomers, but please feel free and update me if something is written complicated.

After you understand up to the macros, you can try yourself to understand the xor macro, which most of the library is built based on it: https://github.com/tomhea/flip-jump/blob/fe51448932e78db7d76...

comment 1y ago · link · parent

Good point! It's mentioned in the github wiki here: https://github.com/tomhea/flip-jump/wiki/Learn-FlipJump#memo...

It was once in the Readme but as I kept developing it more it become longer and longer, so I moved it into the wiki, and especially to here: https://esolangs.org/wiki/FlipJump

comment 1y ago · link · parent

By the way, as a challenge, try how you can program an "If" statement in Flipjump.

comment 1y ago · link · parent

I dont think that the jump can be realized by NOT gates, but it's essentially "where to find the next NOT command". The jump is indeed a crucial part of the language, as it allows going back, and especially to make self-modifying code.

comment 1y ago · link · parent

You are indeed right

comment 1y ago · link · parent

There is also a brainfuck to flipjump compiler: https://github.com/tomhea/bf2fj

comment 1y ago · link · parent

Thanks man, I appreciate it.

16.

Show HN: Compile C to Not Gates(github.com ↗)

145 points · by tomhee · 1y ago · 63 comments