initial import
[staff/goc4/2018bti7061.git] / asm-5-programming / examples / move / move.asm
1 ;;; File move.asm
2 ;;; Author: E. Benoist
3 ;;; Date: August 31, 2016
4 ;;; Compile with: make
5 ;;; Execute inside a debugger : ddd move
6
7 ;;; This program contains examples for the MOV instruction.
8 ;;; You can see in a debugger what happens inside the registers.
9 ;;; It does not terminate properly
10 ;;; Neither does it do anything,
11 ;;; It is used to test functions in the debugger.
12
13 section .data
14
15 section .text
16 global _start
17 _start:
18 nop
19 mov RAX,42 ; Copy the value 42 inside RAX (64-bit register)
20 mov RBX, 'Hello' ; Copy a string inside a register (totaly odd)
21 mov RCX, 0A89h ; Copy a number inside RCX
22
23 mov EBP, ESI ; Copy the 32.bit register esi inside register ebp
24 mov BL, CH ; Copy 8 bits (from high C to low B
25
26 add DX, AX
27 add ECX, EDX
28
29 nop