Experiment 1 - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

Experiment 1

Description:

... programmer requires knowledge of the processor architecture and instruction set. ... 2. Choose Execute Keys tab. 11/7/09. yosais. 18. 3. ... – PowerPoint PPT presentation

Number of Views:30
Avg rating:3.0/5.0
Slides: 24
Provided by: yahyae
Category:
Tags: experiment | keys

less

Transcript and Presenter's Notes

Title: Experiment 1


1
Experiment 1
  • COE 205
  • Computer Organization Assembly Language
    Programming
  • Term 032

2
Outline
  • Definition of a program.
  • Instruction atomicity.
  • Stored-program concept.
  • Programming early computers.
  • Assembly language.
  • Tools.
  • Setting up the environment.
  • Policy.

3
Definition of a Program
  • A mix of instructions and data that causes a
    machine to perform one or more operations.
  • An operation has two elements
  • ? Instruction(s)
  • ? Data

4
Instruction Atomicity
  • An instruction is atomic.
  • ? Indivisible
  • ? Non-interruptible operation
  • Hardware ensures the non-interruptible execution
    of an instruction.
  • A complex operation is made of simple
    instructions.
  • ? Multiplication
  • - AND For 2-bit multiplication
  • - Shift
  • - Add

5
Stored-Program Concept
  • Data instructions are stored in the memory.
  • Central Processing Unit (CPU) loads instructions
    from memory one by one.
  • Instructions are executed in sequence.
  • User interacts with the system via Input/Output
    (I/O) devices.

6
Programming Early Computers
  • Computers were programmed by hand.
  • Front panel switches were used to enter
    instructions and data into memory.
  • Each instruction and data element was manually
    converted into bit patterns.
  • ? Bit pattern of an instruction is called a
    Machine Instruction.
  • To enter instruction/data into memory
  • ? Address switches were toggled to the correct
    address.
  • ? Next, data switches were toggled.
  • ? Finally, write switch was toggled to write the
    binary value to the address specified.
  • Once all instructions and data entered, the RUN
    switch was toggled to run the program.

7
Major Drawbacks
  • Dealing directly with instructions, data, and
    addresses in binary format.
  • Manual conversion into bit patterns.
  • ? Slow
  • ? Cumbersome
  • ? Error-prone

8
Major Milestones
  • Monitor programs became popular.
  • ? Allowed entry of instructions and data via hex
    terminals.
  • Paper tapes and punched cards became popular as
    storage methods for programs.
  • To increase programmer productivity, assembler
    (or assembly) language was invented.
  • ? An assembler takes machine instructions in
    human-readable form and translates them into
    binary automatically.

9
Features of Assembly Language
  • Raw binary values were replaced by symbols called
    mnemonics.
  • ? Changes could be made easily and faster.
  • Automatic translation into machine language.
  • One-to-one mapping to machine language.

10
Disadvantages of Assembly Language
  • The programmer requires knowledge of the
    processor architecture and instruction set.
  • Programs are machine dependent (Not Portable),
    requiring complete rewrites if the processor is
    changed.
  • Many instructions are required to achieve small
    tasks (HL vs. LL).
  • Source programs tend to be large and difficult to
    follow.

11
Why know Assembly Language?
We do not have to learn assembly language. It is
enough to learn a high-level language, like C or
Java. We can get by fairly well in todays world
without knowing any assembly language.
12
Reasons for Learning Assembly Programming
  • Knowing an assembly language helps you understand
    what is happening inside a computer.
  • When writing hardware drivers or software for
    embedded systems, you will need to code and debug
    in assembly language.
  • Using assembly language lets you control exactly
    what happens in your program.
  • Assembly programs runs fast and conserves memory.

13
Tools
  • MASM 6.11
  • ? Assembling linking
  • ConTEXT
  • ? Editor
  • Code View
  • ? Debugger
  • XVI32
  • ? Hexadecimal editor

14
Setting Up the EnvironmentStep 1
  • Get the tools and install them on your machine.
  • ? For MASM 6.11 ConTEXT, use the setup files
    and keep the default options.
  • ? For XVI32, copy the application program XVI32
    into your hard disk.
  • ? For Code View, it is part of the MASM 6.11
    package. It is run by entering CV at the command
    prompt.

15
Setting Up the EnvironmentStep 2
  • Create a new directory on your hard disk and call
    it COE 205 Experiments.
  • For every new experiment, you should have a new
    sub-directory in the root directory COE 205
    Experiments.

16
Setting Up the EnvironmentStep 3
  • To be able to open a DOS screen from within
    ConTEXT, do the following
  • 1. From the OPTIONS menu, choose Environment
    Options.

17
2. Choose Execute Keys tab.
18
3. When you press on the Add button, a dialog box
will appear. Enter asm and press OK.
19
4. Choose F9 and type C\WINDOWS\system32\cmd.
exe in the Execute field. 5. Press OK.
Now, whenever you want to open a new DOS screen,
press on the F9 button on the keyboard.
20
PolicyLab Sessions
  • In every session, a programming problem will be
    given at the beginning of the lab.
  • Concepts will be explained while the students are
    working on the problem.
  • How to Prepare
  • Try the sample programs in the lab manual.
  • Study the related material from your class notes
    and textbook.

21
PolicyLate Assignments
  • You are supposed to finish all programming
    assignments in the lab.
  • If you run out of time, you can send your
    assignment to the following email address.
  • coe205_at_bareed.com
  • Deadline is 1 am the next day.
  • You lose THREE points for every late assignment.

22
PolicyAbsence
  • Three unexcused absences lead to a DN grade.
  • Official excuse must be presented to the
    instructor no later than one week following the
    absence.
  • Cheating is not allowed. Severe measures will be
    taken by the instructor.

23
PolicyMark Distribution
  • Lab weighs 20 of your final grade.
  • 10 will be for lab work.
  • 10 will be for the project.
Write a Comment
User Comments (0)
About PowerShow.com