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
(1) Create a masm program, LP1A to prompt the user to enter a number between 1 and 9. Write a nested loop to print the numbers as follows:
For e.g. if the user entered 9, then the output would be:
Enter a value for length: 9
123456789
12345678
1234567
123456
12345
1234
123
12
1
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. I'm having trouble figuring out how to flip the numbers. My out put looks like
4321
321
21
1
Include Irvine32.inc
;LP1A Triangle
.386
.model flat,stdcall
.stack 4096
ExitProcess proto,dwExitCode:dword
.data
num dword ?
pnt byte "Enter a number between 1-9: ",0
.code
main proc
call getNum
mov ecx, num
call prtStr1
invoke ExitProcess,0
getNum proc
mov edx, offset pnt
call writeString
call readint
mov num, eax
ret
getNum endp
prtStr1 proc
mov eax, 0
mov eax, ecx
OL:
push ecx
IL:
mov eax, ecx
call writeDec
loop IL
call crlf
pop ecx
loop OL
ret
prtStr1 endp
main ENDP
END main

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!