Quote (NinjaSushi2 @ 31 Jan 2014 05:36)
Ah I see. So the os hands down the initial machine code values. Then any other higher languages would modify such values as need fit.
it really depends on the architecture of the specific machine and it's operating system, the following is partly right
Quote (Azrad @ 31 Jan 2014 11:21)
yeah but your use of the word modify is problematic. Lets take the binary value: 00110101, which in base10 is 53
add:
if you call a function that adds numbers with 00110101 with 00000001; you will get 00110110 or in base 10 you get 54
print
if you call a function that prints to the screen with 00110101; you will get "5" on the screen because base10 53 is ascii for the character "5"
pointer:
if you call a function to expects an memory location as an input with 00110101; the function will use whatever is stored in memory location 00110101 and use that as its input
silly:
you might even have a function that expects this kind of input based on each digit of binary:
male?:hashair?:over30?:likecupcakes?:collegegraduate?:HasDiabetes?:PlaysD2?:LikesTurtles: in which case 00110101 would mean: A woman, who is bald, who is over 30, who likes cupcakes, is not college graduate, has diabetes, does not play d2, and like turtles.
except that the 'silly' is really a string of true/false with the interpretation left to the particular program you are using
to give you a few more options:
the string 11111111 will for some architectures mean -0, then 11111110 is -1 and 10000000 is -127 and for other architectures the string 11111111 is -1, with 11111110 being -2 and 10000000 = -128 (check up on one's and two's complement - both are different to what you got) and don't forget that there are plenty different architectures based on different "word/byte" lengths/numbers:
8-bit, 9-bit, 16-bit, 32-bit, 36-bit, 48-bit and 64-bit architectures i have used (and there are/were more like 6-bit and 128-bit)
the 'data' might as well refer to a hardware function which can be executed, not just data
also as indicated by "Azrad" it can be a pointer and some architectures use the first bit as indirect indicator, that is the following bits give the adr where you go or pick up data but if the first bit is set the rest is an adr which can again be a pointer etc etc etc
in the end it depends on the machine code what that string of bits means at the bottom level and then you can manipulate it yourself on the program level
the most interesting one i remember is within a 16-bit architecture which used to pack 3 characters into one 16-bit word, effectively using 5 1/3 bits for each character
hope you are now fully confused

@ "Minkomonster"
no general problem with your description but
assemblers do not compile, they assemble/translate either in single or multiple phases
basic assembly instructions are just mnemonic representation of machine code
some assembly languages have/allow for a macro layer to make the coding faster/easier
This post was edited by brmv on Feb 2 2014 01:41am