Docsity

Programming: Steps & Tools for Microprocessor Instruction Writing, Lecture notes of Microprocessors

Partial preview of the text

Download Programming: Steps & Tools for Microprocessor Instruction Writing and more Lecture notes Microprocessors in PDF only on Docsity!

PROGRAMMING

■ A program is a set of instructions in the specific

sequence to do a specific task.

■ Tells the Microprocessor what it has to do.

■ The process of writing the set of instructions telling

the microprocessor what to do is called

programming.

■ Programming is the process of telling the processor

exactly how to solve a problem

ALP:

■ FLOW CHART ■ (^) To develop the programming logic the programmer has to write down various actions which are to be performed in a proper sequence. ■ The flow chart is a graphical tool that allows the programmer to present various actions which are to be performed. ■ (^) Very useful for clear understanding of the programming logic ALP ctd…:

■ (^) Sample flow chart ALP ctd…:

■ (^) Example format; Assembly language

■ (^) Optimum solution – a number of solutions can be available for solving a specific problem, programmer has to choose the optimum solution. Optimum solution takes minimum memory space, minimum time for execution. ■ (^) Use of proper instructions – there can be more than one set of instructions available to solve a specific problem. Check the space and time for all options ■ Use of proper addressing modes – evaluate different ways a processor can access data. Compare the various addressing modes in terms of time. ■ (^) Prepare documentation – programmer must provide enough information so that others can utilize the program module without having to examine its internal structure. ALP Tips:

Programming with an Assembler:

■ Steps involved in developing and executing ALP

Steps involved in developing and executing ALP

■ First step is writing an ALP in a text editor eg edit, notepad

■ The ALP is input into an assembler

■ The assembler translates the assembly language statements

into their binary equivalents, usually known as object code.

■ During this time assembler checks for errors and displays

them.

■ The object code module contains the information about where

the program or module to be loaded is in memory and

additional linkage information.

■ At link time, separately assembled modules are combined into

one single load module, by the linker.

■ At load time, the program loader copies the program into the

computer’s main memory, and at execution time the, program

Structure of Program 1:

16 BIT ADDITION

EXAMPLE: MULTIPLICATION PROGRAM

DATA TRANSFER USING DIFFERENT MODES Break ...