Skip to content
HomeVideosBooks
AllTopicsTrends
BlogsPodcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    Cover of Programming a personal computer

    Programming a personal computer

    Per Brinch Hansen · 1982

    ProgrammingSystems & OS
    Open LibraryAmazon
    Stats for nerds
    2recommend
    2mentions
    2people
    2019–2023years
    100% recommend

    Mentions per year

    20192020202120222023

    What Hacker News says

    1. ggrothendieckJan 2023
      Per Brinch Handsen, Programming a Personal Computer. Book is online. Interpreter, editor and OS in about 10 KLOC. http://pascal.hansotten.com/per-brinch-hansen/ Also https://news.ycombinator.com/item?id=24913959
      thread
    2. todd8Oct 2019
      An interesting thought experiment that I've pondered is what I would do if I was given a system that I had to program without even an assembler.

      I've programmed on systems where the only access was through direct memory access to the machines memory, and other systems that had a boot loading initiated by a button that started a paper tape reader. I've also used minicomputers that had to have instructions manually keyed in on binary panel switches directly into memory to start a card reader where the cards contained machine instructions to bootstrap the rest of the boot loader off of the remaining cards.

      In every case though, somewhere I had an assembler to write the code I needed. What would I do if I didn't even have an assembler? I could write one, but I don't want to do it in machine code. Now days, the easy way would be to simply construct a cross-compiler or cross-assembler that was written in say python on a different machine.

      One alternative is to build a hand assembled, really simple macro system. m4[0] or Calvin Mooers' TRAC[1] are possible prototypes, but these flexible macro systems would be difficult to hand compiler into machine code so one might get by with a really basic, more limited macro system. Then each machine instruction could be encoded as a macro and then a primitive assembler could be written as macros.

      However, real assemblers do more work, they generally take two passes because they allow symbols to be used instead of literal addresses. So the next step would be to program a real assembler using the primitive assembly language.

      After that I suppose a compiler for a simple language like Pascal, basic Lisp, or Per Brinch Hansen's Edison[2] language could be written in assembly language.

      Per Brinch Hansen provides the basic directions for construction a very simple operating system from scratch, including the assembler and compiler in the book Programming a Personal Computer[3].

      [0] https://www.gnu.org/software/m4/

      [1] https://dl.acm.org/citation.cfm?id=365270

      [2] http://brinch-hansen.net/papers/1981b.pdf

      [3] https://www.amazon.com/Programming-personal-computer-Brinch-...

      thread

    Related

    Cover of Computer lib
    2008–2026

    Computer lib

    Ted Nelson
    10 recommend · 41
    Cover of Computer systems
    2009–2026

    Computer systems

    Randal Bryant
    67 recommend · 110
    Cover of The art of computer programming
    2007–2026

    The art of computer programming

    Donald Knuth
    336 recommend · 1,799
    Cover of Code
    2008–2026

    Code

    Charles Petzold
    243 recommend · 385
    Cover of The C Programming Language
    2007–2026

    The C Programming Language

    Brian W. Kernighan
    246 recommend · 604
    Cover of Programming Perl
    2007–2026

    Programming Perl

    Larry Wall
    90 recommend · 298
    Cover of Operating system principles
    2022–2026

    Operating system principles

    Per Brinch Hansen
    2 recommend · 4
    Cover of Expert C programming!
    2008–2026

    Expert C programming!

    Peter Van der Linden
    88 recommend · 150