The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,854 other subscribers

Why octal is important (via @jpluimers on Twitter: “@b0rk @jilles_com Acids vs bases.”)

Posted by jpluimers on 2026/03/03

A few years back I tweeted [Wayback/Archive] Jeroen Wiert Pluimers @wiert@mastodon.social on Twitter: “@b0rk @jilles_com Acids vs bases.”

Ph scale of acids vs bases.

It was a kind of tongue-in-cheek reaction (with a way better picture below) to a very valuable post by b0rk (Julia Evans) on both Twitter and Mastodon [Wayback/Archive] Julia Evans on Twitter: “bases” / [Wayback/Archive] Julia Evans: “bases title: bases # we usually…” – Mastodon for two reasons:

  1. There are various interpretations of bases
  2. Octal is very important to educate as errors introduced by its support are hard to spot even if you do know about octal.

Back to Julia’s post:

title: bases # we usually write numbers in base 2503 = 2000 + 500 + 0 + 3 (picture of a bunch of powers of 10 being added up to make 2503 -- 1000s, 100s, 10s, 0s) # but you can write numbers in any base here's 10 in base 2: 1 0 0 1 0 16 + 0 + 0 + 2 + 0 = 18 (picture of a bunch of powers of 2 being added up to make 18: 16, 8, 4, 2, 1) # we use 4 bases with computers * base 2 (binary) * base 8 (octal) * base 10 (decimal) * base 16 (hexadecimal) octal is the least common by far # how to convert from base 10 to base 20 Let's convert 19! we'll start at the end and move left 1. divide by 2: 19 / 2 = 9 remainder 1 2. write the remainder (1) below and 9 on the left 3. repeat (picture of 19 -> 9 -> 4 -> 2 -> 1 , with the remainders 1, 0, 0, 1, 1) the answer is 10011! title: bases

# we usually write numbers in base

2503 = 2000 + 500 + 0 + 3

(picture of a bunch of powers of 10 being added up to make 2503 — 1000s, 100s, 10s, 0s)

# but you can write numbers in any base

here’s 10 in base 2:

1 0 0 1 0

16 + 0 + 0 + 2 + 0 = 18

(picture of a bunch of powers of 2 being added up to make 18: 16, 8, 4, 2, 1)

# we use 4 bases with computers

* base 2 (binary)
* base 8 (octal)
* base 10 (decimal)
* base 16 (hexadecimal)

octal is the least common by far

# how to convert from base 10 to base 20

Let’s convert 19! we’ll start at the end and move left

1. divide by 2: 19 / 2 = 9 remainder 1
2. write the remainder (1) below and 9 on the left
3. repeat

(picture of 19 -> 9 -> 4 -> 2 -> 1 , with the remainders 1, 0, 0, 1, 1)

the answer is 10011!

Octals are rarely used, but because of that they unexpectedly can rear their ugly head

Julia considers dropping the octal numbers in a response to [Wayback/Archive] Maxime Chevalier on Twitter: “@b0rk Octal seems to have largely fallen out of favor. It’s kind of an artifact of a different era (1960s mainframes) AFAIK. One thing I found very insightful for getting an intuitive sense of binary is looking at a binary counter in action:”

[Wayback/Archive] Mechanical Binary Counter _ 1 min – YouTube

[Wayback/Archive] Julia Evans on Twitter: “@Love2Code yeah I might remove octal, the only place I ever see it is unix permissions and maybe it’s not worth including just for that”

Like others, I disagreed, so here are some of the responses I think are important:

Likewise, there were some interesting responses to the octal bits in Mastodon as well:

  1. [Wayback/Archive] Barney Dellar (he/him): “@b0rk Have you come across any uses of Octal? I’ve never seen it in use (other than the fact that a literal 0 is in Octal in C++)” – mastodon.scot
  2. [Wayback/Archive] We Could All Use A Li’l Change: “Obligatory “Zero Wing” reference youtu.be/8fvTxv46ano” – Dice.camp

    [Wayback/Archive] All Your Base Are Belong To Us (Original) – YouTube

    All your base are belong to us – Wikipedia

