Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assembly Language Programming PROGRAM 3: Box It! Write an HLA Assembly language

ID: 3911444 • Letter: A

Question

Assembly Language Programming

PROGRAM 3: Box It!
Write an HLA Assembly language program that prompts for a specific int8 value named n and then displays a repeated digit pattern starting with that number. The repeated digit pattern should show all the numbers from 1 up to that number, each on its own row. There should be a total of n 1's on the first row. Then there should be a total of n 2's on the second row and so on all the way up to n. Shown below is a sample program dialogue.

Gimme a decimal value to use as n: 6
111111
222222
333333
444444
555555
666666

Gimme a decimal value to use as n: 4
1111
2222
3333
4444

Explanation / Answer

program myprogram;
#include( "stdlib.hhf" );
#include( "stdio.hhf");
var
n:int8;
i:int8;
j:int8;
begin myprogram;
stdout.put( "Enter a Number: " );
stdin.geti8();
mov(al,n);
mov(n,DH);
for(mov(1,i);i<=DH;add(1,i))
do
stdout.newln();
for(mov(1,j);j<=DH;add(1,j))
do
stdout.put(i);
endfor;
endfor;
end myprogram;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote