You are on page 1of 10

CHAPTER 5

Addressing and Instructions


(Continue)
Dr. Bashir NOURI
Department of Mechatronics Engineering
Faculty of Engineering
An-Najah National University

1
Outline:
 Introduction
 Counter Addressing.
 Timer Addressing.
 Integer Elements Addressing.
 Floating Point Element Addressing.
 String File Elements Addressing.
 User Defined Files.

2
Introduction:

Elements for timers, counters, control, and ASCII files

consist of three consecutive words.

3
Counter Addressing Example:
File Type Element Delimiter

C5:0
Element
File Number
(Counter Number)

Counters occupy three words of memory.


15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Element
0 C5:0
PRE / LEN 1 C5:0.PRE
ACC / POS 2 C5:0.ACC

4
Timer Addressing Example:
File Type Element Delimiter

T4:7.Acc
File Number Word
Element Word Delimiter
( Timer Number)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Element
EN TT DN Internal Use 0 T4:7
Preset Value PRE 1 T4:7.PRE
Accumulated Value ACC 2 T4:7.ACC

EN ≡ Timer Enable Bit


TT ≡ Timer Timing Bit
DN ≡ Timer Done Bit
5
Integer Elements Addressing Examples:

File Type Element Delimiter

N7:12
File Number Element
(Word Number)

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Element
N:10

6
Floating-Point Element Addressing
Floating-point files have two-word elements (Two words
are used to hold the floating-point number).
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Element
F8:0

F ≡ Stands for Floating Point.


8 ≡ File number.
: ≡ Element delimiter.
0 ≡ (Floating-point number 0 (First two words in File 8).

7
String-File Elements Addressing
String files have 42-word elements.
The decimal point delimiter is used to specify the
particular word in the string file.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Element
STf:0.LEN
STf:0.1

STf:0.2

STf:0.40
STf:0.41

8
User – Defined Files
User-Defined Files
File Type Identifiers File Number
Bit B
Timer T
Counter C 9 - 255
Control R
Integer N
Float F
String St
ASCII A

A whole file must have the same use . For example: If you want to use
file 10 for additional integers, file 10 can be used only for integers.
9
10

You might also like