Jump to content

question about machine code


gib65

Recommended Posts

Isn't it true that computers don't read anything but machine code? I'm having an argument with someone about that. He thinks computers don't read machine code except perhaps the BIOS. I've got a degree in computer science and I'm pretty sure I remember learning that the only information that goes through the CPU is instructions written in machine code. I'm right... right?

Link to comment
Share on other sites

And in the earliest days, only octal. I remember when hexadecimal was the new kid on the block. Made it easier for counting to 10, and for alphanumeric. An early example of dumbing-down!

 

Try writing a long division decimal routine in octal, testing for sign, overflow, end-carry, etc.

 

Loads of fun. What we had to do in those old days. Could not do it now.

Link to comment
Share on other sites

LOL, I rem being forced to learn Octal because I had no BCD 7 segment driver chips, I could have bought some but that meant leaving the house (I was quite anti-social back then).

I printed up a conversion chart on my Commodore PET and then memorised it, I kinda miss those days.

Link to comment
Share on other sites

This thread looks like it's going to turn into the Dilbert cartoon that finishes up with someone saying "Ones AND zeros? We had to make do with just zeros".

 

AND we didn't have chips, just trannies (germanium of course) and 0A81 diodes . (I could mention valves, but that would spoil the game):)

Link to comment
Share on other sites

I will trump your valves with my electro-mechanical comptometers, and I still have another winning card in my hand. Unless someone has the Ace of Abacus, or Queen of Quipu, in which case I capitulate immediately.

Link to comment
Share on other sites

Isn't it true that computers don't read anything but machine code? I'm having an argument with someone about that. He thinks computers don't read machine code except perhaps the BIOS. I've got a degree in computer science and I'm pretty sure I remember learning that the only information that goes through the CPU is instructions written in machine code. I'm right... right?

My computer read html just a few seconds ago - that's if I count the webbrowser and internet connection being part of the computer (and I do - they are very important parts). So why is the CPU the computer? I dunno why you think so but I will use this definition in the following:

If "the computer" was the CPU then on one of the more fundamental levels (not really the most fundamental, but the most fundamental that is reasonable to discuss) the only information that goes through the CPU is time-series of voltages - a completely useless statement :eek:. These time-series have a 1-to-1 mapping on larger scales up to assembly code. Above assembly code, the mapping is not 1-to-1; the same C++ program might generate different assembly code on different compilers, for instance. So since by that reasoning (I am only a stupid physicist not a smart computer scientist, so I might be wrong) the highest-level set of expressions that maps 1-to-1 on the intended function of the CPU is assembly, I would chose that as an answer.

 

However: I do disagree with equating "a computer reads" with "a CPU takes as input" - or with the two statements obviously being the same. Formally, the question also had to define whether "only reads X" is true if a computer reads Y and Y is equivalent to X, particularly for the CPU part.

Link to comment
Share on other sites

your computer parsed a series of 1`s and 0`s in an HTML format through Tables that broke it down into Machine code would be more accurate ;)

assembly language is just MC translated into mnemonics.

Well, if you consider "my computer" as say the whole part of the machine that is inside my room then physically it read some electromagnetic signals from its surrounding. Ignoring noise, analog-digital conversion, checksums and other technicallities, then logically it read a series of zeroes and ones, yes. However -and I am not sure to what extent this rather fundamental point in my last post became clear- it also read some ASCII characters. Bits and bytes and ASCII characters and hex-numbers are (stuff like "you need 8 bits to form a byte" aside) just different ways to encode the same information. Just like decimal and binary and hexadecimal are simply different ways to express a number; none of the systems being more fundamental than the others. So from "it read bits" or "it read bytes" or "it read ASCII" or "it read hex-code" none of the statements of more correct or fundamental than the other. With "highest level" in my previous post I meant "most human-readable" which is not a really outstanding but a very practical property among a set of equivalent formulations (MC is just assembly translated into numbers >:D).

Link to comment
Share on other sites

Isn't it true that computers don't read anything but machine code?

 

CPUs understand only the Instruction Set Architectures (i.e. machine code) they implement. CPUs are also able to interact with and transform data which isn't code. So, hard to say, given that sentence...

Link to comment
Share on other sites

  • 2 weeks later...

This is TRUE only for digital computers. Analog computers ( includes slide rules ) use a voltage or distance ( such as a slide rule ) to represent numeric values, e.g. pi could be represented by 3.14159 volts. In electronic analog computers the program is the wiring!

Link to comment
Share on other sites

  • 1 month later...
Isn't it true that computers don't read anything but machine code? I'm having an argument with someone about that. He thinks computers don't read machine code except perhaps the BIOS. I've got a degree in computer science and I'm pretty sure I remember learning that the only information that goes through the CPU is instructions written in machine code. I'm right... right?

hi,

Ya you are absolutely right.

Link to comment
Share on other sites

the AC128`s rock, I made my 1`st radio with those in 73, I`v made valve radios too, and also all the gates in valves, just for a giggle :)

 

I`v also made my own Valves before now too!

 

I want to make my own tubes for a tube amp.................

 

 

So we all just think in voltage differentials...................?????????????????

 

I say Answer:True but I don't like it very much. The whole idea leads to really hard to read threads that give me a headache. I really hope to make brain chips one day! They can do the thinking for me.....

Link to comment
Share on other sites

yup, but more specifically Binary.

the OP codes for the CPU are represented in HEX for us really.

you may tell him that a guy who has designed and built his own computer From scratch (chip level) told you this ;)

 

Just out curiousity, when you compile using gcc -c MyProgram.c (I think its -c) and view the the assembly code, the OP code there seems to be in regular english, not hex. Whats the difference?

Link to comment
Share on other sites

Assembly language is yet another stage further up the chain towards a high level language.

you may go ASM to HEX then down to raw Binary, after that it`s soldering iron level ;)

 

bear in mind tho, I don`t know any High Lev languages other than BASIC, so I can`t really much when it comes to C+ or the plethora of other new langs out there.

Link to comment
Share on other sites

look up mnemonics wait I'll do it........ah says look up assembly language................:)

 

I always thought of the HEX coding as assembler and the mnemonics as the english translation........

 

JMP FE

 

I like C++ .............mmmmmmmmm polymorphism and recursion!:P

Edited by buttacup
Link to comment
Share on other sites

Just out curiousity, when you compile using gcc -c MyProgram.c (I think its -c) and view the the assembly code, the OP code there seems to be in regular english, not hex. Whats the difference?

 

Assembly is considered a second-generation programming language (or 2GL). This means it's one level of abstraction above machine language, which is considered a first-generation programming language (or 1GL).

 

Languages with the expressive power of C (i.e. context-free languages) are considered to be third-generation programming languages (or 3GLs) because they exist at a level of abstraction above assembly language.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.