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

Please do this problem in HLA It is an assembly language problem. Using the ROL

ID: 646468 • Letter: P

Question

Please do this problem in HLA

It is an assembly language problem.

Using the ROL instruction to perform multiplication, write a program to produce a double table. This table should be built from a single int32 value provided by the user and print 3 rows beginning with the starting value. Within that row, the pattern of doubled numbers should be calculated by issuing ROL instructions. For the next row, start it with the first number from the prior row increment by one.

For example, the following output should be produced when the user inputs the starting value 2:

Gimme a starting value: 2
Double Table
2 4 8
3 6 12
4 8 16

NOTE: In order to receive full credit, you must use ROL to solve this problem.
HINT: Don't worry too much about getting all the spacing beautifully correct. I'll be scoring the numbers printed, not the beauty of your table.

Explanation / Answer

.Ltext0: .section .rodata .LC0: 0000 456E7465 .string "Enter a number :" 72202061 206E756D 62657220 3A00 .LC1: 0012 256400 .string "%d" .LC2: 0015 25642009 .string "%d " 2000 .text .globl main main: .LFB0: .cfi_startproc 0000 55 pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 0001 4889E5 movq %rsp, %rbp .cfi_def_cfa_register 6 0004 4883EC10 subq $16, %rsp 0008 B8000000 movl $0, %eax 00 000d E8000000 call clrscr 00 0012 BF000000 movl $.LC0, %edi 00 0017 B8000000 movl $0, %eax 00 001c E8000000 call printf 00 0021 488D45F4 leaq -12(%rbp), %rax 0025 4889C6 movq %rax, %rsi 0028 BF000000 movl $.LC1, %edi 00 002d B8000000 movl $0, %eax 00 0032 E8000000 call __isoc99_scanf 00 0037 8B45F4 movl -12(%rbp), %eax 003a 8945FC movl %eax, -4(%rbp) 003d EB39 jmp .L2 .L5: 003f C745F801 movl $1, -8(%rbp) 000000 0046 EB1C jmp .L3 .L4: 0060 8345F801 addl $1, -8(%rbp) 0048 8B45FC movl -4(%rbp), %eax 004b 0FAF45F8 imull -8(%rbp), %eax 004f 89C6 movl %eax, %esi 0051 BF000000 movl $.LC2, %edi 00 0056 B8000000 movl $0, %eax 00 005b E8000000 call printf 00 .L3: 0074 8345FC01 addl $1, -4(%rbp) 0064 837DF803 cmpl $3, -8(%rbp) 0068 7EDE jle .L4 006a BF0A0000 movl $10, %edi 00 006f E8000000 call putchar 00 .L2: 0078 8B45F4 movl -12(%rbp), %eax 007b 83C002 addl $2, %eax 007e 3B45FC cmpl -4(%rbp), %eax 0081 7DBC jge .L5 0083 B8000000 movl $0, %eax 00 0088 C9 leave .cfi_def_cfa 7, 8 0089 C3 ret .cfi_endproc .LFE0: .Letext0: