Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //второй вариант
- #include <stdio.h>
- #include <locale.h>
- #include <cstdlib>
- int main()
- {
- setlocale(LC_ALL, "Russian");
- int d1, result2;
- short int result1, w1, result4, w2;
- char b1, result3;
- printf("Введите число для ССЛ:");
- scanf_s("%hd", &w1);
- printf("Введите число для ЦСП(8)П:");
- scanf_s("%hd", &w2);
- printf("Введите число для AДП:");
- scanf_s("%d", &d1);
- printf("Введите число для ЦБЛ:");
- scanf_s("%hhd", &b1);
- _asm
- {
- //ССЛ(2)
- mov ax, w1
- shl ax, 2
- mov result1, ax
- //АДП(3)
- mov ax, word ptr d1
- mov bx, word ptr d1 + 2
- mov cx, 3
- m1:
- clc
- rcr bx, 1
- rcr ax, 1
- loop m1
- mov word ptr result2, ax
- mov word ptr result2 + 2, bx
- //ЦБЛ(4)
- mov al, b1
- rol al, 4
- mov result3, al
- //ЦСП(5)П
- mov ax, w2
- mov bx, 5
- m2:
- rcr ax, 1
- loop m2
- mov result4, ax
- }
- printf("CCЛ:%d\n", result1);
- printf("АДП:%d\n", result2);
- printf("ЦБЛ:%hhd\n", result3);
- printf("ЦСП(8)П:%hd\n", result4);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement