Setting up the environment isn't really that hard, it is a simple as downloading, extracting and placing in the directory of your choice and then setting up the environment variables properly. This guide is targeted for users on Windows
7 32-bit / 64-bit editions of Windows. If you have XP or Vista, the steps might be a little different.

Steps

MinGW will be an executable installer so follow the instructions and install like you would normally do. For NASM extract the archive to a directory of your choice. Remember both the directory of both NASM and MinGW because it is important for the next
steps.

Go to:

Then Right Click On Computer And Click Properties:

Then a new Window should appear click on the Advanced Settings link:

Then a dialog should appear and click on Environment Variables:

Then another dialog should appear look for the %PATH% environment variable:

Finally click on Edit to Edit the environment variable and added both paths of the bin folder of both NASM and MinGW. Separate each path using semi-colon as the delimiter.

Testing If Setup Was Correct

Open your favorite command-line shell (whether it is Command Prompt, Command, PowerShell, Bash (Wait this isn't Linux), Terminal (Wait this isn't Mac OS X). Then type gcc -v and you should see the version of gcc. If the shell cannot find the external
command either the setup was incorrect or you need to restart the command-line shell. If restarting doesn't solve the problem. Post the issue in the discussions tab.