Advertisement
Gianvy

Lunghezza di una stringa zero terminata

Oct 17th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4.     char vett[255] = "ciccio merdone eroe nazionale";
  5.     char *p;
  6.     unsigned int lunghezza;
  7.     p = &vett[0];
  8.     __asm
  9.     {
  10.         mov ebx, p
  11.         mov esi, 0
  12.         ciclo:
  13.         mov al, byte ptr[ebx + esi]
  14.         cmp al, 0
  15.         je fine_ciclo
  16.         inc esi
  17.         jmp ciclo
  18.             fine_ciclo:
  19.         mov lunghezza, esi
  20.     }
  21.     printf("%d", lunghezza);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement