deff MandelbrotLimit
====================
  push 0
  fistp dword[esp]
  pop ecx
  fldz 'y0
  fldz 'x0
  inc  ecx
  (
   dec   ecx
   jle exit             'always exit after 'count' iterations
   fld   st0 : fmul st0 'sqx0
   fld   st2 : fmul st0 'sqy0
   fsubp st1            'sqx0-sqy0
   fadd  st3            '+x
   fld   st1            'x0
   fmul  st3            'x0*y0
   fadd  st0            '2*x0*y0
   fadd  st5            '+y
   fstp  st3            'new y0
   fst   st1            'new x0
   ; TEST LIMIT
   fmul  st0            'sq x0
   fld st2 : fmul st0   'sq y0
   faddp st1            'sqx0+sqy0
   fld st5              '4.0
   fcomip               'compare 4.0 - result ( drop 4.0 )
   fstp st0             'drop result
   ja repeat            'continue if 4.0 was greater than result
  )
  fstp st0 : fstp st0
  fstp st0 : fstp st0
  fstp st0
  push ecx
  fild dword [esp]
  pop ecx
end deff


include "window.inc"
Window "MANDEL AFRICAN",620,500,4

single x,y,cx,cy,f=.004, four=4.0
sys    i,count
count=32

ClsColor 105,168,100
  For x=0 To 620 
    cx=x*f-1.5
    For y=0 To 250  
      cy=1-y*f
      i=MandelbrotLimit(four, cy, cx, count)
      if i
        i=count-i
        Pixel x, y,ColorRGB(i*.4,y,i*.6)
        Pixel x, 500-y, ColorRGB(i*.4,y,i*.6)
      end if
    Next
  Next
Pause
WinEnd