CPE_416 Introduction-to-pic-instr_SET_NEXT_105637
CPE_416 Introduction-to-pic-instr_SET_NEXT_105637
PIC ASSEMBLY
LANGUAGE
Assembler Process
High-level language
6
High-Level Language overcomes the limitation
of writing a program in Machine and Assembly
language as it is difficult and time consuming.
In High-Level Language, the programs can be
written using simple English words. Examples
of High-Level Language are BASIC, Fortran,
COBOL, C, C++.
Programs written in high-level languages are
translated into machine language by a
compiler.
Assembly language
7 syntax
An assembly language program consists of
statements. The syntax of an assembly language
program statement obeys the following rules:
Here NOP
GOTO Here
Instruction format - Opcode
14
This field consists of a symbolic operation
code, known as op-code.
The opcode describes the operation.
58
59
In contrast to the Queue (Q):
onlyone pointer to top element.
PUSH and POP/PULL in different directions.
wrap-around is not needed.
(PUSH)
Direction of
PULL operation 59
QUEUE
59
60
QUEUE
59
61
The two fundamental
60
operations:
1. Push
- push an element on the top
- PUSH should first decrement SP, $00FB
$00FC
then store the data, $00FD
$00FE
- Example:
- Example:
63
Note: [ [ ] ] means the content of location pointed by SP
FIFO
62
FIFO is an acronym for First In, First Out.
This expression describes the principle of a
queue (Q) : what comes in first is handled first,
what comes in next waits until the first is
finished, etc.
It is a very common data structure used for I/O
interfacing
Example :The ASCII codes are PUT in a FIFO
whenever you hit the key. A FIFO is also used
when you ask the computer to print a file.
FIFO Concept
63
FIFO/Queue operation:
Needs two pointers – PUTPT and GETPT
PUTPT and GETPT in same directions.
wrap-around (items go on the rear and come off of
the front of the queue. ) is needed.
References
64
PIC Instruction Set and Some Tips for
Programming,
Dr. Charles J. Kim, Howard University
Microchip PIC16F87X Data Sheet
Getting Started with Development Tools,
Microchip.com
Stack, http://en.wikipedia.org