調用 sat_add(x, y, p1) 時,p1 必須是已分配變量的地址,不能是 NULL。
int32_t *p1 = NULL;
sat_add(x1, y1, p1); // ❌ 解引用 NULL → 崩潰
printf("%d", *p1);
int32_t tp1; // 分配局部變量
int32_t *p1 = &tp1; // 取地址傳遞
sat_add(x1, y1, p1); // ✅ 函數內 *p1 = ... 寫入 tp1
printf("%d", tp1); // 直接用變量或 *p1
p2uint32_t tp2;
uint32_t *p2 = &tp2;
sat_sub(x2, y2, p2);