assembly - Can someone tell me what the purpose of load immediate is in this MIPS program? -
I am working on the introduction of MIOS tutorial from my university, and we are trying to see the code and each row To understand.
I think the load works immediately, that is, it loads the second value / value from the register in the first register.
The purpose of this program, which I do not understand, is to remove it, though removing it causes the program to be unsuccessful.
This loads for the first time in $ 4 $ v0, then after prompting the user for an item, then from $ v0 to $ zero and $ V0 back to 4 It is stored in $ s0 before returning etc. e.t.c.
But I can not see any purpose in doing this. It appears that only $ v0 is used, but they keep changing it to the full value. Secondly, instead of changing from $ v0 to 5, why not write "li $ s0, 5" and then "$ S0, $ zero, $ v0 "by adding the command?
Any help appreciated appreciated.
syscall
is a common interface you specifically tell it Before making a call, what to do by loading the codified number in $ v0
In this example / target environment, 4
is apparently an operation that is $ A0
writes the string to the address and 5
is an operation that gets input from the user that the output has to go elsewhere and since you have Li after the call system does not need to call number is a good place for $ v0
results.
Comments
Post a Comment