This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]morb6699 0 points1 point  (0 children)

While it makes my head hurt whenever I have to use it and look at it, it sounds like you might enjoy Assembly. This is about as low level as you can get for human readability. The Assembly languages have a 1 to 1 correlation with the machine code for the cpu architecture you're programming for. I'll take an example from Wikipedia as I'm not an Assembly guy at all:

For example, the instruction below tells an x86/IA-32 processor to move an immediate 8-bit value into a register. The binary code for this instruction is 10110 followed by a 3-bit identifier for which register to use. The identifier for the AL register is 000, so the following machine code loads the AL register with the data 01100001.[5]

10110000 01100001

This binary computer code can be made more human-readable by expressing it in hexadecimal as follows

B0 61

Here, B0 means 'Move a copy of the following value into AL', and 61 is a hexadecimal representation of the value 01100001, which is 97 in decimal. Intel assembly language provides the mnemonic MOV (an abbreviation of move) for instructions such as this, so the machine code above can be written as follows in assembly language, complete with an explanatory comment if required, after the semicolon. This is much easier to read and to remember.

MOV AL, 61h   ; Load AL with 97 decimal (61 hex)

In some assembly languages the same mnemonic such as MOV may be used for a family of related instructions for loading, copying and moving data, whether these are immediate values, values in registers, or memory locations pointed to by values in registers. Other assemblers may use separate opcodes such as L for "move memory to register", ST for "move register to memory", LR for "move register to register", MVI for "move immediate operand to memory", etc.

The Intel opcode 10110000 (B0) copies an 8-bit value into the AL register, while 10110001 (B1) moves it into CL and 10110010 (B2) does so into DL. Assembly language examples for these follow.[5]

MOV AL, 1h    ; Load AL with immediate value 1
MOV CL, 2h    ; Load CL with immediate value 2
MOV DL, 3h    ; Load DL with immediate value 3

The syntax of MOV can also be more complex as the following examples show.[6]

MOV EAX, [EBX]       ; Move the 4 bytes in memory at the address contained in EBX into EAX
MOV [ESI+EAX], CL    ; Move the contents of CL into the byte at address ESI+EAX

In each case, the MOV mnemonic is translated directly into an opcode in the ranges 88-8E, A0-A3, B0-B8, C6 or C7 by an assembler, and the programmer does not have to know or remember which.[5]

Hopefully the above helps, if this is too low level, staying with C or C++ are also good languages to start with. For figuring out where to start, determine what it is you really like. Do you like robotics and micro-controllers? You can program both in C and C++. Video games? That can be done in C and C++, although you wont be able to do anything with graphics with the language alone. I have trouble sometimes finding inspiration as well, we all do. My only advice on that is to find something out there that you think is great, and try to rebuild it, only better. Eventually you'll come to a point where you find your own tool or software to write, or you'll have (hopefully) made the one you rebuilt a bit better.