My very own twisted assembly and commands

Posted by Pirate-rob on Aug. 29, 2012, 2:04 p.m.

Now I've always wondered how the base of a pc works and what RAM and GHz and all that stuff mean. The only thing I really know is hard drive space. So I decided to make a program that simulates a PC the way I think it works.

Now to explain my way of understanding the inner works of PC:

I think that RAM is just a massive set of temporary variables that gets delete when the pc turns off.

I think that the hard drive is just a massive set of non temporary variables.

The GHz thing is how many assembly commands you run a second.

The screen is run by a massive array.

Now It has its own version of assembly and really bad syntax. I was wondering if anyone thinks there should be any other commands other then the ones listed below:

0001 - IF - The if statement

0002 - THEN - the then statement

0003 - END - the end to the if statement

0004 - SET VAR - sets a variable in the RAM to either a variable something returned or a number.

0005 - RANDOM - returns random value 0000-9999

0006 - Screen Red- sets a pixels red value on the screen

0007 - Screen Green - sets a pixels green value on the screen

0008 - Screen Blue - sets a pixels blue value on the screen

0009 - ADD VAR - Adds to a variable

0010 - ADD Multiply - Multiplies variable

0011 - KEY - key last pressed

0012 - GOTO - goto a line in the code

0013 - GETFILE - get a file/variable from the harddrive

0014 - SETFILE - set a file/variable to the harddrive

In case you want to try it for your self:

http://www.mediafire.com/?2v52c21q2ga2v1c

Syntax is a bit strange.

Comments

Pirate-rob 11 years, 8 months ago

Just trying to understand the first two lines of mega's code:

cmp [esp], $5 ;is esp == 5?
jne isFalse ;if it is not equal then jump to false

isTrue:
  ; Do something
 jmp end
isFalse:
 ; Do something else
end:
 ; And so on

Are my two above inserted comments correct?