9.2.2
Examples of Access to
DW > 255
Example 1:
The content of data word DW 300 in DB 100 is read and transferred to flag
word FW 100 (by changing the STEP 5 operation shown in bold face, it can
also be used to read other data blocks (DB or DX)).
FB 5
SEGMENT 1
0000
Reading out DW 300 from DB 100
NAME :LIR DW
0005
:L
DH
000E EC00
Start addr. of the DB list
0008
:L
KF
+100
plus the DB number
000A
:+D
= Address list entry of DB 100
000B
:
(Bits 4 to 19)
000C
:LIR
1
Start addr. DB 100 to ACCU 1
000D
:SLD
4
Convert addr. to physical addr.
000E
:L
KF
+300
DW 300 is read out
0010
:+D
Addr. = start addr. of DB + DW addr.
0011
:LIR
1
Store content of DW 300 to ACCU 1
0012
:T
FW 100
in FW 100
0013
:BE
Example 2:
All the data words of a data block will have a constant written to them.
The program shown below writes the constant KH = A5A5 to all data words of
DB 100. After changing the STEP 5 operations shown in bold face, it can
also be used to write values to other data blocks (DB or DX). Non-existent
data blocks are detected and cause a jump to the NIVO marker.
The program uses three accumulators. Within the loop, the accumulator
contents do not change.
ACCU 1 initially contains the address of the first data word and is
incremented by one each time the loop is run through.
ACCU 2 contains the address of the last data word + 1. The loop is
terminated as soon as the content of ACCU 1 is the same as the content of
ACCU 2.
To write the data words, the operation TIR 10 is used which stores the
content of ACCU-3-L (the constant) at the address contained in ACCU 1.
ACCU contents within the loop:
ACCU 1:
address of the
current
data word to be written to
ACCU 2:
address of the
last
data word to be written to
+ 1
ACCU 3:
constant
Continued on the next page
Memory Access via Address in ACCU 1
CPU 948 Programming Guide
C79000-G8576-C848-04
9 - 15
Summary of Contents for CPU 948
Page 10: ...Contents CPU 948 Programming Guide 1 2 C79000 G8576 C848 04 ...
Page 32: ...Contents CPU 948 Programming Guide 2 2 C79000 G8576 C848 04 ...
Page 72: ...Data Blocks CPU 948 Programming Guide 2 42 C79000 G8576 C848 04 ...
Page 74: ...Contents CPU 948 Programming Guide 3 2 C79000 G8576 C848 04 ...
Page 154: ...Contents CPU 948 Programming Guide 4 2 C79000 G8576 C848 04 ...
Page 200: ...Contents CPU 948 Programming Guide 5 2 C79000 G8576 C848 04 ...
Page 308: ...Contents CPU 948 Programming Guide 7 2 C79000 G8576 C848 04 ...
Page 324: ...Examples of Parameter Assignment CPU 948 Programming Guide 7 18 C79000 G8576 C848 04 ...
Page 326: ...Contents CPU 948 Programming Guide 8 2 C79000 G8576 C848 04 ...
Page 370: ...Addressable System Data Area CPU 948 Programming Guide 8 46 C79000 G8576 C848 04 ...
Page 372: ...Contents CPU 948 Programming Guide 9 2 C79000 G8576 C848 04 ...
Page 486: ...Contents CPU 948 Programming Guide 11 2 C79000 G8576 C848 04 ...
Page 522: ...PG Functions via the S5 Bus CPU 948 Programming Guide 11 38 C79000 G8576 C848 04 ...
Page 524: ...Contents CPU 948 Programming Guide 12 2 C79000 G8576 C848 04 ...
Page 538: ...Contents CPU 948 Programming Guide 13 2 C79000 G8576 C848 04 ...
Page 546: ...List of Key Words CPU 948 Programming Guide Index 6 C79000 G8576 C848 04 ...