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

Please Write the code using Assembly Language in Easy68k, NOT C++ Write a progra

ID: 3858450 • Letter: P

Question

Please Write the code using Assembly Language in Easy68k, NOT C++

Write a program in Easy68K to fulfill the following functions:

Repeat the following steps 10 times using a loop Read a number from the input.

Add the number to the accumulator (Hint: the initial value for the accumulator should be 0).

Show the accumulator value (i.e. total sum) in the output.

The output cab be like this:

Please input a number: 7

Please input a number: 3

Please input a number: 2

Please input a number: 0

Please input a number: 1

Please input a number: 2

Please input a number: 5

Please input a number: 4

Please input a number: 6

Please input a number: 8

Total sum is: 38

Thank You :)

Explanation / Answer

.file 1 "" .section .mdebug.abi32 .previous .nan legacy .module fp=32 .module nooddspreg .abicalls .section .rodata.str1.4,"aMS",@progbits,1 .align 2 $LC0: .ascii "Please input a number: " .align 2 $LC1: .ascii "%d" .align 2 $LC2: .ascii "Total sum is:%d" .align 2 $LC3: .ascii "Thank You :)" .section .text.startup,"ax",@progbits .align 2 .globl main .set nomips16 .set nomicromips .ent main .type main, @function main: .frame $sp,56,$31 # vars= 8, regs= 6/0, args= 16, gp= 8 .mask 0x801f0000,-4 .fmask 0x00000000,0 .set noreorder .cpload $25 .set nomacro addiu $sp,$sp,-56 sw $19,44($sp) sw $18,40($sp) lw $19,%got($LC0)($28) lw $18,%got($LC1)($28) movz $31,$31,$0 sw $20,48($sp) sw $17,36($sp) sw $16,32($sp) .cprestore 16 sw $31,52($sp) li $17,10 # 0xa move $16,$0 addiu $19,$19,%lo($LC0) addiu $20,$sp,24 addiu $18,$18,%lo($LC1) $L2: lw $25,%call16(__printf_chk)($28) move $5,$19 .reloc 1f,R_MIPS_JALR,__printf_chk 1: jalr $25 li $4,1 # 0x1 lw $28,16($sp) move $5,$20 lw $25,%call16(__isoc99_scanf)($28) nop .reloc 1f,R_MIPS_JALR,__isoc99_scanf 1: jalr $25 move $4,$18 lw $28,16($sp) li $4,10 # 0xa lw $25,%call16(putchar)($28) nop .reloc 1f,R_MIPS_JALR,putchar 1: jalr $25 addiu $17,$17,-1 lw $2,24($sp) lw $28,16($sp) bne $17,$0,$L2 addu $16,$16,$2 lw $5,%got($LC2)($28) lw $25,%call16(__printf_chk)($28) move $6,$16 addiu $5,$5,%lo($LC2) .reloc 1f,R_MIPS_JALR,__printf_chk 1: jalr $25 li $4,1 # 0x1 lw $28,16($sp) nop lw $25,%call16(putchar)($28) nop .reloc 1f,R_MIPS_JALR,putchar 1: jalr $25 li $4,10 # 0xa lw $28,16($sp) li $4,1 # 0x1 lw $5,%got($LC3)($28) lw $25,%call16(__printf_chk)($28) nop .reloc 1f,R_MIPS_JALR,__printf_chk 1: jalr $25 addiu $5,$5,%lo($LC3) lw $31,52($sp) lw $20,48($sp) lw $19,44($sp) lw $18,40($sp) lw $17,36($sp) lw $16,32($sp) move $2,$0 j $31 addiu $sp,$sp,56 .set macro .set reorder .end main .size main, .-main .ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609"

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