Advertisement
olgierd

ASK_ZAD1

Dec 10th, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. //Zadanie 1. Napisz kod w asemblerze zamieniający kolejność bitów w bajcie.
  2. unsigned char wejscie = 0xAF;
  3. unsigned char wynik2;
  4. bitset<8> wynik(wejscie);
  5. cout << wynik << endl;
  6. _asm {
  7. mov al,wejscie
  8. mov ah,al
  9. mov cl, 0x00
  10. mov dl,0x80
  11. mov bl,0x01
  12.  
  13. loop0:
  14. and al,bl
  15. jz end0
  16. or cl,dl
  17. end0:
  18. shl bl,1
  19. shr dl,1
  20. mov al,ah
  21. jnz loop0
  22. mov wynik2,cl
  23. }
  24. bitset<8> eldo(wynik2);
  25. cout << eldo << endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement