Description
Compute remainder, zero-or-positive padding to the next boundary, and exact nextAddress.
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.
Compute remainder, zero-or-positive padding to the next boundary, and exact nextAddress.
When to use this tool
Use DMA Transfer Alignment Margin when you need an explicit address, alignment, page, or transfer-count mapping.
How to use the tool and how it works
- Enter address, alignment. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read aligned, nextAddress, padding. Inspect aligned before interpreting the associated values.
Require a power-of-two alignment from 1 through 65536 and a nonnegative decimal address. Compute remainder, zero-or-positive padding to the next boundary, and exact nextAddress.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. |
| alignment | Alignment | Required. Safe integer; minimum 1; maximum 65536. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| aligned | Aligned | Required. Boolean. |
| nextAddress | Next Address | Required. Text; maximum UTF-16 length 8192. |
| padding | Unused or added positions under the stated alignment rule. | Required. Safe integer. |
{
"input": {
"address": "4097",
"alignment": 4
},
"output": {
"aligned": false,
"nextAddress": "4100",
"padding": 3
}
} Limitations and assumptions
- This aligns an address mathematically; DMA access validity, memory bounds, and device constraints are not checked.
- 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
- Boot Vector Alignment Address Mask
Subtract address modulo alignment for aligned and return the removed offset.
- Flash Programming Word Boundary Offset
Parse a nonnegative decimal address and divide by wordBytes in 1-256.