开发者

Materials for reading various assembly languages?

开发者 https://www.devze.com 2023-03-31 12:34 出处:网络
This is a wiki question to gather useful references for learning assembly languages for开发者_运维问答 various architectures.

This is a wiki question to gather useful references for learning assembly languages for开发者_运维问答 various architectures.

I recently attempted to read the source code for Basic Pdp-1 Lisp from 1964, and needed to search extensively for reference materials to make even the slightest bit of sense from the code. I feel the links I've collected may prove useful to anyone attempting to read code of similar vintage, like SpaceWar!

So a good answer should comprise:

  • The name of the architecture
  • A non-trivial program in assembly language

    (This is the real focus of the question: a classic program that's worth learning assembly in order to read it.)

  • Handbooks and instruction references for understanding the program

I'll start things off with my collected references for reading Pdp-1 LISP.


x86 Assembly:

  • Here's a manual with more than 1400 pages and some exercises included, some chapters are focused on stuff like boolean algebra and system organization
  • Intel's documentation and manuals here, you shouldn't need this before a few years ;)
  • An optimization guide (quite advanced stuff)
  • Here you can find an assembler for developing win32 apps, both in console and in window. It also includes the windows SDK and a description of all win32 APIs
  • This seems to be a good GAS (GNU Assembler) manual if you're developing on linux
  • Some examples (windows)


Pdp-1 LISP

Pdf of Source including explanatory article, and symbol listings: http://www.google.com/url?sa=D&q=http://www.computerhistory.org/collections/accession/102650371

An ASCII source listing: http://hack.org/mc/software/lisp.p2

A nice overview: http://en.wikipedia.org/wiki/PDP-1

Pdp-1 Handbook, including instruction set reference: http://www.bitsavers.org/pdf/dec/pdp1/F15B_PDP1_Handbook_1961.pdf

Macro asembler manual, describing how instructions are formed by arithmetic: http://www.bitsavers.org/pdf/dec/pdp1/PDP-1_Macro.pdf

Alternate presentation of instruction set illustrating composability of shift and operate instructions: http://simh.trailing-edge.com/docs/architecture18b.pdf

This last link is vital for understanding such tricks as the very first instruction:

-/Lisp interpreter 3-20-64, part 1
 000004                 4/
-/go
 000004         go,
 000004 764607          hlt+cla+cli+7-opr-opr

This could have been written with less obfuscation (but less semantic info) as:

opr 4607

Or with more semantics (and still more obfuscated) as:

hlt+cla+cli+clf+07-opr-opr-opr

But since clf == opr that would be silly.

One last crucial resource for 60s-era assembly programming is Knuth, vol. 1 (1ed or 2ed). This explains some of the more basic self-mutilations that pdp-1 code exhibits.

0

精彩评论

暂无评论...
验证码 换一张
取 消