Please read this page from the main YASEP interface
version 2012-09-30

EZB : Extract and Zero-extend Byte

This instruction selects one of the bytes of the source register and puts it in the lower byte of the destination register. The byte is considered unsigned: the higher bytes of the destination register are cleared. It is an equivalent to the SHR instruction that works on bytes, not bits.

For the YASEP16, the instruction selects on byte out of two, while the YASEP32 selects one byte out of four, like on the following diagram:

This instruction is designed to load an unsigned byte from memory so it performs aligment and zero-filling in a single cycle. However, the memory is accessed through the D registers, one word at a time, this instruction only performs byte-related adjustments of the word.

Usually, the bytes come from a D register, (containing data read from memory) and the offset of the byte is held in a A register (the address register) but any other register can be used. The offset can also be given with an immediate value (Imm4 or Imm16) hence it is written first.

; Load the byte located at address 123h into register R1:
MOV 123h A1
ESB A1 D1 R1

• The instruction ESB is similar but works with signed bytes and extends the result with the sign bit.

• The instruction EZH is similar but works with unsigned half-words (16 bits).