flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Lion17
have string
Code: 'abcd' need string Code: 'abc','d'+80h if there way to do it? |
|||
![]() |
|
comrade
in what context?
you can have it like this: Code: original db 'a','b','c','d' modified db 'a','b','c','d'+80h or like this: Code: mov eax,'abcd' mov eax,<'abc','d'+80h> |
|||
![]() |
|
comrade
Last one doesn't work, it should be:
Code: mov eax,'abcd' mov eax,('abc' shr 8) OR ('d'+80h) |
|||
![]() |
|
comrade
Or rather like this:
Code: mov eax,('a' shl 24) OR ('b' shl 16) or ('c' shl 8) OR ('d') |
|||
![]() |
|
comrade
You can swap the order (abcd -> dcba), if you like.
|
|||
![]() |
|
Lion17
the point is use ordinar string 'abc...def'
and I need modify only last character of it how I can split string in mscro on two part: header and last character? |
|||
![]() |
|
comrade
please provide more context
how/where are you trying to use this technique? |
|||
![]() |
|
Tomasz Grysztar
Code: macro EndBitString str { db str local lastchr load lastchr byte from $-1 lastchr=lastchr or 80h store byte lastchr at $-1 } |
|||
![]() |
|
LocoDelAssembly
or
Code: struc EndBitString str { . db str local ..lastchr load ..lastchr byte from $-1 ..lastchr=..lastchr or 80h store byte ..lastchr at $-1 } In case you want things like Code: aString EndBitString 'Hello World' Tomasz, is not better to use local names prefixed with two dots? |
|||
![]() |
|
Tomasz Grysztar
It matters when you use those names as labels, but here it is a numeric variable ("=" and "load" define numeric variables).
|
|||
![]() |
|
LocoDelAssembly
Code: .a = '0' b = 1 c = .a + b display c works ![]() Thanks for the info!! |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.