News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Recent posts

#31
The Colosseum / Re: Dictatorship In Michigan?
Last post by donkey - May 24, 2012, 03:10:05 AM
Quote from: rags on April 10, 2012, 11:51:59 PM
... Also, I would like to know if a state ultimately becomes responsible for the debt incurred,
by a cities fiscal mismanagement?...

This would only be in the case of "underlying debt" which is generally (though not always) when a municipality issues a bond that is guaranteed by the state (or provincial in my case) government. There are also certain "overlapping debt" scenarios in which both governments are responsible for all debt incurred in bonds issued to finance an area of joint responsibility, in that case the default of one government places the entire debt on the other. However, outside of a few very specific cases, the state is not responsible to back any bonds issued by a municipality.
#32
The Colosseum / Re: Dictatorship In Michigan?
Last post by NPNW - May 24, 2012, 02:10:59 AM
I've heard in Michigan that they may un-incorporate the cities and let them be un-incorporated, or incorporated into other cities. As to their bond debt that would be the responsibility of the city that issued it, unless they want to take over that debt. Otherwise I don't believe that they have to be responsible for it. 

Harrisburg, could disappear if they wanted to. Also don't care for the fact that teachers are working for no pay in Pennsylvania, while they privatize the schools.
#33
The Colosseum / Re: American health (no) care ...
Last post by NPNW - May 24, 2012, 02:02:07 AM
Donkey,

Things are much worse. Now with the republicans requiring 61 votes in the senate to get anything passed. Unlimited funds in politics, mostly on the Republican side. The supreme court more right than neutral with 2 openly going to republican political meetings. i think it was thomas, and kennedy if I remember correctly.
#34
The Soap Box / Re: Software job did not make ...
Last post by NPNW - May 24, 2012, 01:37:04 AM
I was once told we could triple our output! Without increasing hours, or number of employees.  I asked which genius came up with this idea, and he could demonstrate it first by example.
Everyone left, and we were replaced by minimum wage people. They never did get triple the output, and management still sucked years later, before they went out of business.
#35
The Campus / Re: FPU - How to test for infi...
Last post by raymond - May 24, 2012, 01:02:24 AM
From the description of the Status Word,
QuoteBits 6-0 are flags raised by the FPU whenever it detects an exception. Those exception flags are cumulative in the sense that, once set (bit=1), they are not reset (bit=0) by the result of a subsequent instruction which, by itself, would not have raised that flag. Those flags can only be reset by either initializing the FPU (FINIT instruction) or by explicitly clearing those flags (FCLEX instruction).

Which means that if you check for an invalid operation at the end of a series of FPU instructions, that flag could have been raised by any of those previous instructions and not necessarily by the last one. When you need to find where the invalid operation occurs, you need to check for it after each operation which could be the culprit. If you are not entirely sure if an instruction could be the source of an invalid operation, you will have to verify its description; there are too many of those to list here.

A result of infinity would cause an Overflow exception but not always raise the Invalid Operation flag. Dividing by 0 would also raise the Divide-by-zero flag but not the Invalid Operation flag unless the value you are trying to divide is also 0.
#36
The Campus / Re: BitBlt Motion
Last post by dedndave - May 23, 2012, 10:28:50 PM
remember those old beer signs ???   :bg

It's Miller Time !
#37
The Campus / FPU - How to test for infinity
Last post by RuiLoureiro - May 23, 2012, 09:13:40 PM
Hi,
        After some operations
        when i retrieve exception flags from FPU
        it gives me invalid operation.
        I want to know if it is infinity
        or another case. Can i know the case ?
        How to do that ?
       
        In this particular case the factors are
        X=3 and Y=11623334155587.786 and it seems
        that the result is infinity
       
        Thanks
       
Quote
    fstsw ax                ;retrieve exception flags from FPU
    fwait
    shr   al,1              ;test for invalid operation
    jc    short _error
