News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Signed Flags

Started by habran, October 12, 2014, 06:27:37 AM

Previous topic - Next topic

TouEnMasm

I prefered  also name without abreviations.
I find !ZEROANDCARRY?  better than !ZERORCRY?
Pseudo code is also better in the explain.
NOT (ZERO AND CARRY)
.if !ZEROANDCARRY?
.......
Fa is a musical note to play with CL

habran

Hey Dave, your suggestion is brilliant, it is simple and clear :t
I have to admit that I was also thinking about it but was not able to find proper words
Thank you :biggrin:
I will take it exactly as you suggested:
JGE   LESS?
JL    !LESS?   
JG    !GREATER?
JLE   GREATER?
JA    !ABOVE?
JBE   ABOVE?

Thanks ToutEnMasm for your involvement, I appreciate it :t

I'll be back!
Cod-Father

habran

done!

    mov eax, ptScale.x
000000013FC611F1 8B 84 24 90 00 00 00 mov         eax,dword ptr [ptScale] 
    and eax, 8000000fH
000000013FC611F8 25 0F 00 00 80       and         eax,8000000Fh 
    .if (LESS?)
000000013FC611FD 7D 07                jge         main+47h (013FC61206h) 
    dec eax
000000013FC611FF FF C8                dec         eax 
    or eax, -16
000000013FC61201 83 C8 F0             or          eax,0FFFFFFF0h 
    inc eax
000000013FC61204 FF C0                inc         eax 
    .endif
    add ptScale.x, eax
000000013FC61206 01 84 24 90 00 00 00 add         dword ptr [ptScale],eax 

    mov eax, ptScale.x
000000013FC6120D 8B 84 24 90 00 00 00 mov         eax,dword ptr [ptScale] 
    and eax, 8000000fH
000000013FC61214 25 0F 00 00 80       and         eax,8000000Fh 
    .if (!LESS?)
000000013FC61219 7C 07                jl          main+63h (013FC61222h) 
    dec eax
000000013FC6121B FF C8                dec         eax 
    or eax, -16
000000013FC6121D 83 C8 F0             or          eax,0FFFFFFF0h 
    inc eax
000000013FC61220 FF C0                inc         eax 
    .endif
    add ptScale.x, eax
000000013FC61222 01 84 24 90 00 00 00 add         dword ptr [ptScale],eax 

    mov eax,ptScale.x
000000013FC61229 8B 84 24 90 00 00 00 mov         eax,dword ptr [ptScale] 
    and eax, 8000000fH
000000013FC61230 25 0F 00 00 80       and         eax,8000000Fh 
    .if (GREATER? )
000000013FC61235 7E 07                jle         main+7Fh (013FC6123Eh) 
      dec eax
000000013FC61237 FF C8                dec         eax 
      or eax, -16
000000013FC61239 83 C8 F0             or          eax,0FFFFFFF0h 
      inc eax
000000013FC6123C FF C0                inc         eax 
    .endif
    add ptScale.x, eax
000000013FC6123E 01 84 24 90 00 00 00 add         dword ptr [ptScale],eax 

    mov ecx, eax
000000013FC61245 8B C8                mov         ecx,eax 
    and ecx, 8000000fH
000000013FC61247 81 E1 0F 00 00 80    and         ecx,8000000Fh 
    .if (!GREATER? )
000000013FC6124D 7F 07                jg          main+97h (013FC61256h) 
    dec ecx
000000013FC6124F FF C9                dec         ecx 
    or ecx, -16
000000013FC61251 83 C9 F0             or          ecx,0FFFFFFF0h 
    inc ecx
000000013FC61254 FF C1                inc         ecx 
    .endif
    add eax, ecx
000000013FC61256 03 C1                add         eax,ecx 

    mov eax, 16
000000013FC61258 B8 10 00 00 00       mov         eax,10h 
    mov ecx, eax
000000013FC6125D 8B C8                mov         ecx,eax 
    and ecx, 8000000fH
000000013FC6125F 81 E1 0F 00 00 80    and         ecx,8000000Fh 
    .if (ABOVE?)
000000013FC61265 76 07                jbe         main+0AFh (013FC6126Eh) 
    dec ecx
000000013FC61267 FF C9                dec         ecx 
    or ecx, -16
000000013FC61269 83 C9 F0             or          ecx,0FFFFFFF0h 
    inc ecx
000000013FC6126C FF C1                inc         ecx 
    .endif
    add eax, ecx
000000013FC6126E 03 C1                add         eax,ecx 
   
    mov ecx, eax
000000013FC61270 8B C8                mov         ecx,eax 
    and ecx, 8000000fH
000000013FC61272 81 E1 0F 00 00 80    and         ecx,8000000Fh 
    .if (!ABOVE?)
000000013FC61278 77 07                ja          main+0C2h (013FC61281h) 
    dec ecx
000000013FC6127A FF C9                dec         ecx 
    or ecx, -16
000000013FC6127C 83 C9 F0             or          ecx,0FFFFFFF0h 
    inc ecx
000000013FC6127F FF C1                inc         ecx 
    .endif
    add eax, ecx
000000013FC61281 03 C1                add         eax,ecx 

Cod-Father

dedndave

#18
i guess some of those are not really necessary, come to think of it

Masm (and probably JwAsm) supports ">=", "<=", "<", and ">"
and, signed comparisons by using the SDWORD PTR specifier

later today, i'll play with some code to see what's missing

habran

Hey Dave SDWORD doesn't work in these cases that's why I went through all this

here are binaries   
Cod-Father

nidud

#20
deleted

dedndave

right - that was before my first cup of coffee - lol
ignore that post   :P

we are talking about pre-existing flag conditions - not compares

habran

Yes Dave, that is good wording pre-existing flag conditions
(reminds me on premature... something) ;)
your English is pretty good
Actually I am never sure if you Americans speak English or American
I know for sure that Australians speak Australian language because when I came here
they did not understand my 'English' (which we were taught in my school) :biggrin:
Cod-Father

dedndave

British English is pretty strange, too - lol

habran

Certainly!
If you want to learn nice smooth English watch the SBS news (here in OZ)
Do you also have SBS news in US?
Cod-Father

TouEnMasm


I had dowloaded the new JWASM
"JWASM isn't a valid WIN32 aplication"

Seems there is a problem ? (xp sp3)
Fa is a musical note to play with CL

habran

I have Window 7
If you want I can post here hll.c
the rest of source you take from my last post
and than build it with your favorite program
Cod-Father

habran

here is hll.c
replace former with this one
Cod-Father

nidud

#28
deleted

habran

Hi nidud :biggrin:
which one looks better?

  .repeat 
    .if LESS?
      inc eax
    .endif
  .until  ABOVE?

  .repeat 
    .if .ifge
      inc eax
    .endif
  .until .ifa
Cod-Father