Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <stdio.h>
- #include <locale.h>
- #include <cstdlib>
- int main()
- {
- setlocale(LC_ALL, "Russian");
- int a;
- printf("This program calculet high byte words logically added to the low byte, written in reverse order.:\n");
- printf("Enter value A:\n");
- scanf_s("%i", &a);
- _asm
- {
- mov eax, a
- mov cx, 8
- mov bl, 1
- xor dx, dx
- reverse :
- shr ax, 1
- jnc escc
- add cx, -1
- shl bl, cl
- add dl, bl
- mov bl, 1
- add cx, 1
- escc:
- loop reverse
- mov eax, a
- mov cl, 8
- shr ax, cl
- and ax, dx
- mov a,eax
- }
- printf("Result on Asm: %i\n", a);
- system("pause");
- return 0;
- }
Add Comment
Please, Sign In to add comment