Professional Documents
Culture Documents
Quiz 1: - Semester 2/11/12
Quiz 1: - Semester 2/11/12
- Semester 2/11/12
Quiz 1
Identify the basic element of assembly language in the Addsub.asm and Addsub2.asm
program.
TITLE Add and Subtract
(AddSub.asm)
; ThisBasic
program
adds and of
subtracts
32-bit integers.
Element
Assembly
Language
; Last update: 06/01/2006
Identifier
(AddSub2.asm)
; This program
adds and
subtracts 32-bit
integers
Examples
in Addsub
andAddSub2
; and stores the sum in a variable.
Val1, 06/01/2006
val2, val3, finalVal, main
; Last update:
INCLUDE Irvine32.inc
Reserved
.code
main PROC
mov
add
sub
call
exit
main ENDP
END main
INCLUDE Irvine32.inc
words
eax,10000h
eax,40000h
eax,20000h
DumpRegs
; EAX = 10000h
; EAX = 50000h
; EAX = 30000h
Mnemonics instruction
Directives
Operands
Registers
Comment
.data
val1
dword 10000h
Irvine32.inc,
main ENDP, END
val2 dword 40000h
val3
call,dword
sub, 20000h
eax, DumpRegs, exit
finalVal dword ?
.code
main PROC
mov,
mov
add
eax,val2
; add 40000h
dword,
.data,
.code
sub
mov
call=,
eax,
eaxexit
main ENDP
END main
1/mdm rozi
1 mark each
2/mdm rozi