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

#include <iostream> using namespace std; const int limit = 5; int main(){ int nu

ID: 656408 • Letter: #

Question

#include <iostream>
using namespace std;
const int limit = 5;
int main(){
     int number;
     cin >> number;
     while (number < limit) {
          number++;
          cout << number << ' ';
     }
     return 0;
}

fill in the missing items in the assembly language version:
Options: i,s,d, .BLOCK, .EQUATE, ADDSP, SUBSP CPA, CPX, while, endWh

0000 040003 BR main

limit: ____5 ;constant

number: ___0 ;local variable #2d

;

0003 680002 main:____2,i ;allocate #number

0006 330000 DECI number,s ;cin >> number

0009 C30000 while: LDA number,s ;while (number < limit)

000C B00005 ______ limit,i

000F 0E0024 BRGE___

0012 700001 ADDA 1,___ ; number++

0015 E30000 STA number,s

0018 3B0000 DECO number,s ; cout << number

001B 500020 CHARO ' ',___ ; << ' '

001E 040009 BR ___

0021 600002 ___ 2,i ;deallocate #number

0024 00 endWh: STOP

0025 .END

Explanation / Answer

0000 040003 BR main

limit: __Addsp__5 ;constant

number: _Equate__0 ;local variable #2d

;

0003 680002 main:_Block___2,i ;allocate #number

0006 330000 DECI number,s ;cin >> number

0009 C30000 while: LDA number,s ;while (number < limit)

000C B00005 ______ limit,i

000F 0E0024 BRGE___

0012 700001 ADDA 1,__CPA_ ; number++

0015 E30000 STA number,s

0018 3B0000 DECO number,s ; cout << number

001B 500020 CHARO ' ',___ ; << ' '

001E 040009 BR ___

0021 600002 ___ 2,i ;deallocate #number

0024 00 endWh: STOP

0025 .END