Re:i386 Assembly Language trick for storing data in .text
by yenz0r on Thursday November 09, 2023 @02:45AM
(#38202217)
Yeah the example wont work, but since it's only used for getting the length of the string its an easy to fix to instead use pascal/counted strings with a length prefix byte.
Re:i386 Assembly Language trick for storing data in .text
by 0x0 on Thursday November 09, 2023 @02:59AM
(#38202297)
They should have put labels in front of and after the string bytes, then most assemblers would evaluate "(labelafter - labelbefore)" to a constant integer giving the length as needed. No need for a runtime sub instruction either, then.
mov edx, print
... in the example.