Home > Electronic Tutorials > Microprocessor Systems Tutorial > Instructions and Programs Tutorial

Microprocessor Systems - Electronic Tutorials

Instructions and Programs Tutorial

Instructions are represented by binary numbers called operational codes, or OPCODES. They are frequently written in hexadecimal.

Different CPU's have different instructions. To make them easier to remember they are given names called mnemonics.

Examples are

ADD - add to the contents of the accumulator.
STA - store the contents of the accumulator.
LDA - load into the accumulator.
TAX - transfer the contents of the accumulator to register X.

A program is a list of instructions, usually written using mnemonics. Here is the sequence of events for writing programs.

  1. Define the problem.
  2. Produce an algorithm (a list of instructions, written in everyday language).
  3. Produce a flow chart.
  4. Write the program using mnemonics.
  5. Assemble into hex opcodes. (an assembler is a program which does this).
  6. Test by running the program.
  7. DEBUG IT !!
     

Below is a short program

address

0200
0202
0204

 label

here

operator

LDA
ADC
JMP

operand

FF
01

label



here

opcode

A9   FF
69   01
       4C   00   02

Labels can be used instead of numbers, as a temporary measure, and replaced by the number later.

Note: To report broken links or to submit your projects please send email to Webmaster

Discover

     more......