Question: this is the question.... - Translate the following C program to Pep / 9 assembly language. ( 3 0 % ) #include const int limit
this is the question.... Translate the following C program to Pep assembly language.
#include
const int limit ;
int main
int number;
scanfd &number;
while number limit
number;
printfd number;
return ;
BR main
limit: EQUATE ;constant
num: EQUATE ;local variable #d
;
main: SUBSP i ;push #num
DECI num,s ;scanfd &num
while: LDWA limits ;while
CPBA number limiti ;
BREQ endWh
msg: ASCII "high
x
msg: ASCII "low
x
END"...........still didnt work"; BR main ;ERROR: Missing END sentinel
; limit: EQUATE ; constant
; num: EQUATE ; local variable #d
BR main
limit: EQUATE
num: EQUATE
SUBSP i ; push #num ;WARNING: num not specified in EQUATE
DECI num, s ; scanfd &num
while: LDWA limit s ; load limit into accumulator A
CPBA num, i ; compare num with accumulator B limit
BREQ endWhile ; if equal, branch to endWhile
ADDA i ; increment num
STWA num, s ; store incremented num
LDWA num, s ; load num into accumulator A
LDWA msg i ; load address of space into accumulator A
BR while ; branch to while
endWhile: DECO num,d ; printfd num
msg: ASCII "high x
msg: ASCII "low xwhat ive rn
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
