I actually don't do that much with assembler code, but if I intend to use it, I want to make
sure I get it right. Actually, my involvement with assembler was to add a capability to
HotBasic that wasn't in the language itself. and to bypass some functions that I saw as
being too ... well, too needy I guess, as far as memory, writing, and other aspects were
concerned. Then I found out that it was not handling assembler right, and I was trying to
find a way around that as well. My intent got pretty deep there, and so right away, I want
those issues resolved, and they are getting there.
Take copying a substring back into a source string for instance. You might want to do this
if you just changed the substring to upper case, because it is a keyword, or to lower case
because it is not. This is just an example. Now suppose you had the pointer to the substring
in register esi, and a pointer plus an offset for the source string in the edi register, and the
length of the substring in ecx. You could simply do a rep movsb, and it is done.
But moving bytes at a time may not be the most efficient way. What if you decided to avail
yourself of any ability to move by words, or even by double words? It's not hard. You might
do something like this:
Code: Select all
shr ecx,1
jnc skip1
movsb
skip1:
shr ecx,1
jnc skip2
movsw
skip2:
jecxz skip3
rep movsd
skip3:
Now what this does is move, at most, one byte. Then move, at most, one word.
Any remaining moves (copies really), will be double words. But with HotBasic, there
is a problem. It does not properly distinguish between movsw and movsd. The only
safe move with it is movsb, or rep movsb in this case, escept that it does not know
what rep is either. If you were going to try this in HotBasic, you would have to insert
a prefix manually at an important point like this:
Code: Select all
shr ecx,1
jnc skip1
movsb
skip1:
shr ecx,1
jnc skip2
db 66h
movsw
skip2:
jecxz skip3
skip2a:
movsd
dec ecx
jnz skip2a
skip3:
So it can be done, in some cases. But you have to remember to do this everywhere that
you run up against a limitation like this. And suppose that it gets fixed at some point?
That now movsw comes with its own 66h prefix in HotBasic? Then to prevent existing
code from effected if recompiled, you might have to consider using this:
db 66h
movsd
in place of :
db 66h
movsw
all because movsw is not properly encoded on its own. Makes you rethink whether you should
stick with that language or not, and I decided to just move on.
Since one of you has visited www,hotbasic.org and found a rather unusual site before you, all
pink, white, and black with lots crambed into each page, I admit it gives you cause to wonder
what you are about to get yourself into. Learning even how to download HotBasic is sort of a
challenge, or how to install it, or go back and get updates. And for the best experience, you
really need to get a number of third party tools, these all being free, but you have to learn
about then, source them, download them, and get them set up so that you can mae use of them.
I'm not here to promote HotBasic or denounce it, as it has promise and can be quite useful. You
just have to learn your way around it, like anything else. There is a free version if you want to
try it out. But from what I've seen of PureBasic so far, I think being here with it is probably good
enough for most purposes. And probably better at doing games, videos, sound, and a number of
other things. So look if you want, try if it suits you, but to go full version will cost you.