Question: Create an HLA Assembly language program that prompts for a single integer value from the user and prints an arrow pattern like the one shown

Create an HLA Assembly language program that prompts for a single integer value from theuser and prints an arrow pattern like the one shown below. If the number is negative, don't print anything at all.
Here are some example program dialogues to guide your efforts:
Feed Me:3
X
XX
XXX
XX
X
Feed Me:-6
Feed Me:5
X
XX
XXX
XXXX
XXXXX
XXXX
XXX
XX
X
In an effort to help you focus on building an Assembly program, Id like to offer you the followingC statements matches the program specifications stated above. If you like, use them as the basis forbuilding your Assembly program.
SAMPLE C CODE:
------------------------
int i, j, n;
printf( "Feed Me:");
scanf("%d", &n );
// the top half of the arrow...
for( i =1; i = n; i++){
for (j =1; j = i; j++){
printf("X");
}
printf("
");
}
// the bottom half of the arrow...
for (i = n -1; i >=1; i--){
for (j =1; j = i; j++){
printf("X");
}
printf("
");
}
program progID; #include( "stdlib.hhf");
static
variable declarations
begin progID;
statements
end progID;
Assembly Language Instructions
\begin{tabular}{|c|c|c|}
\hline Instruction & Syntax & Description \\
\hline MOV & mov ( source, dest ); & dest = source; \\
\hline ADD & add ( source, dest ); & dest += source; \\
\hline SUB & sub( source, dest ); & dest -= source; \\
\hline SHL & shl( count, dest ); & shuffles left a total of count bits in dest operand; sets carry when count=1\\
\hline SHR & shr( count, dest ); & shuffles right a total of count bits in dest operand; sets carry when count=1\\
\hline SAR & sar( count, dest ); & shuffles right a total of count bits in dest operand; sets carry when count=1; leaves H.O. bit unchanged \\
\hline ROL & rol ( count, dest ); & rotates left a total of count bits in dest operand; sets carry when count=1\\
\hline ROR & ror( count, dest ); & rotates right a total of count bits in dest operand; sets carry when count=1\\
\hline NOT & not( dest ); & inverts the bits of the dest operand \\
\hline AND & and( source, dest ); & bitwise logical AND; result placed in dest operand \\
\hline OR & or( source, dest ); & bitwise inclusive OR; result placed in dest operand \\
\hline XOR & xor( source, dest ); & bitwise exclusive OR; result placed in dest operand \\
\hline LAHF & lahf(); & pushes the lower 8 bits of EFLAGS register into AH \\
\hline INC & inc( operand ); & operand = operand +1; \\
\hline DEC & dec ( operand ); & operand = operand -1; \\
\hline CMP & cmp( lhs, rhs ); & sets EFLAGS as if lhs-rhs was performed; does not change the value of either operand \\
\hline TEST & test( operand1, operand2); & sets EFLAGS as if AND( operand1, operand2) was performed; does not change the value of either operand \\
\hline NEG & & neg ( dest ); \\
\hline JMP & ```
jmp label;
jmp(32bit_register);
jmp( dword );
``` & unconditional transfer of control. Note the inconsistent use of parentheses. \\
\hline SETcc & setcc(8bit_operand); & reads an EFLAG bit into a byte operand. Mnemonics listed below. \\
\hline
\end{tabular}
Available Datatypes
int8
int16
int32
uns 8
uns16
uns 32
boolean
Available I/O
Routines
stdout.put
stdout.puti8
stdout.puti16
stdout.puti32
stdout.putb
stdout.putw
stdout.putd
stdout.putuns8
stdout.putuns16
stdout.putuns32
stdout.newln \begin{tabular}{||l|l|l|}
\hline JMP & \begin{tabular}{l}
jmp label; \\
jmp (32bit_register); \\
jmp( dword);
\end{tabular} & \begin{tabular}{l}
unconditional transfer of control. Note the \\
inconsistent use of parentheses.
\end{tabular}\\
\hline SETcC & setcc(8bit_operand); & \begin{tabular}{l}
reads an EFLAG bit into a byte operand. \\
Mnemonics listed below.
\end{tabular}\\
\hline \hline JCc & jcc label; & \begin{tabular}{l}
transfers control to label when condition is \\
met. Mnemonics listed below.
\end{tabular}\\
\hline \hline
\end{tabular}
\begin{tabular}{|c|c|c|}
\hline \multicolumn{3}{|c|}{Mnemonics For SETcc and Jcc Instructions}\\
\hline Abbreviation & Meaning & Example \\
\hline C & Set if Carry =1 & SETC \\
\hline NC & Set if Carry \(=0\) & SETNC \\
\hline Z & Set if Zero =1 & SETZ \\
\hline NZ & Set if Zero =0 & SETNZ \\
\hline S & Set if Sign =1 & SETS \\
\hline NS & Set if Sign =0 & SETNS \\
\hline 0 & Set if Overflow \(=1\) & SETO \\
\hline NO & Set if Overflow =0 & SETNO \\
\hline E & Set if Equal & SETE \\
\hline NE & Set if Not Equal & SETNE \\
\hline NA & Set if not > & SETNA \\
\hline BE & Set if = & SETBE \\
\hline NAE & Set if not >= & SETNAE \\
\hline B & Set if & SETB \\
\hline NB & Set if not & SETNB \\
\hline NBE & Set if not = & SETNBE \\
\hline A & Set if > & SETA \\
\hline AE & Set if >= & SETAE \\
\hline G & Set if greater than & SETG \\
\hline NLE & Set if not less than or equal & SETNLE \\
\hline GE & Set if greater than or equal & SETGE \\
\hline NL & Set if not less than & SETNE \\
\hline L & Set if less than & SETL \\
\hline NGE & Set if not greater than or equal & SETNGE \\
\hline LE & Set if less than or equal & SETLE \\
\hline NG & Set if not greater than & SETNG \\
\hline
\end{tabular}
stdout.putuns8
stdout.putuns16
stdout.putuns32
stdout.newln
stdin.get
stdin.geti8
stdin.geti16
stdin.geti32
stdin.getuns8
stdin.getuns16
stdin.getuns 32
stdin.getb
stdi n.getw
stdin.getd
Snipping Tool
Screenshot copied to clipboard and save
Sele
Create an HLA Assembly language program that

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!