string - MIPS - 打印没有伪指令的字符串
问题描述
我想在 MIPS 中打印一些字符串,但必须在没有任何伪指令的情况下完成。我很难找到字符串的开头在哪里。这是代码:
.globl main
.data
terminal_prompt:
.asciiz "Enter Integers: " #17 chars
prompt0:
.asciiz "Smallest int: "
prompt1:
.asciiz "\nLargest int: "
prompt2:
.asciiz "\nQuotient: "
prompt3:
.asciiz "\nRemainder: "
.text
main:
addi $v0, $zero, 4
lui $a0, 0x1000
ori $a0, $zero, 17
syscall
addi $v0, $zero, 10
syscall
我认为第二个字符串 prompt0 从偏移量 17 开始,但似乎并非如此。这是内存段:
[10000000] 65746e45 6e492072 65676574 203a7372 E n t e r I n t e g e r s :
[10000010] 616d5300 73656c6c 6e692074 00203a74 . S m a l l e s t i n t : .
[10000020] 72614c0a 74736567 746e6920 0a00203a . L a r g e s t i n t : . .
[10000030] 746f7551 746e6569 0a00203a 616d6552 Q u o t i e n t : . . R e m a
[10000040] 65646e69 00203a72 00000000 00000000 i n d e r : . . . . . . . . .
[10000050]..[1003ffff] 00000000
解决方案
推荐阅读
- android - 如何在 roboelctric 测试中初始化 firebase
- java - 如何为带有数字括号的“名称(2)”单词制作正则表达式
- c# - Unity 错误 CS0246(找不到命名空间)
- assemblyscript - AssemblyScript 中的 TypedArray 与 Array
- mocking - 在 Jest 中模拟具有进行 Axios 调用的函数的对象
- ruby - 在 Ruby 中查找第二长的数组 - Collatz 猜想算法
- php - 如何使用 php 在 excelsheet 上重复输出
- php - PHP-在多维数组中搜索键
- kubernetes - Spring Cloud Dataflow Kubernetes - 流外部 IP
- reactjs - 为什么我可以 console.log 值但不能 setState?