flat assembler
Message board for the users of flat assembler.
Index
> High Level Languages > find words in string. How do this ? |
Author |
|
Roman 07 Sep 2020, 09:09
Why my thread in High Level Languages ?
I need work with text in Fasm 1.73 in 32 bit mode And write fasm 32 bit program search names in text t2. |
|||
07 Sep 2020, 09:09 |
|
revolution 07 Sep 2020, 09:18
You are writing code to generate/scan HLL source, right? So, I think this it the right place, you can post code that scans or generates the HLL source.
Last edited by revolution on 07 Sep 2020, 09:52; edited 1 time in total |
|||
07 Sep 2020, 09:18 |
|
revolution 07 Sep 2020, 09:22
To start you off you need to define what is a 'separator' in your language. Then the text is what exists between each separator.
I can probably guess that space, equals and semi-colon are separators from the sample you posted. There might be others. So from there you can construct a list of them. |
|||
07 Sep 2020, 09:22 |
|
Roman 07 Sep 2020, 11:19
How i search.
Code: macro FindWord chFind,chTxt,chZnk,chZnk2 {local j0,j1,j2,j3,j4,j5,jj mov edx,chTxt dec edx j0: sub ecx,ecx inc edx ; j1: mov al,[chFind+ecx] cmp al,chZnk jz j2 cmp al,chZnk2 jz j2 cmp al,[edx] jnz j0 inc edx ;in this place may be a problem ?! a think about label j0: inc edx inc ecx cmp al,13 ja j1 j2: add ebx,ecx ;pusha ;Msg edx,'Find:' ;popa j3: jj: } In code i use: Code: t2 db 'a = 3; b = 2; c = 0;',13,10,0 tt db 'a ,b ,c )',13,10,0 mov ebx,tt FindWord ebx,t2,',',')' |
|||
07 Sep 2020, 11:19 |
|
Roman 09 Sep 2020, 10:23
I done this !!!
https://www.youtube.com/watch?v=yXBf1tYYfio&feature=youtu.be |
|||
09 Sep 2020, 10:23 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.