void tsk_test5(void)
{
unsigned int i,j;
unsigned char a,b;
unsigned long l;
i=0xAA55;
j=0x55AA;
a=0x88;
b=0x99;
l=0x11223344;
while(1){
iprintf("haha5\n");
TSK_time();
iprintf("test5 time = %d,count = %d",TSK_time(),count++);
funtionarg(i,b,l);
}
}
void tsk_test5(void)
{
8000AEB0 STW.D2T2 B3,*SP--[10] //SP=SP-4*10;*(SP)=B3;SP向下增长,
8000AEB4 NOP 2
i=0xAA55;
8000AEB8 MVK.S1 0xffffaa55,A3 //A3=0xffffaa55
8000AEBC .fphead p, l, W, BU, nobr, nosat, 0000010 //不知道,好像是个系统调用
8000AEC0 MVKH.S1 0x0000,A3 //把0x0000赋值给A3的高16,A3=0x0000AA55
8000AEC4 STW.D2T1 A3,*B15[5] //i是局部变量,压入栈中,*(B15+4*5)=A3(B15==SP).
8000AEC6 NOP 2
j=0x55AA;
8000AEC8 MVK.S2 0x55aa,B4 //B5=0x55aa
8000AECC STW.D2T2 B4,*B15[6] //*(B15+4*6)=B4(B15==SP).
8000AECE NOP 2
a=0x88;
8000AED0 MVK.S1 0x0088,A3
8000AED4 STB.D2T1 A3,*+SP[28] //*(SP+28)=A3
8000AED8 NOP 2
b=0x99;
8000AEDA MVK.S2 153,B4
8000AEDC .fphead n, l, W, BU, nobr, nosat, 1001010
8000AEE0 STB.D2T2 B4,*+SP[29] //*(SP+29)=B4
8000AEE4 NOP 2
l=0x11223344;
8000AEE8 MVK.S2 0x3344,B4
8000AEEC MVKH.S2 0x11220000,B4
8000AEF0 || MVK.L2 0,B5
8000AEF4 STDW.D2T2 B5:B4,*+SP[4] //长整型,8字节,*(SP+4×4)=B5:B4
8000AEF8 NOP
iprintf("haha5\n");
8000AEFC C$DW$L$_tsk_test5$2$B, C$L4:
8000AEFC MVK.S2 0x187c,B4
8000AF00 MVKH.S2 0x80010000,B4
8000AF04 CALLP.S2 iprintf (PC-9212 = 0x80008b04),B3
8000AF08 || STW.D2T2 B4,*+SP[1] //这块要注意,指令前有“||”表示和上面一条指令同时执行,可变参数函数,参数压栈。
TSK_time();
8000AF0C C$RL2:
8000AF0C LDW.D2T2 *+B14[162],B4 //B14: 存放全局变量的基地址,也就是BSS段的基地址。*+B14[162]这个应该是TSK_time()的地址。
8000AF10 NOP 4
iprintf("test5 time = %d,count = %d",TSK_time(),count++);
8000AF14 LDHU.D2T2 *+B14[437],B4 //B4=*(B14+4×437)将全局变量count的值放入B4中
8000AF18 LDW.D2T2 *+B14[162],B5 //将TSK_time()的返回值放入B5中
8000AF1C MVK.S1 0x1883,A3
8000AF20 MVKH.S1 0x80010000,A3
8000AF24 STW.D2T1 A3,*B15[1] //第一个参数(也就是字符串地址)压栈。
8000AF26 STW.D2T2 B4,*B15[3] //第三个压栈
8000AF28 ADD.L2 B4,1,B4 //count++
8000AF2A STW.D2T2 B5,*B15[2] //第二个压栈。
8000AF2C CALLP.S2 0x80008AE4 (PC-9244 = 0x80008ae4),B3
8000AF30 || STH.D2T2 B4,*+B14[437] //count=B4;
funtionarg(i,b,l);
8000AF34 C$RL3:
8000AF34 LDW.D2T1 *+SP[5],A4 //A4=*(SP+4*5)=i;第一个参数用A4传递
8000AF38 LDBU.D2T2 *+SP[29],B4 //B4=*(SP+4*29)=b;第二个参数用B4传递
8000AF3C .fphead n, l, W, BU, nobr, nosat, 0000110
8000AF40 LDDW.D2T1 *+SP[4],A7:A6 //第三个参数用A7:A6传递。long型数据。
8000AF44 || CALLP.S2 funtionarg (PC-268 = 0x8000ae34),B3
8000AF46 C$RL4:
8000AF46 BNOP.S1 C$L4 (PC-68 = 0x8000aefc),5 //while循环
}
阅读(2381) | 评论(0) | 转发(0) |