小编use*_*964的帖子

C到MIPS的翻译

尝试将此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 mips spim

5
推荐指数
1
解决办法
8843
查看次数

C/C++相当于java Integer.toHexString

C/C++相当于java Integer.toHexString.

将一些代码从java移植到C/C++,C在java中的Integer.toHexString中是否有内置函数?

更新:

Heres是我正在尝试移植的确切代码:

String downsize = Integer.toHexString(decimal);
Run Code Online (Sandbox Code Playgroud)

c c++ java porting integer

1
推荐指数
3
解决办法
2011
查看次数

标签 统计

c ×2

c++ ×1

integer ×1

java ×1

mips ×1

porting ×1

spim ×1