5,530
社区成员
发帖
与我相关
我的任务
分享
#pragma pack(push, 1)
typedef struct AAAA
{
Uint8 ui8StreamIndex;
Uint16 ui16OldStreamId;
Uint16 ui16NewStreamId;
}
#pragma pack(pop)
// cpp中全局变量
AAAA g_streamIndentify;
//出错函数声明
int Funccall(......, Uint16 *pStreamID, ...);
// 过程中调用参数时传入地址
Funccall(..., &g_streamIndentify.ui16NewStreamId,...);
int Funccall(......, Uint16 *pStreamID, ...);
{
//......
*pStreamID = 0x4448;
}
int Funccall(......, Uint16 *pStreamID, ...);
{
//......
*pStreamID = 0x4448 // g_streamIndentify的地址假设是0,依次类推
// ui8StreamIndex的地址是0; 占用内存地址0
// ui16OldStreamId的地址是1;占用内存区域是1、2
// ui16NewStreamId的地址是3; 占用内存区域是3、4
ldr r3, [r11, #-44] // 该句话是将pstreamID保存的地址赋值到 r3寄存器,
// 完成后, r3寄存器的值为3(同上述假设)
ldr r2, 0x4448h ; 我翻译后的代码,原文应该类似于 ldr r2, [pc, #****];
strh r2, [r3] // 将4448h, 赋值到虚拟内存为3的位置。 @@@@@@]
}