Octals can get you in trouble and will if you do not knowing about them

My argument of including information about octal numbers is that lack of knowledge about octal, especially like shown in the first Mastodon reaction, makes it easier to introduce failures and harder to see benefits.

The failures mainly come because some languages and tools use the prefix zero (0) for octal numbers. This gets more confusing when the same tools on different platforms use different rules. This can result in the same source code causing bugs that manifest themselves on some platforms but not the others.

The most well known problem here it the interpretation of IPv4 addresses, where something like 077.016.042.061 gives different results in different environments.

Similarly, date input like 07-09-1964 cannot only reverse date and month, but also fail on the 09 as it is not a valid octal number.

On the IPv4 side, most platforms interpret 0127.0.0.1 as 87.0.0.1 instead of 127.0.0.1.

Some examples in failures:

Yes I know some of the problems like these can and have ben fixed. But others can’t or won’t, so better know about this.

Humans already know about base 10 (obviously), base 12 and often 24 (hours per half day and hours per day), base 60 (minutes and seconds), base 20 (especially in many European languages) and base 5 (part of the ancestry of the the Roman numbering system). Given that most IT people can learn base 2 and 16, they surely should be able to get a bit familiar with basics of base 8 bringing these numeral systems:

Where are octals supported?

Here are some links on real world octal usage and failure (I reworked most what I did from the top of my mind in the tweet to links originating from the Wikipedia Octal entry):

  • Octal – Wikipedia
    • File-system permissions – Wikipedia

      These are the examples from the symbolic notation section given in octal notation:

      Symbolic
      notation
      Numeric
      notation
      English
      ---------- 0000 no permissions
      -rwx------ 0700 read, write, & execute only for owner
      -rwxrwx--- 0770 read, write, & execute for owner and group
      -rwxrwxrwx 0777 read, write, & execute for owner, group and others
      ---x--x--x 0111 execute
      --w--w--w- 0222 write
      --wx-wx-wx 0333 write & execute
      -r--r--r-- 0444 read
      -r-xr-xr-x 0555 read & execute
      -rw-rw-rw- 0666 read & write
      -rwxr----- 0740 owner can read, write, & execute; group can only read; others have no permissions
      • chmod – Wikipedia

        Numerical permissions

        The chmod numerical format accepts up to four digits. The three rightmost digits define permissions for the file user, the group, and others. The optional leading digit, when 4 digits are given, specifies the special setuidsetgid, and sticky flags. Each digit of the three rightmost digits represents a binary value, which controls the “read”, “write” and “execute” permissions respectively. A value of 1 means a class is allowed that action, while a 0 means it is disallowed.

        # Sum rwx Permission
        7 4(r) + 2(w) + 1(x) rwx read, write and execute
        6 4(r) + 2(w) rw- read and write
        5 4(r)        + 1(x) r-x read and execute
        4 4(r) r-- read only
        3        2(w) + 1(x) -wx write and execute
        2        2(w) -w- write only
        1               1(x) --x execute only
        0 0 --- none

        For example, 754 would allow:

        • “read” (4), “write” (2), and “execute” (1) for the User class; i.e., 7 (4 + 2 + 1).
        • “read” (4) and “execute” (1) for the Group class; i.e., 5 (4 + 1).
        • Only “read” (4) for the Others class
    • UTF-8: octal – Wikipedia

      UTF-8’s use of six bits per byte to represent the actual characters being encoded means that octal notation (which uses 3-bit groups) can aid in the comparison of UTF-8 sequences with one another and in manual conversion.

      Octal code point ↔ Octal UTF-8 conversion
      First code point Last code point Code point Byte 1 Byte 2 Byte 3 Byte 4
      000 0177 xxx xxx
      0200 03777 xxyy 3xx 2yy
      04000 077777 xyyzz 34x 2yy 2zz
      0100000 0177777 1xyyzz 35x 2yy 2zz
      0200000 04177777 xyyzzww 36x 2yy 2zz 2ww

      With octal notation, the arbitrary octal digits, marked with x, y, z or w in the table, will remain unchanged when converting to or from UTF-8.

      Example: Á = U+00C1 = 0301 (in octal) is encoded as 303 201 in UTF-8 (C3 81 in hex).
      Example: € = U+20AC = 020254 is encoded as 342 202 254 in UTF-8 (E2 82 AC in hex).
    • Octal: in aviation – Wikipedia
      • Apollo Guidance Computer – Wikipedia

        A set of user-accessible routines were provided to let the astronauts display the contents of various memory locations in octal or decimal in groups of 1, 2, or 3 registers at a time.

      • Squawk code: transponder codes – Wikipedia

        Codes are made of four octal digits; the dials on a transponder read from zero to seven, inclusive. Four octal digits can represent up to 4096 different codes, which is why such transponders are sometimes described as “4096 code transponders.”

    • Octal: in computers – Wikipedia

      The prefix 0o also follows the model set by the prefix 0x used for hexadecimal literals in

      • C syntax – Wikipedia

        Integer constants may be specified in source code in several ways. Numeric values can be specified as decimal (example: 1022), octal with zero (0) as a prefix (01776), or hexadecimal with 0x (zero x) as a prefix (0x3FE).

      • [Wayback/Archive] Haskell 98 Lexical Structure

        2.5  Numeric Literals

        decimal -> digit{digit}
        octal -> octit{octit}
        hexadecimal -> hexit{hexit}
        integer -> decimal
        | 0o octal | 0O octal
        | 0x hexadecimal | 0X hexadecimal
        float -> decimal . decimal [exponent]
        | decimal exponent
        exponent -> (e | E) [+ | -] decimal

        There are two distinct kinds of numeric literals: integer and floating. Integer literals may be given in decimal (the default), octal (prefixed by 0o or 0O) or hexadecimal notation (prefixed by 0x or 0X). Floating literals are always decimal. A floating literal must contain digits both before and after the decimal point; this ensures that a decimal point cannot be mistaken for another use of the dot character.

      • [Wayback/Archive] OCaml – The OCaml language
        An integer literal is a sequence of one or more digits, optionally preceded by a minus sign. By default, integer literals are in decimal (radix 10). The following prefixes select a different radix:
        Prefix Radix
        0x0X hexadecimal (radix 16)
        0o0O octal (radix 8)
        0b0B binary (radix 2)
        (The initial 0 is the digit zero; the O for octal is the letter O.)
      • [Wayback/Archive] 2. Lexical analysis — Python v3.1.5 documentation
        The recognized escape sequences are:
        Escape Sequence Meaning Notes
        \newline Backslash and newline ignored
        \\ Backslash (\)
        \' Single quote (')
        \" Double quote (")
        \a ASCII Bell (BEL)
        \b ASCII Backspace (BS)
        \f ASCII Formfeed (FF)
        \n ASCII Linefeed (LF)
        \r ASCII Carriage Return (CR)
        \t ASCII Horizontal Tab (TAB)
        \v ASCII Vertical Tab (VT)
        \ooo Character with octal value ooo (1,3)
        \xhh Character with hex value hh (2,3)
        Escape sequences only recognized in string literals are:
        Escape Sequence Meaning Notes
        \N{name} Character named name in the Unicode database
        \uxxxx Character with 16-bit hex value xxxx (4)
        \Uxxxxxxxx Character with 32-bit hex value xxxxxxxx (5)
        Notes:
        1. As in Standard C, up to three octal digits are accepted.
        2. Unlike in Standard C, exactly two hex digits are required.
        3. In a bytes literal, hexadecimal and octal escapes denote the byte with the given value. In a string literal, these escapes denote a Unicode character with the given value.
      • [Wayback/Archive] Synopsis 2: Bits and Pieces

        Radix markers

        Initial 0 no longer indicates octal numbers by itself. You must use an explicit radix marker for that. Pre-defined radix prefixes include:

            0b          base 2, digits 0..1
            0o          base 8, digits 0..7
            0d          base 10, digits 0..9
            0x          base 16, digits 0..9,a..f (case insensitive)

        Each of these allows an optional underscore after the radix prefix but before the first digit. These all mean the same thing:

            0xbadcafe
            0xbad_cafe
            0x_bad_cafe

        General radices

        The general radix form of a number involves prefixing with the radix in adverbial form:

            :10<42>             same as 0d42 or 42
            :16<DEAD_BEEF>      same as 0xDEADBEEF
            :8<177777>          same as 0o177777 (65535)
            :2<1.1>             same as 0b1.1 (0d1.5)
      • [Wayback/Archive] ruby/to_i_spec.rb at master · ruby/ruby
          it "auto-detects base 8 via leading 0 when base = 0" do
            "01778".to_i(0).should == 0177
            "-01778".to_i(0).should == -0177
          end
        ...
          it "auto-detects base 8 via 0o when base = 0" do
            "0o178".to_i(0).should == 0o17
            "-0o178".to_i(0).should == -0o17
          end
      • [Wayback/Archive] Tcl and octal numbers

        Tcl mathematical operation commands treat strings begininning with 0 as octal numbers, catching the unsuspecting programmer off-guard.

      • [Wayback/Archive] Explicit Octal numeral notation – PHP 8.1 • PHP.Watch

        PHP supports various numeral systems, including the default decimal (base-10), binary (base-2), octal (base-8), and hex (base-16).

        Numeral systems apart from decimal are prefixed with their own prefix:

        • Hex with 0x prefix: e.g. 0x11 = 17
        • Binary with 0b prefix: e.g. 0b11 = 3
        • Octal with 0 prefix: e.g. 011 = 9

        In PHP 8.1 and later, Octal numerals also support the 0o (zero, followed by o as in Oscar) prefix, which means octal numeric literals can be made more obvious and readable that they are indeed octal numerals. 0O (zero, followed by upper case O as in Oscar) is also supported.

      • [Wayback/Archive] Literals and operators – Rust By Example

        Integers can, alternatively, be expressed using hexadecimal, octal or binary notation using these prefixes respectively: 0x0o or 0b.

      • [Wayback/Archive] ECMAScript Language Specification ECMA-262 6th Edition – DRAFT

        Numeric Literals

        Syntax
        NumericLiteral ::
            DecimalLiteral
            BinaryIntegerLiteral
            OctalIntegerLiteral
            HexIntegerLiteral
        OctalIntegerLiteral ::
            0o OctalDigits
            0O OctalDigits
        OctalDigits ::
            OctalDigit
            OctalDigits OctalDigit
        OctalDigit :: one of
            0 1 2 3 4 5 6 7
      • [Wayback/Archive] Why does the radix for JavaScript’s parseInt default to 8? – Stack Overflow
        It only “defaults” to 8 if the input string starts with 0. This is an unfortunate carryover from C and C++.
        You can use Number('0123') instead, or, as you said in the question, parseInt('0123', 10).
      • [Wayback/Archive] parseInt() – JavaScript | MDN

        Note: Other prefixes like 0b, which are valid in number literals, are treated as normal digits by parseInt()parseInt() does not treat strings beginning with a 0 character as octal values either. The only prefix that parseInt() recognizes is 0x or 0X for hexadecimal values — everything else is parsed as a decimal value if radix is missing.

      Octal numbers that are used in some programming languages (C, PerlPostScript…) for textual/graphical representations of byte strings when some byte values (unrepresented in a code page, non-graphical, having special meaning in current context or otherwise undesired) have to be to escaped as \nnn. Octal representation may be particularly handy with non-ASCII bytes of UTF-8, which encodes groups of 6 bits, and where any start byte has octal value \3nn and any continuation byte has octal value \2nn.

      • Escape sequences in C – Wikipedia
        Escape sequence Hex value in ASCII Character represented
        \nnn any The byte whose numerical value is given by nnn interpreted as an octal number
      • [Wayback/Archive] perldata – Perl data types – Perldoc Browser

        Scalar value constructors

        Numeric literals are specified in any of the following floating point or integer formats:

        12345
        12345.67
        .23E-10             # a very small number
        3.14_15_92          # a very important number
        4_294_967_296       # underscore for legibility
        0xff                # hex
        0xdead_beef         # more hex
        0377                # octal (only numbers, begins with 0)
        0o12_345            # alternative octal (introduced in Perl 5.33.5)
        0b011011            # binary
        0x1.999ap-4         # hexadecimal floating point (the 'p' is required)

        You are allowed to use underscores (underbars) in numeric literals between digits for legibility (but not multiple underscores in a row: 23__500 is not legal; 23_500 is). You could, for example, group binary digits by threes (as for a Unix-style mode argument such as 0b110_100_100) or by fours (to represent nibbles, as in 0b1010_0110) or in other groups.

        String literals are usually delimited by either single or double quotes. They work much like quotes in the standard Unix shells: double-quoted string literals are subject to backslash and variable substitution; single-quoted strings are not (except for \' and \\). The usual C-style backslash rules apply for making characters such as newline, tab, etc., as well as some more exotic forms. See “Quote and Quote-like Operators” in perlop for a list.

        Hexadecimal, octal, or binary, representations in string literals (e.g. ‘0xff’) are not automatically converted to their integer representation. The hex() and oct() functions make these conversions for you. See “hex” in perlfunc and “oct” in perlfunc for more details.

      • [Wayback/Archive] https://www.adobe.com/jp/print/postscript/pdfs/PLRM.pdf (PostScript® LANGUAGE REFERENCE, third edition)

        Within a text string, the \ (backslash) character is treated as an “escape” for various
        purposes, such as including newline characters, unbalanced parentheses, and
        the \ character itself in the string. The character immediately following the \ determines
        its precise interpretation.

        \n   line feed (LF)
        \r   carriage return (CR)
        \t   horizontal tab
        \b   backspace
        \f   form feed
        \\  backslash
        \(   left parenthesis
        \)   right parenthesis
        \ddd character code ddd (octal)

        The \ddd form may be used to include any 8-bit character constant in a string.
        One, two, or three octal digits may be specified, with high-order overflow ignored.
        This notation is preferred for specifying a character outside the recommended
        ASCII character set for the PostScript language, since the notation itself
        stays within the standard set and thereby avoids possible difficulties in transmitting
        or storing the text of the program. It is recommended that three octal digits
        always be used, with leading zeros as needed, to prevent ambiguity. The string
        (\0053), for example, contains two characters—an ASCII 5 (Control-E) followed
        by the digit 3—whereas the strings (\53) and (\053) contain one character, the
        ASCII character whose code is octal 53 (plus sign).

  • [Wayback/Archive] Octal Literal Java – Google Search
    • [Wayback/Archive] Java Data Type How to – Declare integer literals as octal values
      Octal values is base 8.
      Legal digits in an octal literal can be from 0 to 7.
      Octal literals are with a leading zero, for example 035 and 067.
    • [Wayback/Archive] how to set value of octal in java? – Stack Overflow (thanks [Wayback/Archive] Kapil and [Wayback/Archive] Jon Skeet)

      A

      why i cant give 018 and 019 to variable.

      Because an integer literal prefixed with 0 is treated as octal, and ‘8’ and ‘9’ aren’t valid octal digits.

      From section 3.10.1 of the JLS:

      An octal numeral consists of an ASCII digit 0 followed by one or more of the ASCII digits 0 through 7 interspersed with underscores, and can represent a positive, zero, or negative integer.

      Trying to use ‘8’ in an octal number is like trying to use ‘G’ in hex… it’s simple not part of the set of symbols used in that base.

    • [Wayback/Archive] Chapter 3. Lexical Structure: 3.10.1. Integer Literals

      An octal numeral consists of an ASCII digit 0 followed by one or more of the ASCII digits 0 through 7 interspersed with underscores, and can represent a positive, zero, or negative integer.

      OctalNumeral:
      0 OctalDigits
      0 Underscores OctalDigits

      OctalDigits:
      OctalDigit
      OctalDigit OctalDigitsAndUnderscoresopt OctalDigit

      OctalDigit: one of
      0 1 2 3 4 5 6 7

      OctalDigitsAndUnderscores:
      OctalDigitOrUnderscore
      OctalDigitsAndUnderscores OctalDigitOrUnderscore

      OctalDigitOrUnderscore:
      OctalDigit
      _

      Note that octal numerals always consist of two or more digits; 0 is always considered to be a decimal numeral – not that it matters much in practice, for the numerals 000, and 0x0 all represent exactly the same integer value.

  • [Wayback/Archive] Octal Literal bash – Google Search
    • [Wayback/Archive] Numerical Constants

      A shell script interprets a number as decimal (base 10), unless that number has a special prefix or notation. A number preceded by a 0 is octal (base 8). A number preceded by 0x is hexadecimal (base 16). A number with an embedded # evaluates as BASE#NUMBER (with range and notational restrictions).

       

    • [Wayback/Archive] Special Characters: Octal Escape Sequences

      Outside of the characters that you can type on your keyboard, there are a lot of other characters you can print on your screen. I’ve created a script to allow you to check out what the font you’re using has available for you. The main command you need to use to utilize these characters is “echo -e”. The “-e” switch tells echo to enable interpretation of backslash-escaped characters. What you see when you look at octal 200-400 will be very different with a VGA font from what you will see with a standard Linux font. Be warned that some of these escape sequences have odd effects on your terminal, and I haven’t tried to prevent them from doing whatever they do. The linedraw and block characters that are used heavily by the Bashprompt project are between octal 260 and 337 in the VGA fonts.

  • [Wayback/Archive] Octal Literal IPv4 – Google Search
    • [Wayback/Archive] IPv4 addresses are silly, inet_aton(3) doubly so.

      Alright, alright, I think you probably already know where this is going. All of the above are simply examples of a peculiar way of specifying IPv4 addresses that, for historical reasons, a specific library function accepts: inet_aton(3):

      Values specified using the "dotted quad" notation take one of the follow-
      ing forms:
      
            a.b.c.d
            a.b.c
            a.b
            a

      This weird convention dates back to the days of classful networking, where the leading bits of an IPv4 address indicated the length of the network- and host portions of the address. And while we’re used to specifying IPv4 addresses in full dotted-decimal notation (i.e., a.b.c.d), it’s useful to remember that at the end of the day, an IPv4 address is just a 32-bit number, and we can express numbers in a variety of ways. inet_aton(3) accepts these different notations, so let’s see what each of those means specifically.

      Dotted-Decimal Addresses

      When four parts are specified, each is interpreted as a byte of data and assigned, from left to right, to the four bytes of an Internet address.

      Ok, not much to see here, that’s what we expect — something like 166.84.7.99 — although we’ll get back to some surprises with this format a bit further down. For now, let’s move on.

      Single part or number

      When only one part is given, the value is stored directly in the network address without any byte rearrangement.

      All numbers supplied as “parts” in a “dotted quad” notation may be decimal, octal, or hexadecimal, as specified in the C language (i.e., a leading 0x or 0X implies hexadecimal; otherwise, a leading 0 implies octal; otherwise, the number is interpreted as decimal).

       

    • [Wayback/Archive] inet_aton(3) – NetBSD Manual Pages
           All numbers supplied as ``parts'' in a "dotted quad" notation may be dec-
           imal, octal, or hexadecimal, as specified in the C language (i.e., a
           leading 0x or 0X implies hexadecimal; otherwise, a leading 0 implies
           octal; otherwise, the number is interpreted as decimal).
      
    • Dot-decimal notation – Wikipedia

      A popular implementation of IP networking, originating in 4.2BSD, contains a function inet_aton() for converting IP addresses in character string representation to internal binary storage. In addition to the basic four-decimals format and 32-bit numbers, it also supported intermediate syntax forms of octet.24bits (e.g. 10.1234567; for Class A addresses) and octet.octet.16bits (e.g. 172.16.12345; for Class B addresses). It also allowed the numbers to be written in hexadecimal and octal representations, by prefixing them with 0x and 0, respectively. These features continue to be supported in some software, even though they are considered as non-standard. This means addresses with a component written with a leading zero digit may be interpreted differently in programs that do or do not recognize such formats.

    • Classful network – Wikipedia
  • The 6502 is from the same era as the 8008 and 8080. It too uses octal as base for the instruction set (via [Wayback/Archive] 6502 octal – Google Search):
    • [Wayback/Archive] assembly – What is the significance of $ # and % in 6502? – Stack Overflow (thanks [Wayback/Archive] tabol and [Wayback/Archive] Michael)

      A

      DASM allows numbers to be expressed in binary, octal, decimal, and hexadecimal.
      • Binary numbers use the % prefix (e.g. %1101).
      • Octal numbers use the 0 prefix (e.g. 015).
      • Decimal numbers use no prefix (e.g. 13).
      • Hexadecimal numbers use the $ prefix (e.g. $0D).

      The # symbol is used to specify immediate addressing:
      LDA 0   ; Load the byte from address 0 in memory into register A
      LDA #0  ; Load the value 0 into register A
      
      One can of course combine immediate addressing with a different numeric base, e.g.:
      LDA #$FF ; Load the value $FF into register A
    • [Wayback/Archive] 6502 Instruction Set: layout
      The 6502 instruction table is laid out according to a pattern abc, where
      a and b are an octal number each, followed by a group of two binary digits c,
      as in the bit-vector aaabbbcc“.
      a a a b b b c c
      bit 7 6 5 4 3 2 1 0
      (0…7) (0…7) (0…3)
      Example:
      All ROR instructions share a = 3 and c = 2 (3b2) with the address mode in b.
      At the same time, all instructions addressing the zero-page share b = 1 (a1c).
      abc = 312  =>  ( 3 << 5 | 1 << 2 | 2 )  =  %011.001.10  =  $66  “ROR zpg“.
  • [Wayback/Archive] 80×86 Opcodes: Instructions shows a few octal tables as part of the instructions:
    • mmm : Function
      • 000 : DS:[BX+SI]
      • 001 : DS:[BX+DI]
      • 010 : SS:[BP+SI]
      • 011 : SS:[BP+DI]
      • 100 : DS:[SI]
      • 101 : DS:[DI]
      • 110 : SS:[BP]
      • 111 : DS:[BX]
    • rrr : W=0 : W=1 : reg32
      • 000 : AL : AX : EAX
      • 001 : CL : CX : ECX
      • 010 : DL : DX : EDX
      • 011 : BL : BX : EBX
      • 100 : AH : SP : ESP
      • 101 : CH : BP : EBP
      • 110 : DH : SI : ESI
      • 111 : BH : DI : EDI
    • sss : Segment Register
      • 000 : ES
      • 001 : CS
      • 010 : SS
      • 011 : DS
      • 100 : FS (Only 386+)
      • 101 : GS (Only 386+)
    • rrr : Index Register
      • 000 : EAX
      • 001 : ECX
      • 010 : EDX
      • 011 : EBX
      • 100 : No Index
      • 101 : EBP
      • 110 : ESI
      • 111 : EDI

Better acid/bases image and background

Bases is used in various contexts, and with a background in chemistry, bases versus acids (often called alkali, though not al bases are alkali).

The [Wayback/Archive] Acids and bases – introduction — Science Learning Hub explains the concept of acids and bases better than I can and has this great detailed pH scale picture categorising where “common” liquids are rated at:

[Archive/Archive] Image

[Wayback/Archive] pH scale — Science Learning Hub

Queries

Some of the queries I used (I forgot to save some, sorry):

--jeroen


Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.