Changes

Jump to: navigation, search

Assembly

14,136 bytes added, 16:49, 25 May 2018
Created page with "'''Home * Programming * Languages * Assembly''' '''Assembly''' is a family of [https://en.wikipedia.org/wiki/Low-level_language low-level languages] for..."
'''[[Main Page|Home]] * [[Programming]] * [[Languages]] * Assembly'''

'''Assembly''' is a family of [https://en.wikipedia.org/wiki/Low-level_language low-level languages] for programming computers. They implement a symbolic representation of the [https://en.wikipedia.org/wiki/Machine_code machine instructions] and data needed to program a particular CPU architecture with its particular [https://en.wikipedia.org/wiki/Instruction_set instruction]- and register set. An [https://en.wikipedia.org/wiki/Assembly_language#Assembler assembler] is used to translate the assembly source code into executable machine instructions in [https://en.wikipedia.org/wiki/Object_code object code]. Almost each architecture and its extensions have their own proprietary assembly language with different [https://en.wikipedia.org/wiki/Syntax syntax] and [https://en.wikipedia.org/wiki/Mnemonic mnemonics] for operations, data declarations etc..

=Assembler=
<span id="Popcount"></span>
==CDC 6600/Cyber==
[[Mobility]] in [[Chess (Program)|Chess 4.6]] based on [https://en.wikipedia.org/wiki/Talk%3ACDC_6600#.27Population_Count.27_.28.22Count_Ones.22.29_Instruction 47 CXi Xk] [[Population Count]], written in [https://en.wikipedia.org/wiki/COMPASS COMPASS], the CDC Macro Assembler for the [[CDC 6600]] and [[CDC Cyber]] <ref>[http://www.computerhistory.org/chess/full_record.php?iid=sft-431614f455002 Chess 4.6 source code], gift of [[David Slate]], from [[The Computer History Museum]], [http://archive.computerhistory.org/projects/chess/related_materials/software/3-3.Chess_4.6_Sourcecode.102645430/chess_4-6.sourcecode.102645430.pdf pdf]</ref>. The square list aka [[Bitboards|bitboard]] was loaded into two 60-bit registers, with both populations added and stored.
<pre>
** 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
</pre>
<span id="CAL"></span>
==Cray==
Cray Assembly Language (CAL) <ref>[[http:''www.scribd.com/doc/2161814/Cray-Assembly-Language-Reference|
Cray Assembly Language Reference - iPaper]]</ref>, some snippet from [[Cray Blitz]] [[Bitboards|Bitboard]] code for the [[Cray-1]] or [[Cray X-MP]] <ref>[[Robert Hyatt|Robert Hyatt's]] [[Cray Blitz]] [ftp://ftp.cis.uab.edu/pub/hyatt/crayblitz/ FTP Page - crayblitz.tar.gz Source Code] see folder CAL, unmake.s</ref>:
<pre>
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
</pre>

==Intel/AMD==
===Architectures===
<span id="x86"></span>
{| class="wikitable"
|-
! CPU
! Assemblers
|-
| [[8080]] / [[Z80]]
| ASM80
|-
| [[8086]]
| [https://en.wikipedia.org/wiki/MASM MASM], [https://en.wikipedia.org/wiki/TASM TASM], [https://en.wikipedia.org/wiki/Netwide_Assembler NASM], [https://en.wikipedia.org/wiki/GNU_Assembler GNU Assembler]
|-
| [[x86]]
| [https://en.wikipedia.org/wiki/FASM FASM], [https://en.wikipedia.org/wiki/MASM MASM], [https://en.wikipedia.org/wiki/Netwide_Assembler NASM], [https://en.wikipedia.org/wiki/TASM TASM], [https://en.wikipedia.org/wiki/GNU_Assembler GNU Assembler]
|-
| [[x86-64]]
| [https://en.wikipedia.org/wiki/MASM MASM64], [https://en.wikipedia.org/wiki/Netwide_Assembler NASM], [https://en.wikipedia.org/wiki/GNU_Assembler GNU Assembler]
|}
<span id="x86Syntax"></span>
===Syntax===
Intel-Syntax: operation target, source
<pre>
add rax, rdx ; rax += rdx
</pre>

[https://en.wikipedia.org/wiki/GNU_Assembler AT & T Syntax] operation<type> source, target
<pre>
addq %rdx, %rax /* rax += rdx */
</pre>
<span id="HAKMEM169"></span>
==PDP-6==
[[Population Count#HAKMEM169|HAKMEM 169]], to [[Population Count|count the ones]] in a [[PDP-6]]/[[PDP-10]] 36-bit word, written in [[MIDAS]] <ref>[[Population Count#HAKMEM169|HAKMEM 169]] by [[Bill Gosper|Gosper]], Mann, Lenard, [Root and Mann], [http://home.pipeline.com/~hbaker1/hakmem/hakmem.html HAKMEM]</ref>:
<pre>
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
</pre>
<span id="InlineAssembly"></span>
=Inline Assembly=
[https://en.wikipedia.org/wiki/Inline_assembler Inline assembly] is embedded inside various [[C]], [[Cpp|C++]], [[D-Proglanguage|D]], [[Pascal]] and [[Delphi]] compiler <ref>[http://www.ibm.com/developerworks/library/l-ia.html Inline assembly for x86 in Linux] by [[IBM]]</ref>.

=See also=
* [[asmFish]] ([[x86-64]] [[Stockfish#ports|port]] of [[Stockfish]])
* [[Hardware]]
* [[General Setwise Operations]]

=Publications=
* [http://www.vintage.org/2007/main/bio.php?id=1781 Lance A. Leventhal] ('''1979'''). ''6502 Assembly Language Programming''. Osborne/[https://en.wikipedia.org/wiki/McGraw-Hill_Education McGraw-Hill], [http://www.atarimania.com/documents/6502_Assembly_Language_Programming.pdf pdf]
* [https://en.wikipedia.org/wiki/Rodnay_Zaks Rodnay Zaks] ('''1979'''). ''[https://en.wikipedia.org/wiki/Programming_the_Z80 Programming the Z80]''. Sybex <ref>[http://www.z80.info/zaks.html pdf download link by Rodnay Zaks]</ref>
* [[Kathe Spracklen]] ('''1979'''). ''Z-80 and 8080 assembly language programming''. [https://en.wikipedia.org/wiki/Hayden_Books Hayden Books], [http://www.amazon.com/assembly-language-programming-Hayden-computer/dp/0810451670 amazon.com], [https://archive.org/details/z808080assemblyl00kath Internet Archive] » [[8080]], [[Z80]]
* [[Jan Kuipers]] ('''1981'''). ''Tiny Chess 86 - Een schaakprogramma voor de 8088/8086''. [http://home.kpn.nl/a.dikker1/museum/databus.html Databus] 06-81, [http://www.schaakcomputers.nl/hein_veldhuis/database/files/06-1981,%20Databus,%20Jan%20Kuipers,%20Tiny%20Chess%2086.pdf pdf] hosted by [[Hein Veldhuis]] » [[8086]], [[Tiny Chess 86]]
* [https://en.wikipedia.org/wiki/Rodnay_Zaks Zaks, Rodnay] ('''1983'''). ''Programming the 6502 (Fourth Edition)''. Sybex
* [[Ward Douglas Maurer]] ('''1984'''). ''[http://www.amazon.com/APPLE-assembly-language-Lazerware-software/dp/091489482X/ref=la_B001HPN2O8_1_2?s=books&ie=UTF8&qid=1410953624&sr=1-2 APPLE assembly language with Lazerware software]''. Computer Science Press » [[Apple II]]
* [[Ward Douglas Maurer]] ('''1985'''). ''[http://www.amazon.com/Commodore-assembly-language-DEVELOP-64-assembler/dp/0881750409/ref=la_B001HPN2O8_1_3?s=books&ie=UTF8&qid=1410953624&sr=1-3 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'''). ''[http://www.worldcat.org/title/assembly-language-programming-on-the-mac-with-mpw-second-draft/oclc/22190641 Assembly language programming on the Mac with MPW]''. [https://en.wikipedia.org/wiki/George_Washington_University_School_of_Engineering_and_Applied_Science School of Engineering and Applied Science], [https://en.wikipedia.org/wiki/George_Washington_University George Washington University], GWU-IIST-90-20. » [[Macintosh]] <ref>[https://en.wikipedia.org/wiki/Macintosh_Programmer%27s_Workshop Macintosh Programmer's Workshop from Wikipedia]</ref>
* [https://en.wikipedia.org/wiki/Michael_Abrash Michael Abrash] ('''1990'''). ''[http://www.amazon.com/exec/obidos/ASIN/0673386023/codihorr-20 Zen of Assembly Language: Knowledge]''. Scott Foresman Trade, ISBN-13: 978-0673386021 <ref>[http://www.codinghorror.com/blog/2008/02/there-aint-no-such-thing-as-the-fastest-code.html Coding Horror: There Ain't No Such Thing as the Fastest Code] by [https://en.wikipedia.org/wiki/Jeff_Atwood Jeff Atwood], February 19, 2008</ref> <ref>[http://www.talkchess.com/forum/viewtopic.php?t=47384&start=45 Re: Developments of the last two years] by [[Don Dailey]], [[CCC]], March 03, 2013</ref>
* [https://en.wikipedia.org/wiki/Randall_Hyde Randall Hyde] ('''2003, 2010'''). ''[http://nostarch.com/assembly2.htm The Art of Assembly Language Programming]''. No Starch Press, 2nd edition, ISBN-13: 978-1-59327-207-4

=Listings=
* [[Chess (Program)|Chess 4.6]] [[CDC Cyber]] [http://www.computerhistory.org/chess/full_record.php?iid=sft-431614f455002 source code], gift of [[David Slate]], from [[The Computer History Museum]], [http://archive.computerhistory.org/projects/chess/related_materials/software/3-3.Chess_4.6_Sourcecode.102645430/chess_4-6.sourcecode.102645430.pdf pdf]
* [[Sargon]] [[Z80]] [http://www.andreadrian.de/schach/sargon.asm assembly listing] by [[Dan Spracklen|Dan]] and [[Kathe Spracklen]], hosted by [[Andre Adrian]]
* [[Rookie|Rookie 1.0]] [[68000]] [[Assembly|assembly]] source, search.s from [http://marcelk.net/rookie/nostalgia/v1/ Index of /rookie/nostalgia/v1]

=Manuals=
==[[6502]]==
* [http://archive.6502.org/datasheets/synertek_programming_manual.pdf 6502 Programming Manual], August 1976 (pdf)
==[[68000]]==
* [http://www.freescale.com/files/archives/doc/ref_manual/M68000PRM.pdf MOTOROLA M68000 FAMILY - Programmer’s Reference Manual] (pdf)
* [http://neo.dmcs.p.lodz.pl/pn/asembler_68000/asm.pdf 68000 Assembler - User's Manual] (pdf) by Paul McKee
==[[DEC Alpha|Alpha]]==
* [https://www.cs.arizona.edu/projects/alto/Doc/local/alpha.instruction.html Alpha Instruction Set (Brief)]
* [http://www.cs.cmu.edu/afs/cs/academic/class/15213-f98/doc/alpha-asm.pdf Digital UNIX Assembly Language Programmer's Guide], March 1996 (pdf)
==[[ARM2|ARM]]==
* [http://www.heyrick.co.uk/assembler/ ARM Assembler]
* [http://www.peter-cockerell.net/aalp/html/frames.html ARM Assembly Language Programming] by [http://www.peter-cockerell.net/ Pete Cockerell]
==[[Fairchild F8]]==
* [http://bitsavers.informatik.uni-stuttgart.de/pdf/fairchild/f8/F8_prelimUM_Jan75.pdf F8 Prelimanary Microprocessor User's Manual] (pdf) Circuit Organization, Machine Instructions, F8 Cross Assembler, F8 Cross Simulator, from [http://bitsavers.informatik.uni-stuttgart.de/ bitsavers.org] » [[Fairchild F8]]
==HP Saturn==
* <span id="HPSATURN"></span>[https://fr.linkedin.com/in/fernandesgilbert Gilbert Fernandes], [http://www.hpcalc.org/contact.php Eric Rechlin] ('''2005'''). ''[http://www.hpcalc.org/details.php?id=1693 Introduction to Saturn Assembly Language]''. Third edition, Part of the [http://www.hpcalc.org/ HP Calculator Archive] » [https://en.wikipedia.org/wiki/HP_Saturn HP Saturn], [https://en.wikipedia.org/wiki/HP_48_series HP 48 series]
==[[PowerPC]]==
* [https://www.ibm.com/developerworks/library/l-ppc/ IBM PowerPC assembly]
==[[SPARC]]==
* [https://docs.oracle.com/cd/E19457-01/801-6649/801-6649.pdf SPARC Assembly Language Reference Manual] (pdf)
==[[x86-64]]==
* [[x86-64#Manuals|x86-64 Manuals]]
==[[Z80]]==
* Neil J. Colvin ('''1977'''). ''TDL Z80 Relocating/Linking Assembler User's Manual''. [http://retrotechnology.com/herbs_stuff/zasm.pdf pdf]

=Forum Posts=
* [https://www.stmintz.com/ccc/index.php?id=11909 Assembler handtuning benefit] by [[Jouni Uski]], [[CCC]], November 11, 1997
* [http://www.talkchess.com/forum/viewtopic.php?t=47414 C vs ASM] by [[Ed Schroder|Ed Schröder]], [[CCC]], March 05, 2013 » [[C]]
* [https://groups.google.com/d/msg/fishcooking/HKIYwO6pF-s/-DOONSK5F-IJ [for fun] rewrite of stockfish into asm and question on source] by [[Mohammed Li]], [[Computer Chess Forums|FishCooking]], January 09, 2015 » [[asmFish]]

=External Links=
* [https://en.wikipedia.org/wiki/Assembly_language Assembly language from Wikipedia]
* [https://en.wikipedia.org/wiki/List_of_assemblers Comparison of assemblers from Wikipedia]
* [https://en.wikipedia.org/wiki/High-level_assembler High-level assembler from Wikipedia]
* [http://webster.cs.ucr.edu/AsmTools/HLA/ High Level Assembly]
* [http://www.plantation-productions.com/Webster/www.artofasm.com/index.html The Art of Assembly Language Programming and HLA] by [https://en.wikipedia.org/wiki/Randall_Hyde Randall Hyde]
* [http://www.df.lth.se/~john_e/ The Assembly Gems page] by [http://www.df.lth.se/~john_e/about.html John Eckerdal]
==DEC==
* [http://home.pipeline.com/~hbaker1/pdp-10/pdp-10.html PDP-10 Machine Language] » [[PDP-10]] <ref>MIT PDP-10 'Info' file converted to Hypertext 'html' format by [http://home.pipeline.com/~hbaker1/home.html Henry Baker]</ref>
* [https://programmer209.wordpress.com/2011/08/03/the-pdp-11-assembly-language/ PDP-11 Assembly Language]
* [https://en.wikipedia.org/wiki/MACRO-11 MACRO-11 from Wikipedia]
==IBM==
* [https://en.wikipedia.org/wiki/IBM_Basic_assembly_language_and_successors IBM Basic assembly language and successors - Wikipedia]» [[IBM 360]], [[IBM 370]], [[ICL 4-70|ICL 4/70]]
==Intel==
* [http://www.azillionmonkeys.com/qed/asmexample.html Assembly Language Lab] by [[Paul Hsieh]]
* [http://olivier.poudade.free.fr/ Assembly language page] by [[Olivier Poudade]]
* [https://en.wikipedia.org/wiki/X86_assembly_language x86 assembly language from Wikipedia]
* [http://en.wikibooks.org/wiki/X86_Assembly/X86_Architecture X86 Assembly/X86 Architecture from Wikibooks]
* [http://www.cs.virginia.edu/~evans/cs216/guides/x86.html x86 Assembly Guide]
* [http://software.intel.com/en-us/articles/introduction-to-x64-assembly Introduction to x64 Assembly] by [http://www.lomont.org/ Chris Lomont], March 2012
* [http://groups.google.com/group/alt.lang.asm/topics alt.lang.asm], [http://groups.google.com/ Google Group]
* [http://groups.google.com/group/comp.lang.asm.x86/topics comp.lang.asm.x86], [http://groups.google.com/ Google Group]
* [http://siyobik.info/index.php?document=x86_32bit_asm x86 32-bit Assembly for Atheists]
* [http://dasm-dillon.sourceforge.net/ the dasm macro assembler]
* [http://xi6.com/projects/asmx/ asmx multi-CPU assembler]

=References=
<references />

'''[[Languages|Up one Level]]'''

Navigation menu