Question: 3) Write a program that repeatedly prompts for and reads in decimal numbers until a negative number is entered, at which point your program should

 3) Write a program that repeatedly prompts for and reads in
decimal numbers until a negative number is entered, at which point your

3) Write a program that repeatedly prompts for and reads in decimal numbers until a negative number is entered, at which point your program should display the sum of all the numbers previously entered. Test your program by entering 1, 2, 3, -1 (the sum displayed should be 6). 42Writeranroqram that promote for android 18 Chapter 3: Ambly Lopage Basic Instruction Set Summary Opcode Format Description ld st X add sub Idr X str X addr subr X ldi X asp S call ret br brn brz trapy 1 2 3 4 5 6 7 8 9 A B c D E F ac - mem[x]; mem[x] = ac; ac = ac + mem[x]; ac = ac- mem[]; ac = mem[sp + x); mem[sp + x] = ac; ac = ac + mem[sp + x]; - mem[sp + x]; ac = X 5p = sp + S; mem[ --sp] pc; pc = x; PC = mem[5p++]; pc = x; if (ac -- 0) pc = x; if (acce) pc = x; see below Push operation X X X Pop operation halt or trap nl or trap 1 dout or trap 2 udout or trap 3 hout or trap 4 aout or traps sout or trap 6 din O trap 7 hin or trap 8 ain or trap 9 sin or trap le bp or trap 14 Terminate program Output nl character Output number in ac as signed decimal Output number in ac as unsigned decimal Output number in ac in hex Output character in ac Output string pointed to by ac Input decimal number into ac Output hex number into a Input character into ac Input string to address in ac Breakpoint X bits. 0 to 1 in machine struction eresende ut bits s: bits 0 to Il in maching instruction in extended to 16 bits y bils Old in maling instruction atended to 16 bits ac accumulator sister pcHot Counter SC Spack pointer tester Directives blw fill startstrings

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 Databases Questions!