Chapter 3
Assembly Language Fundamentals
Assembly Language Programming Exercise
Problem # 6:
Modify the AddVariables program so it uses 64-bit variables.
Solution:
ExitProcess PROTO
.data
firstval DWORD 2000200020002000h
secondval DWORD 1111111111111111h
thirdval DWORD 2222222222222222h
sum DWORD 0
.code
main PROC
mov rax, firstval
add rax, secondval
add rax, thirdval
mov sum, rax
call ExitProcess
main ENDP
END
.data
firstval DWORD 2000200020002000h
secondval DWORD 1111111111111111h
thirdval DWORD 2222222222222222h
sum DWORD 0
.code
main PROC
mov rax, firstval
add rax, secondval
add rax, thirdval
mov sum, rax
call ExitProcess
main ENDP
END
Let me know in the comment section if you have any question.
Previous Post:
Program for Symbolic Text Constants in Assembly Language using Visual Studio
Previous Post:
Program for Symbolic Text Constants in Assembly Language using Visual Studio