Macro process_image::tag_mut

source ·
macro_rules! tag_mut {
    ($buf:expr, X, $addr1:literal, $addr2:literal) => { ... };
    ($buf:expr, B, $addr:literal) => { ... };
    ($buf:expr, W, $addr:literal) => { ... };
    ($buf:expr, D, $addr:literal) => { ... };
    ($buf:expr, L, $addr:literal) => { ... };
    ($buf:expr, $addr1:literal, $addr2:literal) => { ... };
}
Expand description

Mutable access to tag values from a process image with absolute addressing.

Addresses must be aligned to the size of the datatype (i.e. word=2, dword=4, lword=8).

Multi-byte datatypes are always accessed in big-endian order.

§Example

let mut pi = [0x00; 16];

// Bit access
*process_image::tag_mut!(&mut pi, X, 0, 0) = true;  // %MX0.0
*process_image::tag_mut!(&mut pi, 0, 1) = true;     // %MX0.1

// Byte access
*process_image::tag_mut!(&mut pi, B, 1) = 42u8;     // %MB1

// Word access
*process_image::tag_mut!(&mut pi, W, 2) = 1337u16;  // %MW2

// Double word access
*process_image::tag_mut!(&mut pi, D, 4) = 0xdeadbeef; // %MD4

// Long word access
*process_image::tag_mut!(&mut pi, L, 8) = 1;        // %ML8