flat assembler
Message board for the users of flat assembler.

Index > Tutorials and Examples > 4bgs - 4 byte granularity strlen

Author
Thread Post new topic Reply to topic
Ali.Z



Joined: 08 Jan 2018
Posts: 820
Ali.Z 01 Feb 2025, 08:59
get length of ascii string, scanning 4 bytes at a time, plus auto aligning unaligned pointers to 4 byte boundary.

update1: size optimizations.
update2: replace cmp with test.


Description:
Download
Filename: 4bgs.zip
Filesize: 1.25 KB
Downloaded: 94 Time(s)


_________________
Asm For Wise Humans
Post 01 Feb 2025, 08:59
View user's profile Send private message Reply with quote
Ali.Z



Joined: 08 Jan 2018
Posts: 820
Ali.Z 01 Feb 2025, 10:07
in original attachment, i used cmp to compare 0x80 in edx, which is prone to error when edx contains 0x8080, changed it to test edx to be more robust.

_________________
Asm For Wise Humans
Post 01 Feb 2025, 10:07
View user's profile Send private message Reply with quote
alixgrin



Joined: 20 Mar 2025
Posts: 3
alixgrin 21 Mar 2025, 08:50
I thought asm was to make smaller executables.
Post 21 Mar 2025, 08:50
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20631
Location: In your JS exploiting you and your system
revolution 21 Mar 2025, 09:01
alixgrin wrote:
I thought asm was to make smaller executables.
It can be.

It can also be for many other things. Including, but not limited to:

Efficiency gains.
Speed gains.
More control over resources.
Testing internals.
Access to more advanced/later instructions.
Access to system/control instructions.
Breaking free from HLL compiler limitations.
Learn how computers work.
More beautiful looking code.
...
Post 21 Mar 2025, 09:01
View user's profile Send private message Visit poster's website Reply with quote
alixgrin



Joined: 20 Mar 2025
Posts: 3
alixgrin 21 Mar 2025, 14:49
Asm lets me build and run x86 code on ARM tablet which is not allowed to build native apps for itself.
I can take a virtual 386 with me anywhere. Almost weightless. Could we dream of it in 90s?
Upd: why not real Windows tablet. High price, buggy, Windows updates breaking everything, bad power saving. And Windows UI just doesn't fit for PDA.
Post 21 Mar 2025, 14:49
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.