CSC231 Many Mov Instructions

From dftwiki3
Revision as of 10:31, 19 September 2012 by Thiebaut (talk | contribs)
Jump to: navigation, search

--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 B8[03000000]            		mov	eax, c
    27 00000012 A1[03000000]            		mov	eax, dword[c]
    28 00000017 66A1[01000000]          		mov	ax, word[b]
    29 0000001D A0[00000000]            		mov	al, byte[a]
    30 00000022 8A25[00000000]          		mov	ah, byte[a]
    31                                  
    32 00000028 BB03000000              		mov	ebx, 3
    33 0000002D 66BB0300                		mov	bx, 3
    34 00000031 B303                    		mov	bl, 3
    35 00000033 B703                    		mov	bh, 3
    36                                  
    37 00000035 BB[03000000]            		mov	ebx, c
    38 0000003A 8B1D[03000000]          		mov	ebx, dword[c]
    39 00000040 668B1D[01000000]        		mov	bx, word[b]
    40 00000047 8A1D[00000000]          		mov	bl, byte[a]
    41 0000004D 8A3D[00000000]          		mov	bh, byte[a]
    42                                  	
    43                                  	
    44                                  
    45                                  ;;; put your code here
    46                                  
    47                                  ;;; exit
    48 00000053 BB00000000              		mov	ebx, 0
    49 00000058 B801000000              		mov	eax, 1
    50 0000005D CD80                    		int	0x80
    51                                  
    52