initial import
[staff/goc4/2018bti7061.git] / asm-5-programming / examples / move / move2.asm
1 ;;; File move.asm
2 ;;; Author: E. Benoist
3 ;;; Date: September 2, 2016
4 ;;; Compile with: make
5 ;;; Execute inside a debugger : ddd move2
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 Snippet: db "This is data"
15 Data2: dq 100
16
17 section .text
18 global _start
19 _start:
20 nop
21 mov ax,067FEh
22 mov bx, ax
23 mov cl,bh
24 mov ch,bl
25
26 ;; Move to and from memory
27 mov rbx, Snippet ;the address of the string in memory
28 mov rcx, 3 ; the offset in the string
29 mov ax, [rbx] ; Move 16 bits
30 mov rax, [rbx+3] ; Move 64 bits
31 mov eax, [rbx+rcx] ; Move 32 bits
32 mov rdx, rbx ; Move 64 bits
33
34
35
36 nop