Question: Why is MASM printing this in reverse order? . data ; ( insert variable definitions here ) intro _ 1 BYTE Welcome to Chaotic Temperature

Why is MASM printing this in reverse order?
.data
; (insert variable definitions here)
intro_1 BYTE "Welcome to Chaotic Temperature Statistics - Programmed by Nicole",13,10,0
intro_2 BYTE "This program generates a series of temperature readings, X per day for Y days,",13,10,0
intro_3 BYTE "depending on constants, and performs some basic statistics on them: daily high and low",13,10,0
intro_4 BYTE "and average high and low temps. It then prints these results, with descriptive titles.",13,10,13,10,0
.code
main PROC
PUSH OFFSET intro_1
PUSH OFFSET intro_2 ;greeting and explanation
PUSH OFFSET intro_3
PUSH OFFSET intro_4
call printGreeting
call generateTemperatures
call findDailyHighs
call findDailyLows
call calcAverageLowHighTemps
call displayTempArray
call displayTempWithString
Invoke ExitProcess,0
main ENDP
;------------------------------------------------------------------------------------------------------------------
;Name: printGreeting
;Procedure to introduce the program & programmer
;preconditions: intros are described
;postconditions: EDX changed
;receives:
;returns:
;------------------------------------------------------------------------------------------------------------------
printGreeting PROC ;introduce programmer
PUSH EBP
MOV EBP, ESP
; [EBP+20]= address of OFFSET intro_4
; [EBP+16]= address of OFFSET intro_3
; [EBP+12]= address of OFFSET intro_2
; [EBP+8]= address of OFFSET intro_1
; [EBP+4]= return address
; [EBP]= old ebp
MOV EDX, [EBP +8]
CALL WriteString
MOV EDX, [EBP +12]
CALL WriteString
MOV EDX, [EBP +16]
CALL WriteString
MOV EDX, [EBP +20]
CALL WriteString
POP EBP
RET 16
printGreeting ENDP

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!