9

I used inline C in perl to write inline assembly.

I deserve death.

Comments
  • 3
    ** using compiler intrinsics instead does not make the act any less sinful, pardon denied.
  • 4
    Oh look an actual rant between all the spam :D
  • 2
    But at least it works, right?
  • 2
    what are you building..?
  • 5
    If its x86, then the only place it won't run is on a Mac. This is an acceptable loss.
  • 2
    @YourMom

    Hey, this guy looks a bit like a character in my latest novel.
  • 2
    @AceDev I ask myself the same question ;>

    Short version is I wanted to use RDTSC and ROR in a subroutine but couldn't do it at the high level, and so here we are. It's actually fairly straightforward if you use intrinsics, something like:

    ```perl

    use Inline C => q[

    · · #include <x86intrin.h>

    · · long prng() {

    · · · · long out=__rdtsc();

    · · · · long rem=out;

    · · · · for(int i=0;i < 8;++i) {

    · · · · · · rem=__rorq(rem,8);

    · · · · · · out^=rem;

    · · · · };

    · · · · return out;

    · · };

    ];

    ```

    Mmh, actually, I may rewrite it like that for clarity lmao. It compiles to the same thing anyway.

    @retoor uuh yes I want the dynamite maker NFT they give to war criminals, what's it called? the nobel peace something something?
  • 3
    @retoor that no funni (•ˋ _ ˊ•)
Add Comment