Question: Assembly Language ( 1 ) Create a masm program, LP 1 A to prompt the user to enter a number between 1 and 9 .
Assembly Language
Create a masm program, LPA to prompt the user to enter a number between and Write a nested loop to print the numbers as follows:
For eg if the user entered then the output would be:
Enter a value for length:
You must create a procedure that prompts the user for input. You must create a procedure to output the numbers as required. How are any arguments passed to the procedures?
This is my work so far. Im having trouble figuring out how to flip the numbers. My out put looks like
Include Irvineinc
;LPA Triangle
model flat,stdcall
stack
ExitProcess proto,dwExitCode:dword
data
num dword
pnt byte "Enter a number between :
code
main proc
call getNum
mov ecx, num
call prtStr
invoke ExitProcess,
getNum proc
mov edx, offset pnt
call writeString
call readint
mov num, eax
ret
getNum endp
prtStr proc
mov eax,
mov eax, ecx
OL:
push ecx
IL:
mov eax, ecx
call writeDec
loop IL
call crlf
pop ecx
loop OL
ret
prtStr endp
main ENDP
END main
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
