Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //https://vk.com/evgenykravchenko0
- ___ ___ ___
- / /\ ___ / /\ / /\
- / /:/_ /__/\ / /:/_ / /:/_
- / /:/ /\ \ \:\ / /:/ /\ / /:/ /\
- / /:/ /:/_ \ \:\ / /:/_/::\ / /:/ /:/_
- /__/:/ /:/ /\ ___ \__\:\ /__/:/__\/\:\ /__/:/ /:/ /\
- \ \:\/:/ /:/ /__/\ | |:| \ \:\ /~~/:/ \ \:\/:/ /:/
- \ \::/ /:/ \ \:\| |:| \ \:\ /:/ \ \::/ /:/
- \ \:\/:/ \ \:\__|:| \ \:\/:/ \ \:\/:/
- \ \::/ \__\::::/ \ \::/ \ \::/
- \__\/ ~~~~ \__\/ \__\/
- ___
- /__/\ ___ ___
- \ \:\ / /\ / /\
- \ \:\ / /:/ / /:/
- _____\__\:\ /__/::\ /__/::\
- /__/::::::::\ \__\/\:\__ \__\/\:\__
- \ \:\~~\~~\/ \ \:\/\ \ \:\/\
- \ \:\ ~~~ \__\::/ \__\::/
- \ \:\ /__/:/ /__/:/
- \ \:\ \__\/ \__\/
- \__\/
- #include "stdafx.h"
- #include <stdio.h>
- #include <cstdlib>
- #include <conio.h>
- int main()
- {
- char a;
- char b;
- char c;
- unsigned int first;
- unsigned int second;
- unsigned int third;
- int result_a = 0;
- int result_b = 0;
- int result_c = 0;
- printf_s("Enter 3 letters : ");
- a = _getche();
- b = _getche();
- c = _getche();
- first = a;
- second = b;
- third = c;
- printf_s(" \n \n In ASCII \n \n First letter = %d, second letter = %d, third letter = %d \n \n", a, b, c);
- _asm
- {
- mov esi, 1
- mov eax, first
- xor ebx, ebx
- lap :
- mov edx, 0
- jmp start
- zero :
- shl ebx, 1
- jmp zero_cont
- one :
- shl ebx, 1
- add ebx, 1
- zero_cont :
- inc edx
- cmp al, 0
- jz escape
- shl al, 1
- jc one
- jnc zero
- start :
- shl al, 1
- jc one
- inc edx
- jmp start
- escape :
- mov ecx, 8
- sub ecx, edx
- cmp ecx, 0
- jz result
- last_zeros :
- shl ebx, 1
- loop last_zeros
- result :
- cmp esi, 2
- jz result_two
- cmp esi, 3
- jz result_third
- mov result_a, ebx
- inc esi
- mov eax, second
- jmp lap
- result_two :
- mov result_b, ebx
- inc esi
- mov eax, third
- jmp lap
- result_third :
- mov result_c, ebx
- xor edx,edx
- test ebx, 0ffff0000h
- jnz four_byte
- test bx, 0ff00h
- jnz two_byte
- mov dl, bl
- jmp ended
- four_byte :
- mov edx, ebx
- jmp ended
- two_byte :
- mov dx, bx
- jmp ended
- ended :
- }
- printf_s(" 1. After %d ", result_a);
- printf_s("\n 2. After %d ", result_b);
- printf_s("\n 3. After %d ", result_c);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement