Chapter 3
Assembly Language Fundamentals
Assembly Language Programming Exercise
Problem # 2:
Write a program that defines symbolic constants for all seven days of the week. Create an array variable that uses the symbols as initializers.
Solution:
.386
.model flat,stdcall
.stack 4096
ExitProcess PROTO, dwExitCode:DWORD
SUN = 0
MON = 1
TUE = 2
WED = 3
THU = 4
FRI = 5
SAT = 6
.data
daysArray BYTE SUN,MON,TUE,WED,THU,FRI,SAT
.code
main PROC
INVOKE ExitProcess,0
main ENDP
END main
.model flat,stdcall
.stack 4096
ExitProcess PROTO, dwExitCode:DWORD
SUN = 0
MON = 1
TUE = 2
WED = 3
THU = 4
FRI = 5
SAT = 6
.data
daysArray BYTE SUN,MON,TUE,WED,THU,FRI,SAT
.code
main PROC
INVOKE ExitProcess,0
main ENDP
END main
Let me know in the comment section if you have any question.
Previous Post:
Program for Integer Expression Calculation in Assembly Language using Visual Studio
Previous Post:
Program for Integer Expression Calculation in Assembly Language using Visual Studio