• Join over 1.2 million students every month
  • Accelerate your learning by 29%
  • Unlimited access from just £6.99 per month

Operation of Assemblers

Extracts from this document...

Introduction

Operation of Assemblers A program written in assembly language is much more readable and understandable than its equivalent in machine code; an assembler is a program which translates assembly language into machine code. The assembler accepts an assembly language program as data, converts mnemonic operation codes (op-codes) to their numeric equivalents, assigns symbolic addresses to memory locations and produces as output the required machine code program. Assembly language is the source program and when translated into machine code it is know as object program. The following programs are written for the BEP/16 programming environment to achieve the following arithmetic operations: a) a + b SWI getInt ; Operating ; system call to ; get a 16 bit ; integer from ; the keyboard. ...read more.

Middle

R3, R1 ; R3 = a SUB R3, R2 ; R3 = a-b MOV R4, R1 ; R4 = a MOV R0, R3 ; Copy amswer to R0 SWI putInt ; Operating system ; call to display the ; 16-bit integer in ; R0 HLT ; Terminate program. c) a x b SWI getInt ; Operating ; system call to ; get a 16 bit ; integer from ; the keyboard. ; Value returned ; in R0 MOV R1, R0 ; Store the first ; value in R1 SWI getInt ; Get second value MOV R2, R0 ; Store in register ; R2 MOV R3, R1 ; R3 = a MUL R3, R2 ; R3 = a x b MOV R4, R1 ; R4 = a MOV R0, R3 ; Copy ...read more.

Conclusion

e) a� + b� SWI getInt ; Operating ; system call to ; get a 16 bit ; integer from ; the keyboard. ; Value returned ; in R0 MOV R1, R0 ; Store the first ; value in R1 SWI getInt ; Get second value MOV R2, R0 ; Store in register ; R2 MOV R3, R1 ; R3 = a ADD R3, R2 ; R3 = a + b MOV R4, R1 ; R4 = a SUB R4, R2 ; R4 = a - b MOV R0, R3 ; Copy amswer to R0 SWI putInt ; Operating system ; call to display the ; 16-bit integer in ; R0 HLT ; Terminate program. ?? ?? ?? ?? Assemblers Tom Hall ...read more.

The above preview is unformatted text

This student written piece of work is one of many that can be found in our AS and A Level Computer Science section.

Found what you're looking for?

  • Start learning 29% faster today
  • 150,000+ documents available
  • Just £6.99 a month

Not the one? Search for your essay title...
  • Join over 1.2 million students every month
  • Accelerate your learning by 29%
  • Unlimited access from just £6.99 per month

See related essaysSee related essays

Related AS and A Level Computer Science essays

  1. Computing Module 3 Writeup

    Then MsgBox ("Postcode has to be entered") Validate = False Exit Function End If End Function For Subject Reference Code, I made sure that the Codes entered are 5 digits and unique by using a combo box to list the available options for the user to select.

  2. Smart Card System

    Smart card has a small yet powerful computer built into it. This computer allows the card to interact with the card reader. Some cards such as the Schlumberger Cryptoflex perform cryptographic functions such as key and certificate verification, encryption, random number generation, etc.

  1. Internal Operations

    A floating point number is one in which the position of the point is determined within the number itself. Working with floating point values, the position of the point in each number must be determined at processing time. This means that these calculations are much slower than fixed point.

  2. The Von Neumann Machine

    In the control bus they are simply grouped together for convenience. Each has a different function and may be used at different times. The purpose of the control lines varies from processor to processor but common processes are: � Read to initiate a memory read operation � Write to initiate

  • Over 160,000 pieces
    of student written work
  • Annotated by
    experienced teachers
  • Ideas and feedback to
    improve your own work