尝试将此c代码转换为MIPS并在SPIM中运行它.
int A[100], B[100];
for(i=1; i<100; 1++){
A[i] = A[i-1] + B[i];
}
Run Code Online (Sandbox Code Playgroud)
到目前为止,这就是我所拥有的.
# comments are delimted by has marks
.data
A: .word 0:100 # array of 12 integers
B: .word 0:100 # array of 12 integers
.text
main:
li $v0, 1 # load the value "1" into register $v0
li $t0, 1 # load the value "1" into register $t0
li $t1, 100 # load the value "100" into register $t1
blt $t0, $t1, loop # branches to …Run Code Online (Sandbox Code Playgroud) C/C++相当于java Integer.toHexString.
将一些代码从java移植到C/C++,C在java中的Integer.toHexString中是否有内置函数?
更新:
Heres是我正在尝试移植的确切代码:
String downsize = Integer.toHexString(decimal);
Run Code Online (Sandbox Code Playgroud)