HNHacker News
TopNewBestAskShowJobs

tomhee

73 karma · joined January 17, 2025

submissionscomments
tomhee··on Show HN: I made my own OS from scratch because I was bored
Nice job! Just started my own too.
tomhee··on Show HN: Compile C to Not Gates
@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.

tomhee··on Show HN: Compile C to Not Gates
Alright - https://github.com/tomhea/flip-jump/wiki/Learn-FlipJump#memo...
tomhee··on Show HN: Compile C to Not Gates
Do you have any article that I can read about it? Sounds interesting!
tomhee··on Show HN: Compile C to Not Gates
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.
tomhee··on Show HN: Compile C to Not Gates
That's cool! And that's possible. Do you have any more data to read about it?
tomhee··on Show HN: Compile C to Not Gates
If you have an answer I'd be happy to hear it!
tomhee··on Show HN: Compile C to Not Gates
There actually was one with subleq: https://www.google.com/amp/s/blog.attify.com/flare-4-ctf-wri...
tomhee··on Show HN: Compile C to Not Gates
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...

tomhee··on Show HN: Compile C to Not Gates
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

tomhee··on Show HN: Compile C to Not Gates
By the way, as a challenge, try how you can program an "If" statement in Flipjump.
tomhee··on Show HN: Compile C to Not Gates
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.
tomhee··on Show HN: Compile C to Not Gates
You are indeed right
tomhee··on Show HN: Compile C to Not Gates
There is also a brainfuck to flipjump compiler: https://github.com/tomhea/bf2fj
tomhee··on Show HN: Compile C to Not Gates
Thanks man, I appreciate it.