Empty string: Difference between revisions

Line 1,970:
false
</pre>
 
=={{header|MIPS Assembly}}==
An empty string is just a null terminator with nothing in front of it.
 
Storing an empty string:
<lang mips>li t0,0
la a0,UserRam
sb t0,(a0)</lang>
 
Checking that a string is (not) empty:
 
<lang mips>lbu t0,(a0)
nop ;load delay slot (only necessary on MIPS I
beqz t0,StringIsEmpty
nop ;branch delay slot
;your code for what happens when the string is not empty, goes here</lang>
 
=={{header|Mirah}}==
1,489

edits