Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .386
- .model flat, stdcall
- .data
- bigEndian BYTE 12h, 34h, 56h, 78h
- ; 78 34 56 12
- littleEndian DWORD ?
- .code
- start:
- ;write your code here
- ; Se obtienen los valores de la ultima y primera posición
- mov al, [bigEndian+3] ;al = 78
- mov ah, [bigEndian] ;ah = 12
- ; Se le pasa esos valores a las posiciones contrarias
- mov [bigEndian], al ;bigEndian {78, 34, 56, 78}
- mov [bigEndian+3], ah ;bigEndian {78, 34, 56, 12}
- ; Se obtienen los valores de la tercera y segunda posición
- mov al, [bigEndian+2] ;al = 56
- mov ah, [bigEndian+1] ;ah = 34
- ; Se le pasa esos valores a las posiciones contrarias
- mov [bigEndian+1], al ;bigEndian {78, 56, 56, 78}
- mov [bigEndian+2], ah ;bigEndian {78, 56, 34, 78}
- ; Convertidor
- mov eax, DWORD PTR bigEndian
- ; Se le pasa el eax a la nueva lista convertida
- mov littleEndian, eax
- ret
- END start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement