RDWORD

Instruction: Read word of main memory.

RDWORD Value, < # > Address


Result: Zero-extended word is stored in Value.

  • Value (d-field) is the register to store the zero-extended word value into.
  • Address (s-field) is a register or a 9-bit literal whose value is the main memory address to read from.

Opcode Table:

–INSTR–  ZCRI –CON–    –DEST–         –SRC–

Z Result

C Result

Result

Clocks

 000001    001i    1111    ddddddddd    sssssssss

Result = 0

Written

8..23

Concise Truth Table:

In

Out

Destination

Source

Z

C

Effects

Destination1

Z2

C

$----_----; -

$----_----; -

-

-

wz wc

31:16 = 0, 15:0 = word value

0

0

1 Destination Out is the zero-extended word value read from main memory and is always generated since including an NR effect would turn RDWORD into a WRWORD instruction.
2 The Z flag is cleared (0) unless Destination Out equals 0.

Explanation

RDWORD syncs to the Hub, reads the word of main memory at Address, zero-extends it, and stores it into the Value register Address can point to any byte within the desired word; the address' lower bit will be cleared to zero resulting in an address pointing to a word boundary.

If the WZ effect is specified, the Z flag will be set (1) if the value read from main memory is zero. The NR effect can not be used with RDWORD as that would change it to a WRWORD instruction.

RDWORD is a hub instruction. Hub instructions require 8 to 23 clock cycles to execute depending on the relation between the cog's hub access window and the instruction's moment of execution. See Hub for more information.

Unless otherwise noted, content on this site is licensed under the
Creative Commons Attribution-ShareAlike 4.0 International License.