-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMovingData.nasm
More file actions
59 lines (43 loc) · 887 Bytes
/
MovingData.nasm
File metadata and controls
59 lines (43 loc) · 887 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
global _start
section .text
_start:
; Mov inmediate data to register
mov eax, 0xaaaaaaaa
mov al, 0xbb
mov ah, 0xcc
mov ax, 0xdddd
mov ebx, 0
mov ecx, 0
; Mov Register to Register
mov ebx, eax
mov cl, al
mov ch, ah
mov cx, ax
mov eax,0
mov ebx,0
mov ecx,0
;Mov from memory into register
mov al, [sample]
mov ah, [sample+1]
mov bx, [sample]
mov ecx, [sample]
;Mov from register into memory
mov eax, 0x33445566
mov byte [sample], al
mov word [sample], ax
mov dword [sample], eax
;mov inmediate value into memory
mov dword [sample], 0x33445566
;lea demo
lea eax, [sample]
lea ebx, [eax]
;xchg demo
mov eax, 0x11223344
mov ebx, 0xaabbccdd
xchg eax, ebx
; exit the program gracefully
mov eax, 1
mov ebx, 0
int 0x80
section .data
sample: db 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x11, 0x22