1) How To Use Symbolic Constants In An Array

Name 7 symbolic constants the 7 days of the week.  Then place them into a DWORD array.

.386
.model flat,stdcall
.stack 4096
ExitProcess PROTO, dwExitCode:DWORD

.data
mon = 1				;symbolic constants
tue = 2
wed = 3
thurs = 4
fri = 5
sat = 6
sun = 7
;puting symbolic constants in an array of DWORDS
week DWORD mon,tue,wed,thurs,fri,sat,sun		;DWORD = 4 Bytes										
week2 WORD mon,tue,wed,thurs,fri,sat,sun		;WORD = 2 Bytes
week3 BYTE mon,tue,wed,thurs,fri,sat,sun		;BYTE = 1 Byte

.code
main PROC

	;week 1
	;in order to reach the next element of the array
	;we must inciment by 4 because it is a DWORD array 
	;32 bit registers should be used
	mov eax, week							 	  ;eax = 1
	mov ebx, week+4								;eax = 2
	mov ecx, week+8								;eax = 3
	mov edx, week+12							;eax = 4

	;week2
	;in order to reach the next element of the array
	;we must inciment by 2 because it is a WORD array
	;16 bit registers should be used
	mov ax, week2						 		  ;ax = 1
	mov bx, week2+2								;bx = 2
	mov cx, week2+4								;cx = 3
	mov dx, week2+6								;dx = 4

	;week3
	;in order to reach the next element of the array
	;we must inciment by 1 because it is a BYTE array'
	;8 bit registers should be used
	mov al, week3						 		  ;al = 1
	mov bl, week3+1								;bl = 2
	mov cl, week3+2								;cl = 3
	mov dl, week3+3								;dl = 4

INVOKE ExitProcess,0
main ENDP

END main

Show Code