|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Yezhik Cheater Reputation: 2
Joined: 03 May 2011 Posts: 49 Location: NYC
|
Posted: Thu May 12, 2011 3:30 pm Post subject: Binary language and us |
|
|
Hey, I'm currently a Music Electrician student. So we are learning quite a bit about computers, IC's, processors, etc,. And I'm very happy because I'm extremely curious about how things work, especially with the internet and PC's.
So we basically learned how machines operate on machine language which we use an assembler language to translate whatever we have into the said machine language, and we use programming language to add visual effects and/or whatever we want.
So basically
Programming-> assembly -> machine
Now if machine comprehends hexidecimal, and in essence it just understands 0's and 1's
How in the world does it decipher which combination of 0's and 1's make what.
Meaning I can do hundreds upon thousands of 00010101010 or 1111111 or 00000010101 or whatever, and it can mean either the word LOLOLOLOLOL or some complex executable, or a pixel, or anything.
Can someone explain please?
I did ask the professor, but since this isn't what we focus or study on, I could ask so many questions until I felt I was the most annoying in the class LOL!
He did describe to me that certain programs send like a warning of bytes clarifying to the machine that we are using this set of 0's and 1's for this or for that.
I'm just very curious, if someone has the time to answer or elaborate upon this, please go ahead
Thanks
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Thu May 12, 2011 3:48 pm Post subject: |
|
|
Waaay to much to explain, but I'll give some basics (simplified, excluding caches like tlb and branch prediction, prefixes, etc...)
While memory can contain anything from LOLOLOLOL to actual code, it is the instruction pointer in the processor that decides what is currently being executed
Each tick the cpu checks the instruction pointer's address, then reads the bits from the memory the instruction pointer points to and then interprets them.
The code is pointed at by the instruction pointer in the processor and every clock cycle it fetches one (sometimes more) instruction from the instruction pointer and handles it.
It might for example read 10010001 and then decide to swap the AX and BX registers with eachother, or it reads 10010000 , and just do nothing
Or a bit more complex
It reads the bits 10111000 which tells the cpu that this current instruction is followed by 16 bits that should be copied into the AX register, which the cpu then also reads, adjusts the instruction pointer, and assigns the 16 bits to the AX register (I'm talking about 16-bit mode instructions here, if the cpu is in 32-bit processing mode it'd EAX and 32-bits following the first 8-bits)
And there are lots of other instructions like that, some easier, some a lot more complex, it just depends on the bits the cpu reads and what it assumes will come after that. Some of them change the instruction pointer, some of them read data from memory into the cpu, and others write data into memory from the cpu
Then there are some addresses that when written to cause the hardware to react (like updating the display), and there are also specific instructions that can signal hardware directly for whatever purpose you might have (Like setting the frequency of a sound generator)
And there is lots and lots and lots of other stuff , but just ask specifics
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Yezhik Cheater Reputation: 2
Joined: 03 May 2011 Posts: 49 Location: NYC
|
Posted: Thu May 12, 2011 3:59 pm Post subject: |
|
|
Thanks for taking the time to write that out, Yea I understands it's a very very broad question but I just wanna wrap my head around it, and I'm sorta getting there. I understand the part with the instruction pointer, makes more sense now.
Just curious you said if the CPU is in 32-bit processing mode meaning it needs 4 bytes to comprehend something? or it would just fill in whatever's missing with 0's?
And if I have a 64-bit windows installed, does that have anything to do with the amount of minimum bits it receives?
^^ very curious!
if you know a place/website where I could get this general info, please do redirect me!
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Thu May 12, 2011 4:01 pm Post subject: |
|
|
For 16->32 it depends on the instruction. Some work fine like always, others are upgraded to 32-bit automatically and need some 'prefix' instructions in front of it to temporarily switch the cpu to 16-bit mode
for 32->64 bit mode it's often the other way arround. If you want to access 64-bit instructions you usually have to use a prefix (bits in front of the actual instruction) to tell the cpu to go in 64-bit mode for this instruction
Read these pdf files:
http://www.intel.com/products/processor/manuals/
Updated regular and I know most of them by heart
The first few chapters of "Intel® 64 and IA-32 Architectures Software Developer's Manual Combined Volumes 2A and 2B: Instruction Set Reference, A-Z" describe instruction fetching
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Slugsnack Grandmaster Cheater Supreme Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
|
Back to top |
|
|
virtualdude How do I cheat? Reputation: 0
Joined: 15 May 2011 Posts: 3
|
Posted: Mon May 16, 2011 11:55 am Post subject: |
|
|
Machine code(Binary) Is a very complex system. It consists of positive and and negatives. A string is not written in binary, but in plain text. Machine code is for hardware, as it is for logic gates. Assembly is OPCODE AKA Processor instructions, to move bytes, etc.
|
|
Back to top |
|
|
ipivb Master Cheater Reputation: 5
Joined: 29 May 2010 Posts: 256
|
Posted: Mon May 16, 2011 2:10 pm Post subject: |
|
|
virtualdude wrote: | Machine code(Binary) Is a very complex system. It consists of positive and and negatives. A string is not written in binary, but in plain text. Machine code is for hardware, as it is for logic gates. Assembly is OPCODE AKA Processor instructions, to move bytes, etc. |
I found this a little misleading so allow me to point out that all computer data, included strings, pictures, videos, opcodes, addresses, etc are stored on the hard drive and in the memory as binary.
Machine code is practically unreadable to humans which is why we use programming languages like assembly or C++ to write code, but it is compiled into binary as an executable file.
You don't really need to know any of this for Music Electrician though.
|
|
Back to top |
|
|
hcavolsdsadgadsg I'm a spammer Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Mon May 16, 2011 4:36 pm Post subject: |
|
|
it's compiled to assembly which in turn is a series of bytes (opcodes) that make up the assembly instructions which in turn can be represented as any number of things that your heart desires, for the programmer at least. it's just another numerical representation.
'PENIS' or 50454E4953 or 344760142163 or 101000001000101010011100100100101010011
will equate to a push instruction (on x86 at least) and a couple others that I can't be assed to look up.
if you're thinking on levels of transistors, then there's only an on / off state (unless you somehow have access to whacky hardware like quantum computers)
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|