(Solved) : Translate Following C Program Pep 9 Assembly Language Note Jump Table Must Exactly Four En Q42734775 . . .

Translate the following Cprogram to Pep/9 assembly language.

Note: Your jump tablemust have exactly fourentries, but your program musthave only three case symbols and threecases.

xid-8343066_1

example:

main()

guess: .EQUATE 0 ;local variable #2d

main: SUBSP 2,i ;push #guess

   STRO msgIn,d ;printf(“Pick a number 0..3: “)

   DECI guess,s ;scanf(“%d”, &guess)

   LDWX guess,s ;switch (guess)

   ASLX ;two bytes per address

   BR guessJT,x

   STRO msg, d ;printf(“n”)

guessJT: .ADDRSS case0

   .ADDRSS case1

   .ADDRSS case2

   .ADDRSS case3

case0: STRO msg0,d ;printf(“Too lown”)

   BR endCase ;break

case1: STRO msg0,d ;printf(“Too lown)

   BR endCase ;break

case2: STRO msg1,d ;printf(“Right onn”)

   BR endCase ;break

case3: STRO msg2,d ;printf(“Too highn”)

endCase: ADDSP 2,i ;pop #guess

   STOP

msgIn: .ASCII “Pick a number 0..3: x00”

msg0: .ASCII “Too lownx00“

msg1: .ASCII “Right onnx00”

msg2: .ASCII “Too highnx00”

msg: .ASCII “n”

   .END

how to remove extra case?

Expert Answer


Answer to Translate the following C program to Pep/9 assembly language. Note: Your jump table must have exactly four entries, but …

Leave a Comment

About

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us