Compile time initialized array error

后端 未结 1 1530
花落未央
花落未央 2020-12-22 09:30

I am trying to make an array to which I have provided the data at compile time in MIPS. but I am getting error and thus the code is not getting compiled. Here is the chunk o

1条回答
  •  礼貌的吻别
    2020-12-22 10:13

    You can't use .space directive for initialized arrays. .space is for reserving N uninitialized bytes. You can use .byte or .word for such purpose, depending on the size of your data. In your example, you're using ASCII characters, so .byte should be OK.

    .data
    
    array: 
    .byte 'A','B','C','D','E','F','G','H','I'
    

    Any MIPS assembly reference should be OK. Here's one.

    0 讨论(0)
提交回复
热议问题