GithubHelp home page GithubHelp logo

mrmcsoftware / fractalasm Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 688 KB

x86 inline assembly language Mandelbrot and Julia fractal program (Windows)

Home Page: https://www.youtube.com/MrMcSoftware/videos

C 72.13% Makefile 1.22% Assembly 26.66%
fractal mandelbrot-set julia-set x86 assembly-language inline-assembly c win32api graphics windows

fractalasm's Introduction

x86 Inline Assembly Mandelbrot and Julia Fractal Program (Windows)

Introduction

This is a Mandelbrot and Julia Set fractal program written in x86 (inline) assembly language. I chose inline because I didn't want to code the Windows GUI stuff in assembly. This program is based on the fractal program I wrote for a CPU / computer design I created. I have included that original program in case you want to see how this project has evolved. I created the x86 version in order to learn x86 assembly language and in order to create a tutorial video on x86 assembly language. Because of this, I purposely only used basic x86 assembly. That means no SSE, SSE2, AVX-512, etc. Using newer x86 instructions (vector, etc.) would make it faster, but would make it a bit harder to understand and would deviate quite a bit from my original program (for my CPU design). For example, fmul versus VPCLMULQDQ to multiply. Besides, GPU would be faster anyway, in which case you wouldn't even use assembly.

This is not meant to be the best, most versatile, fractal program. It was meant to show assembly language programming. BTW, this is why it's 512x512 resolution (with a 256x256 mode) - the original program was 256x256 due to the resolution of Logisim's video screen component. (Logisim is the simulation program I used to simulate my CPU design - refer to my various videos to see what I mean).

Running

Start from either command line or icon. Once started, press 'h' to see the various keyboard controls. Or press '0' through '9', '-', or 'a' to go to preset areas of the fractals. To zoom, press either 'z' for zoom by opposing corners or 'x' for zoom by center to corner. Then click (and hold) left mouse button to select first point and drag to second point (and release). Press 'u' to undo the zoom. Zoom by default preserves the square aspect ratio. If that is not desired, press 'k' to toggle that feature off/on. Press 'p' to set or view the fractal parameters. BTW, to get images like the ones in my videos, lower the (iteration) limit to 255 (via parameters dialog box).

Also, right click on the title bar of the main window to get a menu option to save the current image to a PPM file.

Most of the keyboard controls can be put on the command-line as if you pressed them while the program is running. For example:

fractald 3-cd...

would choose Mandelbrot location #3 (3) to be displayed, then Mandelbrot location #4 (-), then color cycling enabled (c), then cycling direction changed (d), then cycling delta increased three times (.)

Building

Windows executables are provided, so there shouldn't be a need to build, but if you need to...

Assuming you're using Microsoft Visual Studio and assuming you have the DOS compiling environment set up (adjust accordingly for other IDEs):

nmake /f fractal.mak

This will make both the double and float versions of the fractal program.

If you don't want to use makefiles, it should be easy to make a solution file for this project (or whatever it will be called in future versions of Visual Studio).

Link to Linux Version

https://github.com/mrmcsoftware/FractalAsm-Linux

Manifest

fractald.c"double" version of x86 fractal program - higher precision, but most likely slower
fractalf.c"float" version of x86 fractal program
dialog.hDialog and Menu GUI ids
fractal.rcResource script file defining parameter dialog box, icon, etc.
fractal.exe.manifestManifest file to tell Windows to use newer common controls
fractal.icoIcon file
fractal.makMakefile
  
fractalb_not_x86.asmMy original fractal program for my CPU design
  
fractald.exe32-bit Windows executable (double version)
fractalf.exe32-bit Windows executable (float version)
  
fractal*.pngScreenshots
README.mdThis file

Demonstration Videos

My x86 assembly language tutorial video containing an earlier version of this fractal program (starting at 3:42)

Part 1 of that x86 assembly language tutorial

My CPU / computer design running my original fractal program written for that design

Author

Mark Craig https://www.youtube.com/MrMcSoftware

fractalasm's People

Contributors

mrmcsoftware avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

netindiapro

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.