PDA

View Full Version : how do you code in binary...



DavidP
01-26-2003, 10:27 PM
How do you actually physically get to a place in the computer that lets you code in binary...

To code in C++, you go to a text editor or a compiler.
To code in Pascal, you do the same.
To code in BASIC, you do the same.
To code in Assembly, you enter Debug in DOS, an assembler, a text editor, etc...

But what about binary?

A hex editor is hex...not binary...
An assembler is assembly...not binary...

Where can you actually physically code in binary in a computer...

Polymorphic OOP
01-26-2003, 10:52 PM
Originally posted by DavidP
But what about binary?

A hex editor is hex...not binary...
An assembler is assembly...not binary...

Where can you actually physically code in binary in a computer...

Binary isn't a language, machine codes are. Programming in assembly is generally one-to-one with programming in machine code so there really isn't a need to program in machine code using binary.

You can program in machine code using binary, hex, octal, decimal -- any base you want. They're all just number systems. What makes you think you think doing it in hex is any different from binary? Coding in machine code using hex does the exactly the same thing as using binary. There is no difference when it's stored in the computer, they're just two different ways of writing numbers for people, not software.

BMJ
01-26-2003, 11:32 PM
The reason we have hex codes, and octal codes are so that we don't have to use binary :p

no-one
01-27-2003, 12:19 AM
i suppose you'd use a compiler...

>Binary isn't a language,

i think your wrong here, binary(aka. machine code) is the computers language, its all it understands, and you can also program in binary, both would classify it as a language, but, again if you want to argue we fall in to symantics, and therefore its pointless.

an example of what binary, hex, ect... would probably look like.

http://www.otterbein.edu/home/fac/DPTSNDR/csc150/notes/chapter6asm.html

Polymorphic OOP
01-27-2003, 01:13 AM
Originally posted by no-one
i think your wrong here, binary(aka. machine code) is the computers language, its all it understands, and you can also program in binary, both would classify it as a language, but, again if you want to argue we fall in to symantics, and therefore its pointless.

No, binary isn't AKA machine code. There are two completely different things. They are just refered to as the same thing out of ignorance.

Binary isn't a language, it's just the medium. Binary by itself just represents numbers or combinations, it's not a language. An infinite number of languages can be "built from" binary. It's simply a way of representing different values. Machine code is NOT binary, it's just the "alphabet" or "number system" that machine code uses.

If binary was a language then 1001010011 would have a specific meaning, but in actuality, it doesn't. It all depends on which machine code you are using. If binary were a language, then I could say "this is binary code, tell me what it means," but that is not possible because it can be used to represent an infinite number of languages, all binary is is a medium. Binary itself is just a number system, nothing more.

npc
01-27-2003, 04:15 AM
uh oh, here we go again... lol, I think I was debating this issue with you a while ago, poly. eventually i agreed with you. anyways, i was looking through an algorithms book i used last semester (referencing to pg. 975 of "intro. to algorithms"; cormen, leiserson, rivest, stein; 2nd edition; great book by the way!) and it states:

"an alphabet sigma is a finite set of symbols. a language L over sigma is any set of strings made up of symbols from sigma. for example, if sigma = {0, 1}, the set L = {10, 11, 101, 111, 1011, 10001, ...} is the language of binary representations of prime numbers".

my intepretation of this is that what we call binary is really used as an alphabet, not a language. It's when you start creating strings, out of the symbols provided by the alphabet, and representing these strings with meaning (i.e. encoding information within these strings) that you have a language. for example, the language of prime numbers mentioned.

but something else interesting also popped in my mind. poly, you state that:

"You can program in machine code using binary, hex, octal, decimal -- any base you want. They're all just number systems."

But i think this is just as wrong as stating that binary is a language! I would have to argue that the term binary, by itself, shouldn't be thought of as a number system. because numbers, like op codes for some processor, is also a language. we use the binary alphabet (just a set of 2 symbols) and we encode this concept of numbers in that alphabet. another way of thinking about this is like not only do we encode op codes in binary, but we also encode data that we wish to process with op codes in binary. data, which can mean numbers.

To the original post: "How do you actually physically get to a place in the computer that lets you code in binary..." open up your case, remove your heatsink + fan, remove the cpu from its socket, apply ground and 5 volts vcc to various cpu pins and hope something's going on inside. edited: i forgot, you also need a clock signal!

no-one
01-27-2003, 04:40 AM
>
No, binary isn't AKA machine code. There are two completely different things. They are just refered to as the same thing out of ignorance.
<

Look, your wrong, binary however you want to define it is machine code plain and simple.

>
If binary was a language then 1001010011 would have a specific meaning, but in actuality, it doesn't. It all depends on which machine code you are using. If binary were a language, then I could say "this is binary code, tell me what it means," but that is not possible because it can be used to represent an infinite number of languages, all binary is is a medium. Binary itself is just a number system, nothing more.
<

