Assembly

Home * Programming * Languages * Assembly

Assembly is a family of low-level languages for programming computers. They implement a symbolic representation of the machine instructions and data needed to program a particular CPU architecture with its particular instruction- and register set. An assembler is used to translate the assembly source code into executable machine instructions in object code. Almost each architecture and its extensions have their own proprietary assembly language with different syntax and mnemonics for operations, data declarations etc..

=Assembler=

CDC 6600/Cyber
Mobility in Chess 4.6 based on 47 CXi Xk Population Count, written in COMPASS, the CDC Macro Assembler for the CDC 6600 and CDC Cyber. The square list aka bitboard was loaded into two 60-bit registers, with both populations added and stored.
 * COUNTS - COUNT MEMBERS OF A SQUARE LIST

COUNTS MACRO Y .STST LOADS Y .CHK2 CX'.S1' X'.S1' CX'.S2' X'.S2' IX'.SS' X'.S2'+X'.S1' .STND COUNTS ENDM ... SETQ MOBIL,(PLUS,(COUNTS,(INDEXS,ATKFR,(LSHIFT,SQLN,1))),MOB

Cray
Cray Assembly Language (CAL), some snippet from Cray Blitz Bitboard code for the Cray-1 or Cray X-MP : l1020   =         * s3       msave3-1,a2 s4       msave4-1,a2 a4       pcount-1,a1 a6       pcount-1,a5 pfirst-1,a1 s1                   plast-1,a1 s2                     pfirst-1,a5 s3                    plast-1,a5 s4                     a4        a4-1 a6       a6+1 pcount-1,a1 a4                   pcount-1,a5 a6

Syntax
Intel-Syntax: operation target, source add rax, rdx ; rax += rdx

AT & T Syntax operation source, target addq %rdx, %rax /* rax += rdx */

PDP-6
HAKMEM 169, to count the ones in a PDP-6/PDP-10 36-bit word, written in MIDAS : LDB B,[014300,,A]     ;or MOVE B,A then LSH B,-1 AND B,[333333,,333333] SUB A,B LSH B,-1 AND B,[333333,,333333] SUBB A,B              ;each octal digit is replaced by number of 1's in it   LSH B,-3 ADD A,B AND A,[070707,,070707] IDIVI A,77            ;casting out 63.'s =Inline Assembly= Inline assembly is embedded inside various C, C++, D, Pascal and Delphi compiler.

=See also=
 * asmFish (x86-64 port of Stockfish)
 * Hardware
 * General Setwise Operations

=Publications=
 * Lance A. Leventhal (1979). 6502 Assembly Language Programming. Osborne/McGraw-Hill, pdf
 * Rodnay Zaks (1979). Programming the Z80. Sybex
 * Kathe Spracklen (1979). Z-80 and 8080 assembly language programming. Hayden Books, amazon.com, Internet Archive » 8080, Z80
 * Jan Kuipers (1981). Tiny Chess 86 - Een schaakprogramma voor de 8088/8086. Databus 06-81, pdf hosted by Hein Veldhuis » 8086, Tiny Chess 86
 * Zaks, Rodnay (1983). Programming the 6502 (Fourth Edition). Sybex
 * Ward Douglas Maurer (1984). APPLE assembly language with Lazerware software. Computer Science Press » Apple II
 * Ward Douglas Maurer (1985). Commodore 64 assembly language: A course of study based on the DEVELOP-64 assembler/editor/debugger. Computer Science Press » Commodore 64
 * Ward Douglas Maurer (1990). Assembly language programming on the Mac with MPW. School of Engineering and Applied Science, George Washington University, GWU-IIST-90-20. » Macintosh
 * Michael Abrash (1990). Zen of Assembly Language: Knowledge. Scott Foresman Trade, ISBN-13: 978-0673386021
 * Randall Hyde (2003, 2010). The Art of Assembly Language Programming. No Starch Press, 2nd edition, ISBN-13: 978-1-59327-207-4

=Listings=
 * Chess 4.6 CDC Cyber source code, gift of David Slate, from The Computer History Museum, pdf
 * Sargon Z80 assembly listing by Dan and Kathe Spracklen, hosted by Andre Adrian
 * Rookie 1.0 68000 assembly source, search.s from Index of /rookie/nostalgia/v1

=Manuals=

6502

 * 6502 Programming Manual, August 1976 (pdf)

68000

 * MOTOROLA M68000 FAMILY - Programmer’s Reference Manual (pdf)
 * 68000 Assembler - User's Manual (pdf) by Paul McKee

Alpha

 * Alpha Instruction Set (Brief)
 * Digital UNIX Assembly Language Programmer's Guide, March 1996 (pdf)

ARM

 * ARM Assembler
 * ARM Assembly Language Programming by Pete Cockerell

Fairchild F8

 * Fairchild F8 Guide To Programming 1977, hosted by the Internet Archive » Fairchild F8

HP Saturn

 * Gilbert Fernandes, Eric Rechlin (2005). Introduction to Saturn Assembly Language. Third edition, Part of the HP Calculator Archive » HP Saturn, HP 48 series

PowerPC

 * IBM PowerPC assembly

SPARC

 * SPARC Assembly Language Reference Manual (pdf)

x86-64

 * x86-64 Manuals

Z80

 * Neil J. Colvin (1977). TDL Z80 Relocating/Linking Assembler User's Manual. pdf

=Forum Posts=
 * Assembler handtuning benefit by Jouni Uski, CCC, November 11, 1997
 * C vs ASM by Ed Schröder, CCC, March 05, 2013 » C
 * [for fun rewrite of stockfish into asm and question on source] by Mohammed Li, FishCooking, January 09, 2015 » asmFish

=External Links=
 * Assembly language from Wikipedia
 * Comparison of assemblers from Wikipedia
 * High-level assembler from Wikipedia
 * High Level Assembly
 * The Art of Assembly Language Programming and HLA by Randall Hyde
 * The Assembly Gems page by John Eckerdal

DEC

 * PDP-10 Machine Language » PDP-10
 * PDP-11 Assembly Language
 * MACRO-11 from Wikipedia

IBM

 * IBM Basic assembly language and successors - Wikipedia» IBM 360, IBM 370, ICL 4/70

Intel

 * Assembly Language Lab by Paul Hsieh
 * Assembly language page by Olivier Poudade
 * x86 assembly language from Wikipedia
 * X86 Assembly/X86 Architecture from Wikibooks
 * x86 Assembly Guide
 * Introduction to x64 Assembly by Chris Lomont, March 2012
 * alt.lang.asm, Google Group
 * comp.lang.asm.x86, Google Group
 * x86 32-bit Assembly for Atheists
 * the dasm macro assembler
 * asmx multi-CPU assembler

=References=

Up one Level