9 Replies - 1162 Views - Last Post: 25 April 2013 - 08:13 AM

#1 Ahmed92  Icon User is offline

  • New D.I.C Head

Reputation: -8
  • View blog
  • Posts: 42
  • Joined: 10-August 12

How do I learn how to write a program in Binary?

Posted 23 April 2013 - 08:20 PM

It wasn't a troll post. I was going to make a topic on this. But I found this topic here. I want to create programs using raw binary.. where can I get started?
Is This A Good Question/Topic? 0
  • +

Replies To: How do I learn how to write a program in Binary?

#2 GunnerInc  Icon User is online

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,279
  • Joined: 28-March 11

Re: How do I learn how to write a program in Binary?

Posted 23 April 2013 - 08:32 PM

Seriously??? Why??? Lean Assembler, it is as close to binary/machine as you can get without spending years learning different executable formats, opcodes, encodings, etc...

We will split this into another topic...
Was This Post Helpful? 1
  • +
  • -

#3 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5800
  • View blog
  • Posts: 12,635
  • Joined: 16-October 07

Re: How do I learn how to write a program in Binary?

Posted 24 April 2013 - 05:33 AM

Binary ain't a language. It's just zeros and ones. And while computers ultimately break everything down to that, they actually tend to think in larger atoms. Sometimes bytes, usually some base register size.

What you want is "machine language." This is the lowest level there is. However, humans tend to use assembly because you can write one to one with machine code and still have handy names like MOV as opposed to something like 88.

Learn assembly, if you really want to understand machine language. It's interesting to look at the tree bark in the forest, sometimes. Next level up from assembly can be C, depending on your bend.
Was This Post Helpful? 1
  • +
  • -

#4 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7641
  • View blog
  • Posts: 12,884
  • Joined: 19-March 11

Re: How do I learn how to write a program in Binary?

Posted 24 April 2013 - 06:29 AM

As I said in your other thread on this, the Altair is probably the most recent machine that was actually equipped to be programmed directly in binary - that is, by entering machine instructions and memory addresses in binary. For every machine since, you have to go to a lot of effort to go to all that effort.

View Postbaavgai, on 24 April 2013 - 07:33 AM, said:

What you want is "machine language." This is the lowest level there is.


There are chip designers who might take exception to that claim. And eventually, I guess, there are physicists... :)
Was This Post Helpful? 1
  • +
  • -

#5 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3548
  • View blog
  • Posts: 10,989
  • Joined: 05-May 12

Re: How do I learn how to write a program in Binary?

Posted 24 April 2013 - 07:54 PM

Wouldn't that be CISC chip designers who would take offense? I was given the impression (maybe incorrectly) that RISC chip designers didn't use any micro-operation languages.
Was This Post Helpful? 0
  • +
  • -

#6 CSatVTftw  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 42
  • Joined: 16-April 13

Re: How do I learn how to write a program in Binary?

Posted 24 April 2013 - 08:42 PM

Try taking a simple program (write a C++ for loop that prints 1-10) in a high-level language and converting it all the way down, through assembly, to binary machine code. Then see if you still want to do this. Binary is fun for novelty clocks and such if you can read it, but working with it sucks IMO.
Was This Post Helpful? 0
  • +
  • -

#7 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7641
  • View blog
  • Posts: 12,884
  • Joined: 19-March 11

Re: How do I learn how to write a program in Binary?

Posted 24 April 2013 - 08:47 PM

Binary's fine, if you're doing math. Being able to think in binary and hex is pretty handy - and pretty essential for some problems (very handy for crypto). It's more the memorizing a bunch of machine-specific codes to exercise tiny little operations on numbered memory locations that gives me the heebie-jeebies.

But whatever - go for it if it's what you have a yen to do. Can't do any harm, really.
Was This Post Helpful? 0
  • +
  • -

#8 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5800
  • View blog
  • Posts: 12,635
  • Joined: 16-October 07

Re: How do I learn how to write a program in Binary?

Posted 25 April 2013 - 03:49 AM

View Postjon.kiparsky, on 24 April 2013 - 09:29 AM, said:

View Postbaavgai, on 24 April 2013 - 07:33 AM, said:

What you want is "machine language." This is the lowest level there is.


There are chip designers who might take exception to that claim.


Picking nits.

I assumed the scope of the question was computer programming. In the context of volatile instruction sets in RAM. How the hell do you expand that to crap burnt on hardware? :P
Was This Post Helpful? 0
  • +
  • -

#9 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3548
  • View blog
  • Posts: 10,989
  • Joined: 05-May 12

Re: How do I learn how to write a program in Binary?

Posted 25 April 2013 - 06:19 AM

LOL! Good nits!

Anyway, I think that this should throw some good perspective. Yes, you can program by directly entering binary values, but consider that even the engineers who are designing the CPUs and GPUs are doing their design in microcode -- not in binary.

Spoiler

Was This Post Helpful? 0
  • +
  • -

#10 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5800
  • View blog
  • Posts: 12,635
  • Joined: 16-October 07

Re: How do I learn how to write a program in Binary?

Posted 25 April 2013 - 08:13 AM

Spoiler

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1