Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication3.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <stdio.h>
- int main()
- {
- unsigned char a = 7;
- unsigned char b = 6;
- unsigned char y = 255;
- /*_asm //konstrukcja IF
- {
- mov cl, 0
- mov al, a
- sub al, 7
- jnz Bartek
- mov cl, 1
- Bartek: mov y, cl
- } */
- //printf("y = %X\n", y);
- /*y = y & 0xFE;
- a = a & 0x01;
- y = a | y; */
- /*int licz = 0;
- if (y &0x01)
- licz++;
- if (y & 0x02)
- licz++;
- if (y & 0x04)
- licz++;
- if (y & 0x08)
- licz++;
- if (y & 0x10)
- licz++;
- if (y & 0x20)
- licz++;
- if (y & 0x40)
- licz++;
- if (y & 0x80)
- licz++; */
- int licz = 0;
- _asm {
- mov cl, 0
- mov al, a
- test al, 0x01
- jz endif
- add cl, 1
- endif:
- test al, 0x02
- jz endif
- add cl, 1
- endif:
- test al, 0x04
- jz endif
- add cl, 1
- test al, 0x08
- }
- printf("Wynik = %d", licz);
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement