| | |
search in a string
![]() |
•
•
Join Date: Dec 2007
Posts: 10
Reputation:
Solved Threads: 0
Hi everyone, i need to write a code with mips assembly that works on a string given by a user (command line input).
The code is supposed to search another given string in that string. There is a problem in my mind, in mips is there any instruction that search a string in another one, i mean without comparison byte by byte or chra by char. Also, i don't know how can i goto at a specific location on that string, for example to reach 12th character of the given string if i have the string like that:
I gave "the string & the string" as input and how can i reach/get 12th character?
Thanks in advance...
The code is supposed to search another given string in that string. There is a problem in my mind, in mips is there any instruction that search a string in another one, i mean without comparison byte by byte or chra by char. Also, i don't know how can i goto at a specific location on that string, for example to reach 12th character of the given string if i have the string like that:
Assembly Syntax (Toggle Plain Text)
.text .globl main main: subu $sp, $sp,4 sw $ra,0($sp) li $v0, 8 # Read string. la $a0, buf # Buffer li $a1, 256 # Length of buffer syscall # Space for the input string. buf: .space 256
I gave "the string & the string" as input and how can i reach/get 12th character?
Thanks in advance...
![]() |
Similar Threads
- Search for a string in a variable--- (PHP)
- How to search for a string in a file (C#)
- Search string in a text file (C)
- Search a string of ',' (C++)
- New User (C)
- String Addition (C++)
- Dev Pascal string help. (Pascal and Delphi)
- Need help with string loop (C)
- "String class" (Java)
- Return Length of a string? (C++)
Other Threads in the Assembly Forum
- Previous Thread: Retrieving Values From Register..
- Next Thread: Printing Results from an interupt.
| Thread Tools | Search this Thread |






