logoalt Hacker News

ueckertoday at 12:25 PM1 replyview on HN

I do not think that pre- and postincrement operator being inspired by PDP-11 has anything to with fundamental system design questions.


Replies

nivertechtoday at 1:14 PM

> Q. How do you port an OS from one language to a new one, pre-LLM?

A. you reduce impedance mismatch, but making the new language using similar concepts and mechanisms

--

You're right, this table is just a coincidence, probably derived from the standard math notation, and used in many PLs like FORTRAN and Python ;)

  PDP-11        C
  
  INC R         ++i
  DEC R         --i
  ADD src, dst  dst += src
  SUB src, dst  dst -= src

  (R)+          *p++
  -(R)          *--p
  X(R)          p[x]
  @(R)+         **pp++
  @X(R)         *p[x]

  BR label      goto label  ; near jump
  JMP label     goto label  ; far jump
show 2 replies