#split

Assembly Programming Journal Issue 06

eZine's profile picture
Published in 
 · 5 years ago
... 16] ;splitchar xor eax, eax ;zero out eax for later mov edx, esp ;save current stack pos. push dword edi ;save ptr to first substring cmp ecx, 0 ;is #splits NULL? jnz do_split ;--no, start splitting mov ecx, 0xFFFF ;--yes, set to MAX do_split: mov bh, byte [edi] ;get byte from target string cmp bl, bh ;equal to delimiter? je .splitstr ;--yes, then split it cmp al, bh ;end of string? [al == 0x0] je EOS ;--yes, then leave split() inc edi ;next char loop do_split .splitstr: mov [edi], byte al ;replace split delimiter with "\0" inc edi ;move to first char after delimiter push edi ;save ptr to next substring loop do_split ;loop #splits or till EOS EOS: ...
loading
Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT