Question

(c.) What is an assembler language and what are the advantages of using one in comparison to machine code? (6 marks) (d.)The Little Man model of a computer system uses a single-digit op-code and 2-digit memory addressing and has the following instructions defined where the address portion is shown as Op. Code Description 1xx 2xx Add value in memory to accumulator Subtract value in memo Store accumulator value to memo Load value in memory to accumulator Branch to memory location Branch on positive to memory location Branch on negative to memory location Input from In-tray to accumulator Output to out-tray from accumulator Halt ry from accumulator 5xx 6xx 7xx 8xx 901 902 0xx Write a program using the above machine code to read 2 numbers which are input to the in- basket, and display the difference between them as a positive number in the out-basket. Comment every instruction. (12 marks)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

c) An Assembler language is a low-level programming language for a computer, or other programmable device, in which there is a very strong correspondence between the language and the architecture's machine code instructions. Each assembly language is specific to a particular computer architecture. Assembly language is converted into executable machine code by a utility program referred to as an assembler.

Advantages:

1)Assembly language is more human-readable than machine language

2)Easier to Modify – Assembly language programs are easier for people to modify than machine language programs. This is mainly because they are easier to understand and hence it is easier to locate, correct, and modify instructions, when desired.

3)Easy to Locate and Correct Errors – While writing programs in assembly language, fewer errors are made, and those that are easier to find and correct because on the use of mnemonics and symbolic field names.

d)

00    901          IN                            read 1st number from in basket and store it into calculator

01    310          STO 10                   store content of calculator (1st number) into mailbox 10

02    901          IN                            read 2nd number from in basket and store it into calculator

03    311          STO 11                   store content of calculator (2nd number) into mailbox 11

04    210          SUB 10                   calculator = calculator - number in mailbox 10 (2nd – 1st number)

05    808          BRP 08                   if result is positive, already got the positive difference, so just output

06    510          LDA 10                  load content of mailbox 10 into calculator (1st number)

07    211          SUB 11                   calculator = calculator - number in mailbox 11 (1st – 2nd number)

08    902          OUT                       write content of calculator and put it in the out basket (difference)

09    000          HLT                        end execution

10                    DAT                       mailbox contain data (first number)

11                    DAT                       mailbox contain data (second number)

Add a comment
Know the answer?
Add Answer to:
(c.) What is an assembler language and what are the advantages of using one in comparison...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Note: The question needs to be answered in "C Programming Languange ". And after the question fin...

    Note: The question needs to be answered in "C Programming Languange ". And after the question find 3 pages for needed informations. Spring CE4717 Language Processors Q1. Consider the following LEx program. return R1 return R2 return R3 return R4 return R5; return R6; IA-2a-z)[A-Za-z0-9]- -2 10-91+ 10-9a-EA-FI Ihi] [01] [01] 이삐 t Vtin) int main (void) int tcode; do f tcode -yylex()i printf ("token type td \"%s\"\n", tcode, yytext); ) while (tcode)i return 0; i. Explain the steps needed...

  • Using C programming language Question 1 a) through m) Exercise #1: Write a C program that...

    Using C programming language Question 1 a) through m) Exercise #1: Write a C program that contains the following steps (make sure all variables are int). Read carefully each step as they are not only programming steps but also learning topics that explain how functions in C really work. a. Ask the user for a number between 10 and 99. Write an input validation loop to make sure it is within the prescribed range and ask again if not. b....

  • There is an example below Now that everything is working you can try the following exercises. To complete them you wi...

    There is an example below Now that everything is working you can try the following exercises. To complete them you will need to refer to the documentation in Appendix A The MiteASM Assembler and Appendix B The MiteFPGA Processor. Write an assembly language program for an over counter for a cricket umpire. This should 1. display a count on the 7-segment display. The count should increase by 1 when button 0 is pressed. It should reset to 0 when button...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT