Adjust the given code in pep/9 such that the triangle of stars is shown inverted as shown below: * * * * * * * * * *

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 27SA
icon
Related questions
Question

Adjust the given code in pep/9 such that the triangle of stars is shown inverted as shown below:

* * * *

* * *

* *

*

Source Code-
main
.EQUATE 2
.EQUATE O
BR
j:
k:
; local variable #2d
; local variable #2d
; push #j, #k
4,i
1,i
j,s
j,s
5,i
endforJ
1,i
k,s
j,s
endforK
**',i
charOut,d
k,s
1,i
k,s
forK
'\n',i
charOut,d
j,s
1,i
j,s
forJ
4,i
Stars:
SUBSP
LDWA
STWA
forJ:
LDWA
CPWA
BRGT
LDWA
STWA
forK:
CPWA
BRGT
LDBA
STBA
LDWA
ADDA
STWA
BR
endforK: LDBA
STBA
LDWA
ADDA
STWA
BR
endforJ: ADDSP
RET
;pop #k, #j
CALL
STOP
main:
Stars
.END
43444U.
Transcribed Image Text:Source Code- main .EQUATE 2 .EQUATE O BR j: k: ; local variable #2d ; local variable #2d ; push #j, #k 4,i 1,i j,s j,s 5,i endforJ 1,i k,s j,s endforK **',i charOut,d k,s 1,i k,s forK '\n',i charOut,d j,s 1,i j,s forJ 4,i Stars: SUBSP LDWA STWA forJ: LDWA CPWA BRGT LDWA STWA forK: CPWA BRGT LDBA STBA LDWA ADDA STWA BR endforK: LDBA STBA LDWA ADDA STWA BR endforJ: ADDSP RET ;pop #k, #j CALL STOP main: Stars .END 43444U.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Binary numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning