Description
Parse a nonnegative decimal address and divide by wordBytes in 1-256.
Address calculations distinguish an occupied last byte from an exclusive end, and alignment rounds to a defined boundary. Element counts and byte counts are not interchangeable.
Parse a nonnegative decimal address and divide by wordBytes in 1-256.
When to use this tool
Use Flash Programming Word Boundary Offset when you need an explicit address, alignment, page, or transfer-count mapping.
How to use the tool and how it works
- Enter address, wordBytes. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read wordStart, offset. Use the output convention below.
Parse a nonnegative decimal address and divide by wordBytes in 1-256. Return its remainder as offset and subtract that offset for wordStart.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| address | Address | Required. Text; maximum UTF-16 length 8192. Integer syntax: optional + or - and 1-128 decimal digits; leading zeros accepted. Apply the sign restriction above. |
| wordBytes | Word Bytes | Required. Safe integer; minimum 1; maximum 256. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| wordStart | Word Start | Required. Text; maximum UTF-16 length 8192. |
| offset | Offset | Required. Safe integer. |
{
"input": {
"address": "4099",
"wordBytes": 4
},
"output": {
"wordStart": "4096",
"offset": 3
}
} Limitations and assumptions
- Arbitrary positive word sizes are accepted; flash programming alignment and access permissions are not verified.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Validate the resulting span against actual memory bounds and device-specific access and transfer rules.
References
Similar or alternative tools
- Microcontroller: Flash Page Offset Field
Divide the nonnegative addressOffset by positive pageSize, returning a floored pageIndex and offsetWithinPage.
- DMA Transfer Alignment Margin
Compute remainder, zero-or-positive padding to the next boundary, and exact nextAddress.