【发布时间】:2016-02-04 04:14:25
【问题描述】:
我正在做 SPARC 组装。 这是我的一些代码:
convert:
save %sp, -96, %sp
mov %i0, %l0 !%i0 has a long array
mov %i1, %l1 !%i1 has a char array
process:
ld [%i0], %o0 !maps firstArray[0] to %l0
mov 10, %o1 !maps 10 to %o1
call .div !divide by 10 to get 10s place
nop
mov %o0, %l3 !stores result in l3
stb %l3, [%i1] !stores result in the second array
mov %l3, %o1 !checking contents after calculation
call printf
nop
printf 导致错误,我不知道为什么。我用几个本地寄存器试过这个。我需要它来检查我的结果。我该怎么办?
此外,我实际上不确定我实现参数数组的方式是否正确,但在添加 printf 语句之前我没有收到此错误。
【问题讨论】:
-
我想我明白了 - %o0 需要设置格式字符串。
-
您应该将其发布为答案。这确实是问题所在。