Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main()
- {
- unsigned int a = -1;
- while (true)
- {
- std::cin >> a;
- if (a < 256)
- break;
- std::cout << "Неправильный ввод, число должно быть меньше 256" << std::endl;
- }
- char s[9];
- s[8] = 0;
- __asm {
- mov EAX, a;
- mov EBX, 0;
- loop_begin:
- test AL, 10000000b;
- jnz condition;
- mov byte ptr s[EBX], '0';
- jmp not_condition;
- condition:
- mov byte ptr s[EBX], '1';
- not_condition:
- shl EAX, 1;
- inc EBX;
- cmp EBX, 8;
- jge loop_end;
- jmp loop_begin;
- loop_end:
- }
- std::cout << s << std::endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement