• Starting today August 7th, 2024, in order to post in the Married Couples, Courting Couples, or Singles forums, you will not be allowed to post if you have your Marital status designated as private. Announcements will be made in the respective forums as well but please note that if yours is currently listed as Private, you will need to submit a ticket in the Support Area to have yours changed.

  • CF has always been a site that welcomes people from different backgrounds and beliefs to participate in discussion and even debate. That is the nature of its ministry. In view of recent events emotions are running very high. We need to remind people of some basic principles in debating on this site. We need to be civil when we express differences in opinion. No personal attacks. Avoid you, your statements. Don't characterize an entire political party with comparisons to Fascism or Communism or other extreme movements that committed atrocities. CF is not the place for broad brush or blanket statements about groups and political parties. Put the broad brushes and blankets away when you come to CF, better yet, put them in the incinerator. Debate had no place for them. We need to remember that people that commit acts of violence represent themselves or a small extreme faction.
  • We hope the site problems here are now solved, however, if you still have any issues, please start a ticket in Contact Us

  • The rule regarding AI content has been updated. The rule now rules as follows:

    Be sure to credit AI when copying and pasting AI sources. Link to the site of the AI search, just like linking to an article.

Binary programming

N

Nanopants

Guest
Yikes, that would be a nightmare. It would be infeasible to program a machine using only binary, and at the bare minimum you'd need to use assembly which is still going to give you a migraine.

I'm guessing that you're worried about efficiency. That being the case, native code like C or C++ is what I think you're looking for, because it's only compiled once instead of at run-time.
 
Upvote 0

EphesiaNZ

It's me! Who else could it be...
Apr 19, 2011
5,471
453
New Zealand
✟30,297.00
Gender
Male
Faith
Christian
Marital Status
Married
Hi folks,
Does anyone know how I go about programming a computer to function on pure binary code, rather than any high-level computing language?
Thanks

The nearest you will get to pure binary is assembly language. This means you will be manipulating bits using mnemonics. Before you even start to think about this you will need a pretty good understanding about 32 and 64bit addressing etc..

Not for the faint hearted!

As suggested, learn a language like C if you've never tackled anything like this before as C will give you some insight into how the machine handles instructions at a lower lever.
 
Upvote 0

cyberlizard

the electric lizard returns
Jul 5, 2007
6,268
569
57
chesterfield, UK
Visit site
✟40,065.00
Faith
Messianic
Marital Status
Married
i concur. years ago back in the 8 bit days of the z80 I had to write hexcode for a custom firmware, this itself was an absolute nightmare.

stick with the tried and tested, either an object C or if you think you have a really good grasp of system processes then use assembler, but make sure you have a first rate IDE.


Steve
 
Upvote 0

EphesiaNZ

It's me! Who else could it be...
Apr 19, 2011
5,471
453
New Zealand
✟30,297.00
Gender
Male
Faith
Christian
Marital Status
Married
i concur. years ago back in the 8 bit days of the z80 I had to write hexcode for a custom firmware, this itself was an absolute nightmare.

Yep I did 6502 assembly programming back in the 80's, was actually quite enjoyable when it was 8 bits.
 
Upvote 0

cyberlizard

the electric lizard returns
Jul 5, 2007
6,268
569
57
chesterfield, UK
Visit site
✟40,065.00
Faith
Messianic
Marital Status
Married
i must say that I actually enjoyed coding back then when things were just getting going than I do today. the API's have pretty much all been written and libraries have been created which remove the need to create personal code.

:-(



Steve
 
Upvote 0

lesliedellow

Member
Sep 20, 2010
9,654
2,582
United Kingdom
Visit site
✟119,577.00
Faith
Calvinist
Marital Status
Single
Politics
UK-Liberal-Democrats
Hi folks,
Does anyone know how I go about programming a computer to function on pure binary code, rather than any high-level computing language?
Thanks

I know one person who can program directly into machine code, but the lowest level language any sane person uses is assembly language - even when they are writing something like an operating system.

If you really wanted to hand code machine language, you would have to download the technical reference manuals, for the processor you are interested in, from the manufacturer's website.
 
Upvote 0

ThatRobGuy

Part of the IT crowd
Site Supporter
Sep 4, 2005
30,146
17,594
Here
✟1,587,920.00
Country
United States
Gender
Male
Faith
Atheist
Marital Status
Single
Politics
US-Others
Might I ask why you'd want to do that?

In 2014, with all of the tools, SDK's, and IDE's available to make programming more efficient, why would you want to go back to the stone age?

Speaking as a 9 year veteran in the biz, I'd never want to do that nor am I aware of anyone looking to hire someone to do that.

For the time/effort it'd take to write a business application in binary or assembly, the average developer could have it written 50x over using C#, VB, or Java.
 
Upvote 0

EphesiaNZ

It's me! Who else could it be...
Apr 19, 2011
5,471
453
New Zealand
✟30,297.00
Gender
Male
Faith
Christian
Marital Status
Married
Might I ask why you'd want to do that?

In 2014, with all of the tools, SDK's, and IDE's available to make programming more efficient, why would you want to go back to the stone age?

There would be some applications programming that would require assembler to get the job done, thinking off the top of my head something like NASA high end stuff maybe. While the tools you have mentioned such as SDK and IDE's make it more efficient to code it can also lead to development laziness and security bugs. Reusing old code etc might avoid reinventing a wheel when developing an app but how many often is that reused code audited for any flaws - my bet is never or not very often.

Can you trust 100% that API's you might use in development are without flaw?

I always maintain that C should be a coders first language as it has the elements of a high and low level approach which in my view makes for a better programmer.

As you say though, for general apps, most high level languages will suit a given purpose. A case of horses for courses but, if someone wanted to learn binary or assembler then I say go for it because without the people that care to use it, you devs would not have a very easy time of it eh!
 
Upvote 0

lesliedellow

Member
Sep 20, 2010
9,654
2,582
United Kingdom
Visit site
✟119,577.00
Faith
Calvinist
Marital Status
Single
Politics
UK-Liberal-Democrats
For the time/effort it'd take to write a business application in binary or assembly, the average developer could have it written 50x over using C#, VB, or Java.

I can remember effing and blinding, because something which would have been absolutely trivial to do in C was well high impossible in C#. As the supposed ease of use goes up, flexibility goes down.
 
Upvote 0

EphesiaNZ

It's me! Who else could it be...
Apr 19, 2011
5,471
453
New Zealand
✟30,297.00
Gender
Male
Faith
Christian
Marital Status
Married
Let's also remember that C# and VB (and other MS based languages) are not truly cross platform - yes I know about Mono but that's a dead duck. C and C++ transfer to other platforms far easier. And Java which is regarded as the one true cross platform language achieves it but at the cost of speed and security.
 
Upvote 0

dysert

Member
Feb 29, 2012
6,233
2,240
USA
✟128,004.00
Gender
Male
Faith
Christian
Marital Status
Married
Might I ask why you'd want to do that?

In 2014, with all of the tools, SDK's, and IDE's available to make programming more efficient, why would you want to go back to the stone age?

Speaking as a 9 year veteran in the biz, I'd never want to do that nor am I aware of anyone looking to hire someone to do that.

For the time/effort it'd take to write a business application in binary or assembly, the average developer could have it written 50x over using C#, VB, or Java.
Speaking as a 35-year veteran in the biz, I can imagine wanting to do that for a fun challenge or to wax nostalgic. You're right, though, I rather doubt that any employer would be looking to hire someone who is versed in binary programming. (At least I've never seen it.)
 
Upvote 0

dysert

Member
Feb 29, 2012
6,233
2,240
USA
✟128,004.00
Gender
Male
Faith
Christian
Marital Status
Married
There would be some applications programming that would require assembler to get the job done, thinking off the top of my head something like NASA high end stuff maybe. While the tools you have mentioned such as SDK and IDE's make it more efficient to code it can also lead to development laziness and security bugs. Reusing old code etc might avoid reinventing a wheel when developing an app but how many often is that reused code audited for any flaws - my bet is never or not very often.

Can you trust 100% that API's you might use in development are without flaw?

I always maintain that C should be a coders first language as it has the elements of a high and low level approach which in my view makes for a better programmer.

As you say though, for general apps, most high level languages will suit a given purpose. A case of horses for courses but, if someone wanted to learn binary or assembler then I say go for it because without the people that care to use it, you devs would not have a very easy time of it eh!
Not quite sure what point(s) you're making, but I daresay that there will be fewer bugs in a program written in a HLL than one written in binary code. (And it will be a WHOLE lot easier to debug!)
 
Upvote 0

dysert

Member
Feb 29, 2012
6,233
2,240
USA
✟128,004.00
Gender
Male
Faith
Christian
Marital Status
Married
I can remember effing and blinding, because something which would have been absolutely trivial to do in C was well high impossible in C#. As the supposed ease of use goes up, flexibility goes down.
As a C and C# programmer, I'd like to see an example where something that is trivial in C is almost impossible to do in C#.
 
Upvote 0

EphesiaNZ

It's me! Who else could it be...
Apr 19, 2011
5,471
453
New Zealand
✟30,297.00
Gender
Male
Faith
Christian
Marital Status
Married
Not quite sure what point(s) you're making, but I daresay that there will be fewer bugs in a program written in a HLL than one written in binary code. (And it will be a WHOLE lot easier to debug!)

Well I wont reiterate myself if you can't understand what I'm saying but please read this news story affecting our schools national payroll system.

Govt set to take over Novopay payroll system | Stuff.co.nz

It's been a complete and utter shambles from the developers of the system entrusted (at great expense) to come up with a solution. My guess is that C#, SDK's, IDE's and other gizmo's were used to make this garbage solution.

Unfortunately this scenario is replicated across the world. I believe you had a online govt health system in the US which didn't get off the ground without some issues. Another one in UK which was scrapped and wasted 11 billion pounds in total - not all programming related but the core failures happened in and around it.

These guys are so called experts using the latest and greatest at their disposal. Given your quote I'm glad they didnt use binary or assembler but I guess the end result could have been the same or even better...
 
Upvote 0

dysert

Member
Feb 29, 2012
6,233
2,240
USA
✟128,004.00
Gender
Male
Faith
Christian
Marital Status
Married
Well I wont reiterate myself if you can't understand what I'm saying but please read this news story affecting our schools national payroll system.

Govt set to take over Novopay payroll system | Stuff.co.nz

It's been a complete and utter shambles from the developers of the system entrusted (at great expense) to come up with a solution. My guess is that C#, SDK's, IDE's and other gizmo's were used to make this garbage solution.

Unfortunately this scenario is replicated across the world. I believe you had a online govt health system in the US which didn't get off the ground without some issues. Another one in UK which was scrapped and wasted 11 billion pounds in total - not all programming related but the core failures happened in and around it.

These guys are so called experts using the latest and greatest at their disposal. Given your quote I'm glad they didnt use binary or assembler but I guess the end result could have been the same or even better...
Believe me, you can write horrible code no matter what language you use. I've seen horrible code in lots of different languages -- including assembler. There have probably been books written about various system disasters (and if you know of any, I'd like to read them). I think the point is that no matter what tools you're using to develop a system, if you're not a system developer it's going to be a mess. (I love the old quote, "It's a poor workman who blames his tools.")
 
Upvote 0

EphesiaNZ

It's me! Who else could it be...
Apr 19, 2011
5,471
453
New Zealand
✟30,297.00
Gender
Male
Faith
Christian
Marital Status
Married
Believe me, you can write horrible code no matter what language you use. I've seen horrible code in lots of different languages -- including assembler.

Yes I've seen lots in my time and some of it mine - I'm more of a systems/networking guy so that's my excuse :)

I guess where my thoughts on code auditing comes from is the recent (or not so recent) heartbleed bug in OpenSSL. A pretty good example of code getting added and left in when no longer needed. When the OpenBSD team forked it into LibreSSL they removed close to 100,000 lines of code in just the first week of auditing.

With the Novopay article I highlighted, the company involved is not the run of the mill dev shop. There's some serious money/investment behind this company so I doubt they would have the wrong type of developers on the job.
 
Upvote 0

lesliedellow

Member
Sep 20, 2010
9,654
2,582
United Kingdom
Visit site
✟119,577.00
Faith
Calvinist
Marital Status
Single
Politics
UK-Liberal-Democrats
As a C and C# programmer, I'd like to see an example where something that is trivial in C is almost impossible to do in C#.

I can't remember the details now, but I wanted to encrypt a string without using one of the library functions.
 
Upvote 0

lesliedellow

Member
Sep 20, 2010
9,654
2,582
United Kingdom
Visit site
✟119,577.00
Faith
Calvinist
Marital Status
Single
Politics
UK-Liberal-Democrats
Speaking as a 35-year veteran in the biz, I can imagine wanting to do that for a fun challenge or to wax nostalgic. You're right, though, I rather doubt that any employer would be looking to hire someone who is versed in binary programming. (At least I've never seen it.)

I hope the said employer is not in the business of producing operating systems or compilers.

mov al, 0d0h
out 64h, al

en_2:
in al, 64h
test al, 1
jz en_2

in al, 60h
or al, 2
mov ah,al

en_3:
in al, 64h
test al, 2
jnz en_3

mov al, 0d1h
out 64h, al
mov al,ah
out 60h, al
Would any of today's illiterates care to tell me what that snippet of code does, and what its C# counterpart would look like?
 
Last edited:
Upvote 0