0

I have new problem. I'm working with strings in assembly language and I want to ask: Is there any function in assembly language for "splitting" strings like Split in JavaScript, .NET and explode in PHP?

2
  • Do you want someone to write a function for you? Why don't you try first? There's no opcode to split strings if that's what you're thinking Commented Jul 25, 2011 at 18:15
  • No I don't write it. My problem is that I don't know how to code it and here I'm asking how to code it. Commented Jul 25, 2011 at 18:21

1 Answer 1

4

Pure assembly? No. There is no such thing as a string on a cpu, just bytes. You'll have to either use a library like the c library, link it and use the usual c functions, or code it yourself in assembly.

Sign up to request clarification or add additional context in comments.

4 Comments

And can I make it like that i will go character by character and I will compare it with delimiter? than if character will be delimiter, next characters (without another delimiters) will be written to another db?
I think you really need to think on a lower level than you are currently. What db? Assembly is moving bytes and adresses around, not characters or a even bigger, a database. The general concept is okay though. The function gets a pointer to an input array plus a single byte used as the delimiter and returns (by putting it into eax) a pointer to an output array.
sorry, instruction. String db "splitted string here".
Assembly (atleast x86) has a concept of strings, as there are specific string manip opcodes, like stos & movs (which got abused as generic memory op), scas, lods etc (etfos.hr/~jbognar/pozadine/temp/asembly%20tutorial/x86asm/…), you are right about there being no splitting op though

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.