9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: David Hoskin <root@davidrhoskin.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hexadecimal code?
Date: Mon,  3 Nov 2014 15:18:39 -0800	[thread overview]
Message-ID: <CACV-OriX1m-T=TcAn-Hy4GCtrocL--M75g2ye=feoz2ZKuM36w@mail.gmail.com> (raw)
In-Reply-To: <CAK_6Rwdv9J4s=U0nX0GhxOxB9vT=AThJv-_fTuYeG=uOoJ+91Q@mail.gmail.com>

It's certainly possible!

If your machine doesn't have those cool front panel toggle switches,
just use this simple compiler:

#include <u.h>
#include <libc.h>

void
main(void)
{
	char buf[8];
	int i;
	char c;

	while(read(0, buf, 8) == 8){
		c = 0;
		for(i = 0; i < 8; ++i){
			switch(buf[i]){
			case '0':
				break;
			case '1':
				c |= 1 << (7 - i);
				break;
			default:
				exits("two");
			}
		}
		write(1, &c, 1);
	}

	exits("");
}

> Is another machine code?

Octal is popular for these things.

-- David


On 11/3/14, françai s <romapera15@gmail.com> wrote:
> I intend to write in lowest level of computer programming as a hobby.
>
> It is true that is impossible write in binary code, the lowest level of
> programming that you can write is in hexadecimal code?
>
> What is the lowest level of programming computers that you can write ?
>
> Is binary code?
>
> Is hex code?
>
> Is another machine code? Honestly do not know if it is true that there is
> another machine code beyond the binary and hex code.
>
> Is Assembly?
>



      reply	other threads:[~2014-11-03 23:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-03 22:39 françai s
2014-11-03 23:18 ` David Hoskin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACV-OriX1m-T=TcAn-Hy4GCtrocL--M75g2ye=feoz2ZKuM36w@mail.gmail.com' \
    --to=root@davidrhoskin.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).