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

(c.) What is an assembler language and what are the advantages of using one in c

ID: 3604433 • Letter: #

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)

Explanation / Answer

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)