dbartz,
Al of the logic primitives are polymorphic, meaning that you anc use them with numerical values. Set up your data as an unsigned 32 bit integer (U32). Use AND and OR functions to mask off the parts you want to change and the parts you want to protect. If you had 8-bit words (for a simplified example) and wanted to change bits 2, 3, and 4, you could do this:
let K = old data (example K = 10101010)
let P = new data (example P = 00111110) {Notice that P has non-zero values in bits other than 2, 3, 4}
let Mk = mask for old data (example Mk = 11100011), and
let Mp = mask for new data (example Mp = 00011100 = NOT Mk).
Then (K AND Mk) OR (P AND Mp) = data to write.
Using the example values above (K AND Mk) = 10100010, (P AND Mp) = 00011100, and data to write = 10111110.
Lynn