Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bit>
- #include <bitset>
- #include <iostream>
- char* a = "abcdef";
- unsigned int i = 0;
- unsigned int k = 1; // k to be determined
- int main() {
- start:
- int b = std::popcount( std::uint8_t(a[i]) ) * k;
- __asm__ ("jmp done+b");
- done:
- goto exit;
- print:
- __asm__ ("nop"); // fill in with
- __asm__ ("nop"); // 8*k nops
- __asm__ ("nop");
- __asm__ ("nop");
- __asm__ ("nop");
- __asm__ ("nop");
- __asm__ ("nop");
- __asm__ ("nop");
- std::cout << a[i++]; goto start;
- exit:
- std::cout << "\n";
- return 0;
- }
Add Comment
Please, Sign In to add comment