Advertisement
JuanDark24

Untitled

Dec 16th, 2021
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .386
  2. .model flat, stdcall
  3. .data
  4. bigEndian BYTE 12h, 34h, 56h, 78h
  5. ; 78 34 56 12
  6. littleEndian DWORD ?
  7. .code
  8. start:
  9.     ;write your code here
  10.     ; Se obtienen los valores de la ultima y primera posición
  11.     mov al, [bigEndian+3]   ;al = 78
  12.     mov ah, [bigEndian]     ;ah = 12
  13.    
  14.     ; Se le pasa esos valores a las posiciones contrarias
  15.     mov [bigEndian], al     ;bigEndian {78, 34, 56, 78}
  16.     mov [bigEndian+3], ah   ;bigEndian {78, 34, 56, 12}
  17.    
  18.     ; Se obtienen los valores de la tercera y segunda posición
  19.     mov al, [bigEndian+2]   ;al = 56  
  20.     mov ah, [bigEndian+1]   ;ah = 34
  21.    
  22.     ; Se le pasa esos valores a las posiciones contrarias
  23.     mov [bigEndian+1], al   ;bigEndian {78, 56, 56, 78}
  24.     mov [bigEndian+2], ah   ;bigEndian {78, 56, 34, 78}      
  25.    
  26.     ; Convertidor
  27.     mov eax, DWORD PTR bigEndian
  28.    
  29.     ; Se le pasa el eax a la  nueva lista convertida  
  30.     mov littleEndian, eax        
  31.  
  32.     ret
  33.     END start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement