【问题标题】:Getting started with MIPS emulationMIPS 仿真入门
【发布时间】:2012-07-14 06:52:22
【问题描述】:

我可以运行模拟器 (x)mips 和 mars,但我不知道如何制作程序。 MIPS 程序集仿真没有“入门”。你能给我一个简单的程序吗?

【问题讨论】:

    标签: mips emulation


    【解决方案1】:

    这里是切换$t0$1$t2$t3的值的代码。使用任何编辑器将其粘贴到文件swap.s 中,然后使用模拟器(mars、pcspim、qtspim)打开文件。

        .text
        .globl main
    main:
        li  $t0, -10
        li  $t1, -31
        li  $t2, -10
        li  $t3, -31
    
        #swap
    
        xor $t0, $t0, $t1
        xor $t1, $t0, $t1
        xor $t0, $t0, $t1
    
        addu    $t2, $t2, $t3
        subu    $t3, $t2, $t3
        subu    $t2, $t2, $t3
    
        li  $v0, 10
        syscall
    

    你总是写:

    .text
    .globl main
    main:
    
    #code here
    
    li  $v0, 10
    syscall
    

    然后从那里继续。

    【讨论】:

    • 谢谢,我可以在 mars 中运行代码,但我不明白如何在 xspim 中运行。
    • 我只有 PCSPIM 的经验,所以我恐怕无法帮助你处理 xspim。
    猜你喜欢
    • 1970-01-01
    • 2016-04-26
    • 2023-03-27
    • 1970-01-01
    • 1970-01-01
    • 2012-11-02
    • 1970-01-01
    • 2022-01-21
    • 1970-01-01
    相关资源
    最近更新 更多