Skip to content
Low-level programming · Higher-level thinking
Login Register
Forum / Bugs and Fixes

-= handler problem

A community discussion post from the original code:zIRON forum.

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

-= handler problem

HI Mr Colin.

i think the is a problem in '-=' handler.

this code works well

#define getrandom(min, max) \
        ebx=max; ebx++; sub ebx,min  \
        eax=rand(); div ebx; XCHG eax,edx; eax+=min;   

but this is not.

#define getrandom(min, max) \
        ebx=max; ebx++; ebx-=min  \
        eax=rand(); div ebx; XCHG eax,edx; eax+=min;   

so the 'ebx-=min' translates as 'ebx -- $min' and it should be 'ebx -= $min' .

btw '+=' works fine here.

http://www.freewebs.com/ogremagic/index.htm

Replies

Colin admin
Posts
928
Threads
49
Location
Bulgaria

I have re-updated beta, there was actually a but with pf function Ziron_GetStringValue() :yess:

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

ok , works well , thanks.

http://www.freewebs.com/ogremagic/index.htm