Skip to content

About

Computer Structure and Language Project

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

8086 Graphical Particle Simulation

This is an interactive graphics program written in 16-bit x86 (8086) assembly, with about 1,600 lines of commented code. I wrote it for the Computer Structure and Language course.

What it does

Points move across the screen toward a target. When a moving point touches a point that has already stopped, it freezes and changes color, so a structure slowly grows out of the particles. You can move the target at any time with a mouse click. A score is shown at the end.

At startup the program asks for one of three modes:

Mode Behavior
0 Points start at random positions and all move at the same speed
1 Points get random speeds and directions
2 Fractal growth: particles wander in from the edges and stick to the cluster, which grows into a branching fractal shape

Technical details

  • Graphics: BIOS INT 10h for video mode and per-pixel drawing. The resolution is 320x200 (mode 13h) or 640x480.
  • Mouse: INT 33h for position and clicks.
  • Motion: each speed is split into x and y parts using v² = vx² + vy², computed with an integer square root routine.
  • Random numbers: a custom seeded generator for starting positions and speeds.
  • Structure: the code is organized into macros, a data section, setup procedures, the in-game loop (move, check collisions, redraw) and helper routines. Each procedure is documented.

Files

File Contents
NP.asm, mycode.asm Source code (two versions)
mycode.com Assembled program
details(persian).pdf, more details(persian).pdf Project write-up, in Persian

Running

  • emu8086: open NP.asm and run it. This works, but the simulator is slow.
  • DOSBox (faster):
  mount c path/to/this/folder
  c:
  mycode.com

About

Computer Structure and Language Project

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages