CSC231 Many Mov Instructions
--D. Thiebaut 10:29, 19 September 2012 (EDT)
1 ;;; manyMoves.asm
2 ;;; D. Thiebaut
3 ;;;
4 ;;;
5 ;;;
6 ;;; To assemble, link, and run:
7 ;;; nasm -f elf -F stabs manyMoves.asm
8 ;;; ld -melf_i386 -o manyMoves manyMoves.o
9 ;;; ./manyMoves
10 ;;;
11
12 section .data
13 00000000 00 a db 0
14 00000001 0000 b dw 0
15 00000003 00000000 c dd 0
16
17
18 section .text
19 global _start
20 _start:
21 00000000 B803000000 mov eax, 3
22 00000005 66B80300 mov ax, 3
23 00000009 B003 mov al, 3
24 0000000B B403 mov ah, 3
25
26 0000000D A1[03000000] mov eax, dword[c]
27 00000012 66A1[01000000] mov ax, word[b]
28 00000018 A0[00000000] mov al, byte[a]
29 0000001D 8A25[00000000] mov ah, byte[a]
30
31 00000023 BB03000000 mov ebx, 3
32 00000028 66BB0300 mov bx, 3
33 0000002C B303 mov bl, 3
34 0000002E B703 mov bh, 3
35
36 00000030 8B1D[03000000] mov ebx, dword[c]
37 00000036 668B1D[01000000] mov bx, word[b]
38 0000003D 8A1D[00000000] mov bl, byte[a]
39 00000043 8A3D[00000000] mov bh, byte[a]
40
41
42
43 ;;; put your code here
44
45 ;;; exit
46 00000049 BB00000000 mov ebx, 0
47 0000004E B801000000 mov eax, 1
48 00000053 CD80 int 0x80