Your logic is total wrong and contradictory. silently to yourself try and make some sense out of what you've said, think about each part, your not correct.

now i reiterate
"if you want to argue we fall in to symantics, and therefore its pointless."

so, im done arguing with you, arguing over symantics it useless stupid and worthless, thats why i said it the first time so as to stop any arguement, NOTE THE "i think" AS THE FIRST TWO WORDS!, this is to SIGNIFY AND OPINION AND THAT I DONT WANT TO ARGUE, i stated it in that way so as to prevent just this, and to KEEP THE THREAD ON TOPIC!
it was a contridictory opinion not an arguement.

i'm gonna avoid a lecture here as much as i can, but im starting to get ........ed here. Your over defensive and comming off like a smart ass telling people who have been doing this many years longer than you wrong or not they're ignorant, and im not just refering to me.

let it die, so his question might get an answered.

RoD
01-27-2003, 05:01 AM
Hmm normally i wouldn't contribute to a disagreement, but its two on one so i feel my position valueable, as it evens things out. The way we were taught in CS, and the way i understand it in my daily life, poly is totally correct here.

adrianxw
01-27-2003, 05:04 AM
The "is binary a language or not" was done to death here...

http://cboard.cprogramming.com/showthread.php?s=&threadid=29643

... there was no concensus, just a lot of semantic juggling. This discussion is not relevent to the question.

Enough.

Polymorphic OOP
01-27-2003, 05:13 AM
Originally posted by no-one
Look, your wrong, binary however you want to define it is machine code plain and simple.

Your logic is total wrong and contradictory. silently to yourself try and make some sense out of what you've said, think about each part, your not correct.

now i reiterate
"if you want to argue we fall in to symantics, and therefore its pointless."

Your over defensive and comming off like a smart ass telling people who have been doing this many years longer than you wrong or not they're ignorant, and im not just refering to me.

let it die, so his question might get an answered.

You're the one who's making a big deal out of things here. I gave several reasons why not to call binary a language, and all you say is "I'm wrong and you're right" without any backing. People come here looking for precise answers and I don't see anything wrong in them hearing multiple views on the subject. Pardon me if I disagree with you, people are entitled to their own views and their ability to express them.

I agree, let's end the this particular discussion.

However, I do have something else to say...

I can't stand your attitude. Every single time I've disagreed with you or someone else on the boards and you've posted a reply, you resort to just bringing up experience. I respect you and Sayeh (and anyone else with a lot of experience) for this, however, "experience" doesn't mean you're right and someone with less experience is wrong. There have been times that I've been right and there have been times when I've been wrong. There have also been times where people with lots of experience here have been proven wrong as well. If you have an opinion, state it and explain why. "I have experience so you are therefore wrong" isn't backing to an opinion. I may not be as old to you or have been programming as long, but at least I'm not a jerk to other people in the boards (well, not usually :rolleyes: ) and at least I take the time to explain my views. If you disagree then say so, but then give a reason why.

I wasn't trying to attack you here and I'm sorry that you took it as that. I agree, let's end this now. My point is that everyone has something to learn here, whether you are very experienced or not. Don't pass things off that other people say as wrong when you don't explain why you disagree. Otherwise you're just flaming.

Again, if you are offended, I'm sorry. This isn't the first time something like this has happened and I had to get that off my chest.

Scourfish
01-27-2003, 05:36 AM
very carefully

RoD
01-27-2003, 05:48 AM
Originally posted by Scourfish
very carefully

LMAO!

DavidP
01-27-2003, 12:15 PM
Poly, I fully understand that binary is a number system....HOWEVER....there are things in this world that go by several different names and nicknames.

If you are anal about everything in the world just like you are about calling machine code by its proper name, you wont be getting anywhere, and for this purpose, I am calling machine code binary. Why? Because it is binary in essence. Computer only respond to a true or false value, not to a hexidecimal number. So...now that we have that established...once again I ask my question:

How do you get to a place in the computer that actually lets you code in binary.

adrianxw
01-27-2003, 05:14 PM
David (et al):

I have entered code in binary. I will not be drawn again into a semantic dispute as to whether binary is or is not a language. The machines I "programmed" in binary, note the quotes had no other form of input. Today, that is not necessary. If you want to "program" your machine in binary, note the quotes then write a simple program that will allow you to say "11001100 carriage return", and write/append the resulting byte to a file you have opened for binary writing, and given a ".exe" extension.

Now all you have to do is read and understand enough about the format of a .exe or whatever the executable format is for your target operating system, to know exactly what it is you need to enter at your prompt. Then you can just run it.

You really don't want to do this.

General:

One more crack and it's deleted - OKAY.