#38
The Campus / Re: The calculator
Last post by RuiLoureiro - May 23, 2012, 07:01:35 PM
Hi all,

            3 things:

            1. calcula46 doesnt solve some expressions
               and i want it should solve any expression
               and i need to lose some time testing all
               that cases and cleaning some code to
               get the best code to do each task.
               To do this work i have a separated file
               with a lot of procedures to test and to
               follow each calculation step. I lose
               some time writing these particular procedures.
               
            2. Now, calcula47 solves chains of powers
               or exponentials and powers of rational
               numbers               

            3. The bigest problem i had to solve till now
               was exponentials or powers and chains of
               powers. I remember that the arguments or
               factors can be pi,+pi,-pi,e,+e,-e, scientific
               notation, integers, any real number, expressions
               inside brackets or functions or functions
               inside functions
           
        **** Here is calcula47 v1.07 ****

            1.  exponential or power of rational number

                How to calculate (expression)^(N/K)
                where N and K are integers ?

                Now, when we type any expression inside
                brackets followed by "^" and
                followed by brackets, the calculator
                try to decode the last as integers N
                or N and K.

                So, now we can solve (log(3)-1)^(1/3)
                (=-0.805626350626199) 
                or (log(3)-1)^(-1/3) = -1.241270223128524
                or (log(3)-1)^(1/-3) = -1.241270223128524

            2. chains of exponentials or powers

                How to calculate

                  real1^real2^real3^...^realN ?
                 
                where real1,real2,...,realN are any real number ?

                Now, we can solve expressions like this:
                                                                       
    Examples:
   
        1)      (-3.573718205179228E-0017)^(-3/5)= -7381214348.06242
       
                2+(log(3)^2)^(6/3) = 2.051822105661585

                2+(log(3)^2)^(1/3) = 2.610593967460875

                (cos(pi/3)^2+sin(3*pi/2)^2)^(1/3)  = 1.077217345015942

                2*(log(2)-log(3)^2^3)^(1/3)+1   = 2.33639853443889

                When the value is infinity it gives ERROR

        2)
                2^-2.21E-3^log(2)^+2e2^-pi  = 0.998469317422371

                2^-2.21E-3^log(2)^2e-2^-pi  = 0.5

                2^e^log(2)^-e^-pi  = 7.295225269786005

                2*(3-2^3^log(5*log(3)+1)^2^3^log(3)^2^3)^(1/2) / (log(2)+2^3^log(3)^2^3)
                =  0.571196983587843


        Try it and say something.
        Good luck !

        Thanks       
        Rui Loureiro
        EDIT: note that, to solve 2^3^4^5, the calculator
                     starts by 4^5 = x, next 3^x=y, next 2^y.
#39
The Campus / Re: Help, creating a Malloc fu...
Last post by RHL - May 23, 2012, 04:04:33 PM
perfect! thanks a lot, dave  :bg
#40
The Campus / Re: Help, creating a Malloc fu...
Last post by dedndave - May 23, 2012, 12:28:20 PM
you should only use HeapDestroy when you are done using the heap created by HeapCreate
there is no need to use either of these functions

when you call HeapFree, the first parameter should be the heap handle - not the allocated block

for such small allocations, you could just use the stack or the uninitialized data section   :P

include masm32rt.inc

mymalloc proto :DWORD
myfree proto :DWORD

.data
hmyHeap dd 0
mtest db "test, testtttt dj a test ",0

hMylp1 dd 0
hMylp2 dd 0

.code

main:

call InitHeap

;I need to 300h bytes
invoke mymalloc,300h
mov hMylp1,eax
invoke RtlMoveMemory,eax,addr mtest,10

invoke mymalloc,200h
mov hMylp2,eax
invoke RtlMoveMemory,eax,addr mtest+10,10

; free memory 1
invoke myfree, hMylp1

; free memory 2
invoke myfree, hMylp2

InitHeap proc
invoke GetProcessHeap
mov hmyHeap,eax
ret
InitHeap endp

mymalloc proc Memsize:DWORD
invoke HeapAlloc,hmyheap,HEAP_ZERO_MEMORY,Memsize
ret
mymalloc endp

myfree proc hAlloc:DWORD
invoke HeapFree,hmyHeap,NULL,hAlloc
ret
myfree endp

end main