6. Program to AddVariables Program in Assembly Language using Visual Studio

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