daily pastebin goal
58%
SHARE
TWEET

ToUpper

a guest Jan 22nd, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ConsoleApplication1.cpp : This file contains the 'main' function. Program execution begins and ends there.
  2. //
  3.  
  4. #include "pch.h"
  5. #include <iostream>
  6.  
  7. using namespace std;
  8.  
  9. void t0Upper(int*);
  10. int main()
  11. {
  12.     char s[] = "abcdABCD1234";
  13.     t0Upper((int*)s);
  14.     cout << s;
  15. }
  16.  
  17. /*
  18. ASCII CODE
  19. A=65 Z=90
  20. a=97 z=122
  21.  
  22. (a->A  <=>  a=a-32)
  23. */
  24. void t0Upper(int*)
  25. {
  26.     _asm {
  27.         mov ebx, [ebp + 8]
  28.         mov ecx, 0
  29.        
  30.         forInceput:
  31.         ///vedem daca iese din vector
  32.         mov dl, [ebx + ecx]
  33.             cmp dl, '/0'
  34.             je forStop
  35.  
  36.             ///vedem daca e litera mica (altfel sare peste)
  37.             cmp dl, 'a'
  38.             jl NuEliteraMica
  39.             cmp dl, 'z'
  40.             jg NuEliteraMica
  41.             ///daca nu a sarit e litera mica:
  42.             sub dl, 32
  43.             mov byte ptr[ebx + ecx], dl
  44.  
  45.         NuEliteraMica:
  46.         inc ecx
  47.         jmp forInceput
  48.  
  49.         forStop:
  50.     }
  51. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top