as.texinfo 269 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035
  1. \input texinfo @c -*-Texinfo-*-
  2. @c Copyright (C) 1991-2015 Free Software Foundation, Inc.
  3. @c UPDATE!! On future updates--
  4. @c (1) check for new machine-dep cmdline options in
  5. @c md_parse_option definitions in config/tc-*.c
  6. @c (2) for platform-specific directives, examine md_pseudo_op
  7. @c in config/tc-*.c
  8. @c (3) for object-format specific directives, examine obj_pseudo_op
  9. @c in config/obj-*.c
  10. @c (4) portable directives in potable[] in read.c
  11. @c %**start of header
  12. @setfilename as.info
  13. @c ---config---
  14. @macro gcctabopt{body}
  15. @code{\body\}
  16. @end macro
  17. @c defaults, config file may override:
  18. @set have-stabs
  19. @c ---
  20. @c man begin NAME
  21. @c ---
  22. @include asconfig.texi
  23. @include bfdver.texi
  24. @c ---
  25. @c man end
  26. @c ---
  27. @c common OR combinations of conditions
  28. @ifset COFF
  29. @set COFF-ELF
  30. @end ifset
  31. @ifset ELF
  32. @set COFF-ELF
  33. @end ifset
  34. @ifset AOUT
  35. @set aout-bout
  36. @end ifset
  37. @ifset ARM/Thumb
  38. @set ARM
  39. @end ifset
  40. @ifset Blackfin
  41. @set Blackfin
  42. @end ifset
  43. @ifset BOUT
  44. @set aout-bout
  45. @end ifset
  46. @ifset H8/300
  47. @set H8
  48. @end ifset
  49. @ifset SH
  50. @set H8
  51. @end ifset
  52. @ifset HPPA
  53. @set abnormal-separator
  54. @end ifset
  55. @c ------------
  56. @ifset GENERIC
  57. @settitle Using @value{AS}
  58. @end ifset
  59. @ifclear GENERIC
  60. @settitle Using @value{AS} (@value{TARGET})
  61. @end ifclear
  62. @setchapternewpage odd
  63. @c %**end of header
  64. @c @smallbook
  65. @c @set SMALL
  66. @c WARE! Some of the machine-dependent sections contain tables of machine
  67. @c instructions. Except in multi-column format, these tables look silly.
  68. @c Unfortunately, Texinfo doesn't have a general-purpose multi-col format, so
  69. @c the multi-col format is faked within @example sections.
  70. @c
  71. @c Again unfortunately, the natural size that fits on a page, for these tables,
  72. @c is different depending on whether or not smallbook is turned on.
  73. @c This matters, because of order: text flow switches columns at each page
  74. @c break.
  75. @c
  76. @c The format faked in this source works reasonably well for smallbook,
  77. @c not well for the default large-page format. This manual expects that if you
  78. @c turn on @smallbook, you will also uncomment the "@set SMALL" to enable the
  79. @c tables in question. You can turn on one without the other at your
  80. @c discretion, of course.
  81. @ifinfo
  82. @set SMALL
  83. @c the insn tables look just as silly in info files regardless of smallbook,
  84. @c might as well show 'em anyways.
  85. @end ifinfo
  86. @ifnottex
  87. @dircategory Software development
  88. @direntry
  89. * As: (as). The GNU assembler.
  90. * Gas: (as). The GNU assembler.
  91. @end direntry
  92. @end ifnottex
  93. @finalout
  94. @syncodeindex ky cp
  95. @copying
  96. This file documents the GNU Assembler "@value{AS}".
  97. @c man begin COPYRIGHT
  98. Copyright @copyright{} 1991-2015 Free Software Foundation, Inc.
  99. Permission is granted to copy, distribute and/or modify this document
  100. under the terms of the GNU Free Documentation License, Version 1.3
  101. or any later version published by the Free Software Foundation;
  102. with no Invariant Sections, with no Front-Cover Texts, and with no
  103. Back-Cover Texts. A copy of the license is included in the
  104. section entitled ``GNU Free Documentation License''.
  105. @c man end
  106. @end copying
  107. @titlepage
  108. @title Using @value{AS}
  109. @subtitle The @sc{gnu} Assembler
  110. @ifclear GENERIC
  111. @subtitle for the @value{TARGET} family
  112. @end ifclear
  113. @ifset VERSION_PACKAGE
  114. @sp 1
  115. @subtitle @value{VERSION_PACKAGE}
  116. @end ifset
  117. @sp 1
  118. @subtitle Version @value{VERSION}
  119. @sp 1
  120. @sp 13
  121. The Free Software Foundation Inc.@: thanks The Nice Computer
  122. Company of Australia for loaning Dean Elsner to write the
  123. first (Vax) version of @command{as} for Project @sc{gnu}.
  124. The proprietors, management and staff of TNCCA thank FSF for
  125. distracting the boss while they got some work
  126. done.
  127. @sp 3
  128. @author Dean Elsner, Jay Fenlason & friends
  129. @page
  130. @tex
  131. {\parskip=0pt
  132. \hfill {\it Using {\tt @value{AS}}}\par
  133. \hfill Edited by Cygnus Support\par
  134. }
  135. %"boxit" macro for figures:
  136. %Modified from Knuth's ``boxit'' macro from TeXbook (answer to exercise 21.3)
  137. \gdef\boxit#1#2{\vbox{\hrule\hbox{\vrule\kern3pt
  138. \vbox{\parindent=0pt\parskip=0pt\hsize=#1\kern3pt\strut\hfil
  139. #2\hfil\strut\kern3pt}\kern3pt\vrule}\hrule}}%box with visible outline
  140. \gdef\ibox#1#2{\hbox to #1{#2\hfil}\kern8pt}% invisible box
  141. @end tex
  142. @vskip 0pt plus 1filll
  143. Copyright @copyright{} 1991-2015 Free Software Foundation, Inc.
  144. Permission is granted to copy, distribute and/or modify this document
  145. under the terms of the GNU Free Documentation License, Version 1.3
  146. or any later version published by the Free Software Foundation;
  147. with no Invariant Sections, with no Front-Cover Texts, and with no
  148. Back-Cover Texts. A copy of the license is included in the
  149. section entitled ``GNU Free Documentation License''.
  150. @end titlepage
  151. @contents
  152. @ifnottex
  153. @node Top
  154. @top Using @value{AS}
  155. This file is a user guide to the @sc{gnu} assembler @command{@value{AS}}
  156. @ifset VERSION_PACKAGE
  157. @value{VERSION_PACKAGE}
  158. @end ifset
  159. version @value{VERSION}.
  160. @ifclear GENERIC
  161. This version of the file describes @command{@value{AS}} configured to generate
  162. code for @value{TARGET} architectures.
  163. @end ifclear
  164. This document is distributed under the terms of the GNU Free
  165. Documentation License. A copy of the license is included in the
  166. section entitled ``GNU Free Documentation License''.
  167. @menu
  168. * Overview:: Overview
  169. * Invoking:: Command-Line Options
  170. * Syntax:: Syntax
  171. * Sections:: Sections and Relocation
  172. * Symbols:: Symbols
  173. * Expressions:: Expressions
  174. * Pseudo Ops:: Assembler Directives
  175. @ifset ELF
  176. * Object Attributes:: Object Attributes
  177. @end ifset
  178. * Machine Dependencies:: Machine Dependent Features
  179. * Reporting Bugs:: Reporting Bugs
  180. * Acknowledgements:: Who Did What
  181. * GNU Free Documentation License:: GNU Free Documentation License
  182. * AS Index:: AS Index
  183. @end menu
  184. @end ifnottex
  185. @node Overview
  186. @chapter Overview
  187. @iftex
  188. This manual is a user guide to the @sc{gnu} assembler @command{@value{AS}}.
  189. @ifclear GENERIC
  190. This version of the manual describes @command{@value{AS}} configured to generate
  191. code for @value{TARGET} architectures.
  192. @end ifclear
  193. @end iftex
  194. @cindex invocation summary
  195. @cindex option summary
  196. @cindex summary of options
  197. Here is a brief summary of how to invoke @command{@value{AS}}. For details,
  198. see @ref{Invoking,,Command-Line Options}.
  199. @c man title AS the portable GNU assembler.
  200. @ignore
  201. @c man begin SEEALSO
  202. gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}.
  203. @c man end
  204. @end ignore
  205. @c We don't use deffn and friends for the following because they seem
  206. @c to be limited to one line for the header.
  207. @smallexample
  208. @c man begin SYNOPSIS
  209. @value{AS} [@b{-a}[@b{cdghlns}][=@var{file}]] [@b{--alternate}] [@b{-D}]
  210. [@b{--compress-debug-sections}] [@b{--nocompress-debug-sections}]
  211. [@b{--debug-prefix-map} @var{old}=@var{new}]
  212. [@b{--defsym} @var{sym}=@var{val}] [@b{-f}] [@b{-g}] [@b{--gstabs}]
  213. [@b{--gstabs+}] [@b{--gdwarf-2}] [@b{--gdwarf-sections}]
  214. [@b{--help}] [@b{-I} @var{dir}] [@b{-J}]
  215. [@b{-K}] [@b{-L}] [@b{--listing-lhs-width}=@var{NUM}]
  216. [@b{--listing-lhs-width2}=@var{NUM}] [@b{--listing-rhs-width}=@var{NUM}]
  217. [@b{--listing-cont-lines}=@var{NUM}] [@b{--keep-locals}]
  218. [@b{-o} @var{objfile}] [@b{-R}]
  219. [@b{--hash-size}=@var{NUM}] [@b{--reduce-memory-overheads}]
  220. [@b{--statistics}]
  221. [@b{-v}] [@b{-version}] [@b{--version}]
  222. [@b{-W}] [@b{--warn}] [@b{--fatal-warnings}] [@b{-w}] [@b{-x}]
  223. [@b{-Z}] [@b{@@@var{FILE}}]
  224. [@b{--sectname-subst}] [@b{--size-check=[error|warning]}]
  225. [@b{--target-help}] [@var{target-options}]
  226. [@b{--}|@var{files} @dots{}]
  227. @c
  228. @c Target dependent options are listed below. Keep the list sorted.
  229. @c Add an empty line for separation.
  230. @ifset AARCH64
  231. @emph{Target AArch64 options:}
  232. [@b{-EB}|@b{-EL}]
  233. [@b{-mabi}=@var{ABI}]
  234. @end ifset
  235. @ifset ALPHA
  236. @emph{Target Alpha options:}
  237. [@b{-m@var{cpu}}]
  238. [@b{-mdebug} | @b{-no-mdebug}]
  239. [@b{-replace} | @b{-noreplace}]
  240. [@b{-relax}] [@b{-g}] [@b{-G@var{size}}]
  241. [@b{-F}] [@b{-32addr}]
  242. @end ifset
  243. @ifset ARC
  244. @emph{Target ARC options:}
  245. [@b{-mcpu=@var{cpu}}]
  246. [@b{-mA6}|@b{-mARC600}|@b{-mARC601}|@b{-mA7}|@b{-mARC700}|@b{-mEM}|@b{-mHS}]
  247. [@b{-mcode-density}]
  248. [@b{-EB}|@b{-EL}]
  249. @end ifset
  250. @ifset ARM
  251. @emph{Target ARM options:}
  252. @c Don't document the deprecated options
  253. [@b{-mcpu}=@var{processor}[+@var{extension}@dots{}]]
  254. [@b{-march}=@var{architecture}[+@var{extension}@dots{}]]
  255. [@b{-mfpu}=@var{floating-point-format}]
  256. [@b{-mfloat-abi}=@var{abi}]
  257. [@b{-meabi}=@var{ver}]
  258. [@b{-mthumb}]
  259. [@b{-EB}|@b{-EL}]
  260. [@b{-mapcs-32}|@b{-mapcs-26}|@b{-mapcs-float}|
  261. @b{-mapcs-reentrant}]
  262. [@b{-mthumb-interwork}] [@b{-k}]
  263. @end ifset
  264. @ifset Blackfin
  265. @emph{Target Blackfin options:}
  266. [@b{-mcpu}=@var{processor}[-@var{sirevision}]]
  267. [@b{-mfdpic}]
  268. [@b{-mno-fdpic}]
  269. [@b{-mnopic}]
  270. @end ifset
  271. @ifset CRIS
  272. @emph{Target CRIS options:}
  273. [@b{--underscore} | @b{--no-underscore}]
  274. [@b{--pic}] [@b{-N}]
  275. [@b{--emulation=criself} | @b{--emulation=crisaout}]
  276. [@b{--march=v0_v10} | @b{--march=v10} | @b{--march=v32} | @b{--march=common_v10_v32}]
  277. @c Deprecated -- deliberately not documented.
  278. @c [@b{-h}] [@b{-H}]
  279. @end ifset
  280. @ifset D10V
  281. @emph{Target D10V options:}
  282. [@b{-O}]
  283. @end ifset
  284. @ifset D30V
  285. @emph{Target D30V options:}
  286. [@b{-O}|@b{-n}|@b{-N}]
  287. @end ifset
  288. @ifset EPIPHANY
  289. @emph{Target EPIPHANY options:}
  290. [@b{-mepiphany}|@b{-mepiphany16}]
  291. @end ifset
  292. @ifset H8
  293. @emph{Target H8/300 options:}
  294. [-h-tick-hex]
  295. @end ifset
  296. @ifset HPPA
  297. @c HPPA has no machine-dependent assembler options (yet).
  298. @end ifset
  299. @ifset I80386
  300. @emph{Target i386 options:}
  301. [@b{--32}|@b{--x32}|@b{--64}] [@b{-n}]
  302. [@b{-march}=@var{CPU}[+@var{EXTENSION}@dots{}]] [@b{-mtune}=@var{CPU}]
  303. @end ifset
  304. @ifset I960
  305. @emph{Target i960 options:}
  306. @c see md_parse_option in tc-i960.c
  307. [@b{-ACA}|@b{-ACA_A}|@b{-ACB}|@b{-ACC}|@b{-AKA}|@b{-AKB}|
  308. @b{-AKC}|@b{-AMC}]
  309. [@b{-b}] [@b{-no-relax}]
  310. @end ifset
  311. @ifset IA64
  312. @emph{Target IA-64 options:}
  313. [@b{-mconstant-gp}|@b{-mauto-pic}]
  314. [@b{-milp32}|@b{-milp64}|@b{-mlp64}|@b{-mp64}]
  315. [@b{-mle}|@b{mbe}]
  316. [@b{-mtune=itanium1}|@b{-mtune=itanium2}]
  317. [@b{-munwind-check=warning}|@b{-munwind-check=error}]
  318. [@b{-mhint.b=ok}|@b{-mhint.b=warning}|@b{-mhint.b=error}]
  319. [@b{-x}|@b{-xexplicit}] [@b{-xauto}] [@b{-xdebug}]
  320. @end ifset
  321. @ifset IP2K
  322. @emph{Target IP2K options:}
  323. [@b{-mip2022}|@b{-mip2022ext}]
  324. @end ifset
  325. @ifset M32C
  326. @emph{Target M32C options:}
  327. [@b{-m32c}|@b{-m16c}] [-relax] [-h-tick-hex]
  328. @end ifset
  329. @ifset M32R
  330. @emph{Target M32R options:}
  331. [@b{--m32rx}|@b{--[no-]warn-explicit-parallel-conflicts}|
  332. @b{--W[n]p}]
  333. @end ifset
  334. @ifset M680X0
  335. @emph{Target M680X0 options:}
  336. [@b{-l}] [@b{-m68000}|@b{-m68010}|@b{-m68020}|@dots{}]
  337. @end ifset
  338. @ifset M68HC11
  339. @emph{Target M68HC11 options:}
  340. [@b{-m68hc11}|@b{-m68hc12}|@b{-m68hcs12}|@b{-mm9s12x}|@b{-mm9s12xg}]
  341. [@b{-mshort}|@b{-mlong}]
  342. [@b{-mshort-double}|@b{-mlong-double}]
  343. [@b{--force-long-branches}] [@b{--short-branches}]
  344. [@b{--strict-direct-mode}] [@b{--print-insn-syntax}]
  345. [@b{--print-opcodes}] [@b{--generate-example}]
  346. @end ifset
  347. @ifset MCORE
  348. @emph{Target MCORE options:}
  349. [@b{-jsri2bsr}] [@b{-sifilter}] [@b{-relax}]
  350. [@b{-mcpu=[210|340]}]
  351. @end ifset
  352. @ifset METAG
  353. @emph{Target Meta options:}
  354. [@b{-mcpu=@var{cpu}}] [@b{-mfpu=@var{cpu}}] [@b{-mdsp=@var{cpu}}]
  355. @end ifset
  356. @ifset MICROBLAZE
  357. @emph{Target MICROBLAZE options:}
  358. @c MicroBlaze has no machine-dependent assembler options.
  359. @end ifset
  360. @ifset MIPS
  361. @emph{Target MIPS options:}
  362. [@b{-nocpp}] [@b{-EL}] [@b{-EB}] [@b{-O}[@var{optimization level}]]
  363. [@b{-g}[@var{debug level}]] [@b{-G} @var{num}] [@b{-KPIC}] [@b{-call_shared}]
  364. [@b{-non_shared}] [@b{-xgot} [@b{-mvxworks-pic}]
  365. [@b{-mabi}=@var{ABI}] [@b{-32}] [@b{-n32}] [@b{-64}] [@b{-mfp32}] [@b{-mgp32}]
  366. [@b{-mfp64}] [@b{-mgp64}] [@b{-mfpxx}]
  367. [@b{-modd-spreg}] [@b{-mno-odd-spreg}]
  368. [@b{-march}=@var{CPU}] [@b{-mtune}=@var{CPU}] [@b{-mips1}] [@b{-mips2}]
  369. [@b{-mips3}] [@b{-mips4}] [@b{-mips5}] [@b{-mips32}] [@b{-mips32r2}]
  370. [@b{-mips32r3}] [@b{-mips32r5}] [@b{-mips32r6}] [@b{-mips64}] [@b{-mips64r2}]
  371. [@b{-mips64r3}] [@b{-mips64r5}] [@b{-mips64r6}]
  372. [@b{-construct-floats}] [@b{-no-construct-floats}]
  373. [@b{-mnan=@var{encoding}}]
  374. [@b{-trap}] [@b{-no-break}] [@b{-break}] [@b{-no-trap}]
  375. [@b{-mips16}] [@b{-no-mips16}]
  376. [@b{-mmicromips}] [@b{-mno-micromips}]
  377. [@b{-msmartmips}] [@b{-mno-smartmips}]
  378. [@b{-mips3d}] [@b{-no-mips3d}]
  379. [@b{-mdmx}] [@b{-no-mdmx}]
  380. [@b{-mdsp}] [@b{-mno-dsp}]
  381. [@b{-mdspr2}] [@b{-mno-dspr2}]
  382. [@b{-mmsa}] [@b{-mno-msa}]
  383. [@b{-mxpa}] [@b{-mno-xpa}]
  384. [@b{-mmt}] [@b{-mno-mt}]
  385. [@b{-mmcu}] [@b{-mno-mcu}]
  386. [@b{-minsn32}] [@b{-mno-insn32}]
  387. [@b{-mfix7000}] [@b{-mno-fix7000}]
  388. [@b{-mfix-rm7000}] [@b{-mno-fix-rm7000}]
  389. [@b{-mfix-vr4120}] [@b{-mno-fix-vr4120}]
  390. [@b{-mfix-vr4130}] [@b{-mno-fix-vr4130}]
  391. [@b{-mdebug}] [@b{-no-mdebug}]
  392. [@b{-mpdr}] [@b{-mno-pdr}]
  393. @end ifset
  394. @ifset MMIX
  395. @emph{Target MMIX options:}
  396. [@b{--fixed-special-register-names}] [@b{--globalize-symbols}]
  397. [@b{--gnu-syntax}] [@b{--relax}] [@b{--no-predefined-symbols}]
  398. [@b{--no-expand}] [@b{--no-merge-gregs}] [@b{-x}]
  399. [@b{--linker-allocated-gregs}]
  400. @end ifset
  401. @ifset NIOSII
  402. @emph{Target Nios II options:}
  403. [@b{-relax-all}] [@b{-relax-section}] [@b{-no-relax}]
  404. [@b{-EB}] [@b{-EL}]
  405. @end ifset
  406. @ifset NDS32
  407. @emph{Target NDS32 options:}
  408. [@b{-EL}] [@b{-EB}] [@b{-O}] [@b{-Os}] [@b{-mcpu=@var{cpu}}]
  409. [@b{-misa=@var{isa}}] [@b{-mabi=@var{abi}}] [@b{-mall-ext}]
  410. [@b{-m[no-]16-bit}] [@b{-m[no-]perf-ext}] [@b{-m[no-]perf2-ext}]
  411. [@b{-m[no-]string-ext}] [@b{-m[no-]dsp-ext}] [@b{-m[no-]mac}] [@b{-m[no-]div}]
  412. [@b{-m[no-]audio-isa-ext}] [@b{-m[no-]fpu-sp-ext}] [@b{-m[no-]fpu-dp-ext}]
  413. [@b{-m[no-]fpu-fma}] [@b{-mfpu-freg=@var{FREG}}] [@b{-mreduced-regs}]
  414. [@b{-mfull-regs}] [@b{-m[no-]dx-regs}] [@b{-mpic}] [@b{-mno-relax}]
  415. [@b{-mb2bb}]
  416. @end ifset
  417. @ifset PDP11
  418. @emph{Target PDP11 options:}
  419. [@b{-mpic}|@b{-mno-pic}] [@b{-mall}] [@b{-mno-extensions}]
  420. [@b{-m}@var{extension}|@b{-mno-}@var{extension}]
  421. [@b{-m}@var{cpu}] [@b{-m}@var{machine}]
  422. @end ifset
  423. @ifset PJ
  424. @emph{Target picoJava options:}
  425. [@b{-mb}|@b{-me}]
  426. @end ifset
  427. @ifset PPC
  428. @emph{Target PowerPC options:}
  429. [@b{-a32}|@b{-a64}]
  430. [@b{-mpwrx}|@b{-mpwr2}|@b{-mpwr}|@b{-m601}|@b{-mppc}|@b{-mppc32}|@b{-m603}|@b{-m604}|@b{-m403}|@b{-m405}|
  431. @b{-m440}|@b{-m464}|@b{-m476}|@b{-m7400}|@b{-m7410}|@b{-m7450}|@b{-m7455}|@b{-m750cl}|@b{-mppc64}|
  432. @b{-m620}|@b{-me500}|@b{-e500x2}|@b{-me500mc}|@b{-me500mc64}|@b{-me5500}|@b{-me6500}|@b{-mppc64bridge}|
  433. @b{-mbooke}|@b{-mpower4}|@b{-mpwr4}|@b{-mpower5}|@b{-mpwr5}|@b{-mpwr5x}|@b{-mpower6}|@b{-mpwr6}|
  434. @b{-mpower7}|@b{-mpwr7}|@b{-mpower8}|@b{-mpwr8}|@b{-ma2}|@b{-mcell}|@b{-mspe}|@b{-mtitan}|@b{-me300}|@b{-mcom}]
  435. [@b{-many}] [@b{-maltivec}|@b{-mvsx}|@b{-mhtm}|@b{-mvle}]
  436. [@b{-mregnames}|@b{-mno-regnames}]
  437. [@b{-mrelocatable}|@b{-mrelocatable-lib}|@b{-K PIC}] [@b{-memb}]
  438. [@b{-mlittle}|@b{-mlittle-endian}|@b{-le}|@b{-mbig}|@b{-mbig-endian}|@b{-be}]
  439. [@b{-msolaris}|@b{-mno-solaris}]
  440. [@b{-nops=@var{count}}]
  441. @end ifset
  442. @ifset RL78
  443. @emph{Target RL78 options:}
  444. [@b{-mg10}]
  445. [@b{-m32bit-doubles}|@b{-m64bit-doubles}]
  446. @end ifset
  447. @ifset RX
  448. @emph{Target RX options:}
  449. [@b{-mlittle-endian}|@b{-mbig-endian}]
  450. [@b{-m32bit-doubles}|@b{-m64bit-doubles}]
  451. [@b{-muse-conventional-section-names}]
  452. [@b{-msmall-data-limit}]
  453. [@b{-mpid}]
  454. [@b{-mrelax}]
  455. [@b{-mint-register=@var{number}}]
  456. [@b{-mgcc-abi}|@b{-mrx-abi}]
  457. @end ifset
  458. @ifset S390
  459. @emph{Target s390 options:}
  460. [@b{-m31}|@b{-m64}] [@b{-mesa}|@b{-mzarch}] [@b{-march}=@var{CPU}]
  461. [@b{-mregnames}|@b{-mno-regnames}]
  462. [@b{-mwarn-areg-zero}]
  463. @end ifset
  464. @ifset SCORE
  465. @emph{Target SCORE options:}
  466. [@b{-EB}][@b{-EL}][@b{-FIXDD}][@b{-NWARN}]
  467. [@b{-SCORE5}][@b{-SCORE5U}][@b{-SCORE7}][@b{-SCORE3}]
  468. [@b{-march=score7}][@b{-march=score3}]
  469. [@b{-USE_R1}][@b{-KPIC}][@b{-O0}][@b{-G} @var{num}][@b{-V}]
  470. @end ifset
  471. @ifset SPARC
  472. @emph{Target SPARC options:}
  473. @c The order here is important. See c-sparc.texi.
  474. [@b{-Av6}|@b{-Av7}|@b{-Av8}|@b{-Asparclet}|@b{-Asparclite}
  475. @b{-Av8plus}|@b{-Av8plusa}|@b{-Av9}|@b{-Av9a}]
  476. [@b{-xarch=v8plus}|@b{-xarch=v8plusa}] [@b{-bump}]
  477. [@b{-32}|@b{-64}]
  478. @end ifset
  479. @ifset TIC54X
  480. @emph{Target TIC54X options:}
  481. [@b{-mcpu=54[123589]}|@b{-mcpu=54[56]lp}] [@b{-mfar-mode}|@b{-mf}]
  482. [@b{-merrors-to-file} @var{<filename>}|@b{-me} @var{<filename>}]
  483. @end ifset
  484. @ifset TIC6X
  485. @emph{Target TIC6X options:}
  486. [@b{-march=@var{arch}}] [@b{-mbig-endian}|@b{-mlittle-endian}]
  487. [@b{-mdsbt}|@b{-mno-dsbt}] [@b{-mpid=no}|@b{-mpid=near}|@b{-mpid=far}]
  488. [@b{-mpic}|@b{-mno-pic}]
  489. @end ifset
  490. @ifset TILEGX
  491. @emph{Target TILE-Gx options:}
  492. [@b{-m32}|@b{-m64}][@b{-EB}][@b{-EL}]
  493. @end ifset
  494. @ifset TILEPRO
  495. @c TILEPro has no machine-dependent assembler options
  496. @end ifset
  497. @ifset VISIUM
  498. @emph{Target Visium options:}
  499. [@b{-mtune=@var{arch}}]
  500. @end ifset
  501. @ifset XTENSA
  502. @emph{Target Xtensa options:}
  503. [@b{--[no-]text-section-literals}] [@b{--[no-]auto-litpools}]
  504. [@b{--[no-]absolute-literals}]
  505. [@b{--[no-]target-align}] [@b{--[no-]longcalls}]
  506. [@b{--[no-]transform}]
  507. [@b{--rename-section} @var{oldname}=@var{newname}]
  508. [@b{--[no-]trampolines}]
  509. @end ifset
  510. @ifset Z80
  511. @emph{Target Z80 options:}
  512. [@b{-z80}] [@b{-r800}]
  513. [@b{ -ignore-undocumented-instructions}] [@b{-Wnud}]
  514. [@b{ -ignore-unportable-instructions}] [@b{-Wnup}]
  515. [@b{ -warn-undocumented-instructions}] [@b{-Wud}]
  516. [@b{ -warn-unportable-instructions}] [@b{-Wup}]
  517. [@b{ -forbid-undocumented-instructions}] [@b{-Fud}]
  518. [@b{ -forbid-unportable-instructions}] [@b{-Fup}]
  519. @end ifset
  520. @ifset Z8000
  521. @c Z8000 has no machine-dependent assembler options
  522. @end ifset
  523. @c man end
  524. @end smallexample
  525. @c man begin OPTIONS
  526. @table @gcctabopt
  527. @include at-file.texi
  528. @item -a[cdghlmns]
  529. Turn on listings, in any of a variety of ways:
  530. @table @gcctabopt
  531. @item -ac
  532. omit false conditionals
  533. @item -ad
  534. omit debugging directives
  535. @item -ag
  536. include general information, like @value{AS} version and options passed
  537. @item -ah
  538. include high-level source
  539. @item -al
  540. include assembly
  541. @item -am
  542. include macro expansions
  543. @item -an
  544. omit forms processing
  545. @item -as
  546. include symbols
  547. @item =file
  548. set the name of the listing file
  549. @end table
  550. You may combine these options; for example, use @samp{-aln} for assembly
  551. listing without forms processing. The @samp{=file} option, if used, must be
  552. the last one. By itself, @samp{-a} defaults to @samp{-ahls}.
  553. @item --alternate
  554. Begin in alternate macro mode.
  555. @ifclear man
  556. @xref{Altmacro,,@code{.altmacro}}.
  557. @end ifclear
  558. @item --compress-debug-sections
  559. Compress DWARF debug sections using zlib with SHF_COMPRESSED from the
  560. ELF ABI. The resulting object file may not be compatible with older
  561. linkers and object file utilities. Note if compression would make a
  562. given section @emph{larger} then it is not compressed.
  563. @ifset ELF
  564. @cindex @samp{--compress-debug-sections=} option
  565. @item --compress-debug-sections=none
  566. @itemx --compress-debug-sections=zlib
  567. @itemx --compress-debug-sections=zlib-gnu
  568. @itemx --compress-debug-sections=zlib-gabi
  569. These options control how DWARF debug sections are compressed.
  570. @option{--compress-debug-sections=none} is equivalent to
  571. @option{--nocompress-debug-sections}.
  572. @option{--compress-debug-sections=zlib} and
  573. @option{--compress-debug-sections=zlib-gabi} are equivalent to
  574. @option{--compress-debug-sections}.
  575. @option{--compress-debug-sections=zlib-gnu} compresses DWARF debug
  576. sections using zlib. The debug sections are renamed to begin with
  577. @samp{.zdebug}. Note if compression would make a given section
  578. @emph{larger} then it is not compressed nor renamed.
  579. @end ifset
  580. @item --nocompress-debug-sections
  581. Do not compress DWARF debug sections. This is usually the default for all
  582. targets except the x86/x86_64, but a configure time option can be used to
  583. override this.
  584. @item -D
  585. Ignored. This option is accepted for script compatibility with calls to
  586. other assemblers.
  587. @item --debug-prefix-map @var{old}=@var{new}
  588. When assembling files in directory @file{@var{old}}, record debugging
  589. information describing them as in @file{@var{new}} instead.
  590. @item --defsym @var{sym}=@var{value}
  591. Define the symbol @var{sym} to be @var{value} before assembling the input file.
  592. @var{value} must be an integer constant. As in C, a leading @samp{0x}
  593. indicates a hexadecimal value, and a leading @samp{0} indicates an octal
  594. value. The value of the symbol can be overridden inside a source file via the
  595. use of a @code{.set} pseudo-op.
  596. @item -f
  597. ``fast''---skip whitespace and comment preprocessing (assume source is
  598. compiler output).
  599. @item -g
  600. @itemx --gen-debug
  601. Generate debugging information for each assembler source line using whichever
  602. debug format is preferred by the target. This currently means either STABS,
  603. ECOFF or DWARF2.
  604. @item --gstabs
  605. Generate stabs debugging information for each assembler line. This
  606. may help debugging assembler code, if the debugger can handle it.
  607. @item --gstabs+
  608. Generate stabs debugging information for each assembler line, with GNU
  609. extensions that probably only gdb can handle, and that could make other
  610. debuggers crash or refuse to read your program. This
  611. may help debugging assembler code. Currently the only GNU extension is
  612. the location of the current working directory at assembling time.
  613. @item --gdwarf-2
  614. Generate DWARF2 debugging information for each assembler line. This
  615. may help debugging assembler code, if the debugger can handle it. Note---this
  616. option is only supported by some targets, not all of them.
  617. @item --gdwarf-sections
  618. Instead of creating a .debug_line section, create a series of
  619. .debug_line.@var{foo} sections where @var{foo} is the name of the
  620. corresponding code section. For example a code section called @var{.text.func}
  621. will have its dwarf line number information placed into a section called
  622. @var{.debug_line.text.func}. If the code section is just called @var{.text}
  623. then debug line section will still be called just @var{.debug_line} without any
  624. suffix.
  625. @item --size-check=error
  626. @itemx --size-check=warning
  627. Issue an error or warning for invalid ELF .size directive.
  628. @item --help
  629. Print a summary of the command line options and exit.
  630. @item --target-help
  631. Print a summary of all target specific options and exit.
  632. @item -I @var{dir}
  633. Add directory @var{dir} to the search list for @code{.include} directives.
  634. @item -J
  635. Don't warn about signed overflow.
  636. @item -K
  637. @ifclear DIFF-TBL-KLUGE
  638. This option is accepted but has no effect on the @value{TARGET} family.
  639. @end ifclear
  640. @ifset DIFF-TBL-KLUGE
  641. Issue warnings when difference tables altered for long displacements.
  642. @end ifset
  643. @item -L
  644. @itemx --keep-locals
  645. Keep (in the symbol table) local symbols. These symbols start with
  646. system-specific local label prefixes, typically @samp{.L} for ELF systems
  647. or @samp{L} for traditional a.out systems.
  648. @ifclear man
  649. @xref{Symbol Names}.
  650. @end ifclear
  651. @item --listing-lhs-width=@var{number}
  652. Set the maximum width, in words, of the output data column for an assembler
  653. listing to @var{number}.
  654. @item --listing-lhs-width2=@var{number}
  655. Set the maximum width, in words, of the output data column for continuation
  656. lines in an assembler listing to @var{number}.
  657. @item --listing-rhs-width=@var{number}
  658. Set the maximum width of an input source line, as displayed in a listing, to
  659. @var{number} bytes.
  660. @item --listing-cont-lines=@var{number}
  661. Set the maximum number of lines printed in a listing for a single line of input
  662. to @var{number} + 1.
  663. @item -o @var{objfile}
  664. Name the object-file output from @command{@value{AS}} @var{objfile}.
  665. @item -R
  666. Fold the data section into the text section.
  667. @item --hash-size=@var{number}
  668. Set the default size of GAS's hash tables to a prime number close to
  669. @var{number}. Increasing this value can reduce the length of time it takes the
  670. assembler to perform its tasks, at the expense of increasing the assembler's
  671. memory requirements. Similarly reducing this value can reduce the memory
  672. requirements at the expense of speed.
  673. @item --reduce-memory-overheads
  674. This option reduces GAS's memory requirements, at the expense of making the
  675. assembly processes slower. Currently this switch is a synonym for
  676. @samp{--hash-size=4051}, but in the future it may have other effects as well.
  677. @ifset ELF
  678. @item --sectname-subst
  679. Honor substitution sequences in section names.
  680. @ifclear man
  681. @xref{Section Name Substitutions,,@code{.section @var{name}}}.
  682. @end ifclear
  683. @end ifset
  684. @item --statistics
  685. Print the maximum space (in bytes) and total time (in seconds) used by
  686. assembly.
  687. @item --strip-local-absolute
  688. Remove local absolute symbols from the outgoing symbol table.
  689. @item -v
  690. @itemx -version
  691. Print the @command{as} version.
  692. @item --version
  693. Print the @command{as} version and exit.
  694. @item -W
  695. @itemx --no-warn
  696. Suppress warning messages.
  697. @item --fatal-warnings
  698. Treat warnings as errors.
  699. @item --warn
  700. Don't suppress warning messages or treat them as errors.
  701. @item -w
  702. Ignored.
  703. @item -x
  704. Ignored.
  705. @item -Z
  706. Generate an object file even after errors.
  707. @item -- | @var{files} @dots{}
  708. Standard input, or source files to assemble.
  709. @end table
  710. @c man end
  711. @ifset AARCH64
  712. @ifclear man
  713. @xref{AArch64 Options}, for the options available when @value{AS} is configured
  714. for the 64-bit mode of the ARM Architecture (AArch64).
  715. @end ifclear
  716. @ifset man
  717. @c man begin OPTIONS
  718. The following options are available when @value{AS} is configured for the
  719. 64-bit mode of the ARM Architecture (AArch64).
  720. @c man end
  721. @c man begin INCLUDE
  722. @include c-aarch64.texi
  723. @c ended inside the included file
  724. @end ifset
  725. @end ifset
  726. @ifset ALPHA
  727. @ifclear man
  728. @xref{Alpha Options}, for the options available when @value{AS} is configured
  729. for an Alpha processor.
  730. @end ifclear
  731. @ifset man
  732. @c man begin OPTIONS
  733. The following options are available when @value{AS} is configured for an Alpha
  734. processor.
  735. @c man end
  736. @c man begin INCLUDE
  737. @include c-alpha.texi
  738. @c ended inside the included file
  739. @end ifset
  740. @end ifset
  741. @c man begin OPTIONS
  742. @ifset ARC
  743. The following options are available when @value{AS} is configured for an ARC
  744. processor.
  745. @table @gcctabopt
  746. @item -mcpu=@var{cpu}
  747. This option selects the core processor variant.
  748. @item -EB | -EL
  749. Select either big-endian (-EB) or little-endian (-EL) output.
  750. @item -mcode-density
  751. Enable Code Density extenssion instructions.
  752. @end table
  753. @end ifset
  754. @ifset ARM
  755. The following options are available when @value{AS} is configured for the ARM
  756. processor family.
  757. @table @gcctabopt
  758. @item -mcpu=@var{processor}[+@var{extension}@dots{}]
  759. Specify which ARM processor variant is the target.
  760. @item -march=@var{architecture}[+@var{extension}@dots{}]
  761. Specify which ARM architecture variant is used by the target.
  762. @item -mfpu=@var{floating-point-format}
  763. Select which Floating Point architecture is the target.
  764. @item -mfloat-abi=@var{abi}
  765. Select which floating point ABI is in use.
  766. @item -mthumb
  767. Enable Thumb only instruction decoding.
  768. @item -mapcs-32 | -mapcs-26 | -mapcs-float | -mapcs-reentrant
  769. Select which procedure calling convention is in use.
  770. @item -EB | -EL
  771. Select either big-endian (-EB) or little-endian (-EL) output.
  772. @item -mthumb-interwork
  773. Specify that the code has been generated with interworking between Thumb and
  774. ARM code in mind.
  775. @item -mccs
  776. Turns on CodeComposer Studio assembly syntax compatibility mode.
  777. @item -k
  778. Specify that PIC code has been generated.
  779. @end table
  780. @end ifset
  781. @c man end
  782. @ifset Blackfin
  783. @ifclear man
  784. @xref{Blackfin Options}, for the options available when @value{AS} is
  785. configured for the Blackfin processor family.
  786. @end ifclear
  787. @ifset man
  788. @c man begin OPTIONS
  789. The following options are available when @value{AS} is configured for
  790. the Blackfin processor family.
  791. @c man end
  792. @c man begin INCLUDE
  793. @include c-bfin.texi
  794. @c ended inside the included file
  795. @end ifset
  796. @end ifset
  797. @c man begin OPTIONS
  798. @ifset CRIS
  799. See the info pages for documentation of the CRIS-specific options.
  800. @end ifset
  801. @ifset D10V
  802. The following options are available when @value{AS} is configured for
  803. a D10V processor.
  804. @table @gcctabopt
  805. @cindex D10V optimization
  806. @cindex optimization, D10V
  807. @item -O
  808. Optimize output by parallelizing instructions.
  809. @end table
  810. @end ifset
  811. @ifset D30V
  812. The following options are available when @value{AS} is configured for a D30V
  813. processor.
  814. @table @gcctabopt
  815. @cindex D30V optimization
  816. @cindex optimization, D30V
  817. @item -O
  818. Optimize output by parallelizing instructions.
  819. @cindex D30V nops
  820. @item -n
  821. Warn when nops are generated.
  822. @cindex D30V nops after 32-bit multiply
  823. @item -N
  824. Warn when a nop after a 32-bit multiply instruction is generated.
  825. @end table
  826. @end ifset
  827. @c man end
  828. @ifset EPIPHANY
  829. The following options are available when @value{AS} is configured for the
  830. Adapteva EPIPHANY series.
  831. @ifclear man
  832. @xref{Epiphany Options}, for the options available when @value{AS} is
  833. configured for an Epiphany processor.
  834. @end ifclear
  835. @ifset man
  836. @c man begin OPTIONS
  837. The following options are available when @value{AS} is configured for
  838. an Epiphany processor.
  839. @c man end
  840. @c man begin INCLUDE
  841. @include c-epiphany.texi
  842. @c ended inside the included file
  843. @end ifset
  844. @end ifset
  845. @ifset H8300
  846. @ifclear man
  847. @xref{H8/300 Options}, for the options available when @value{AS} is configured
  848. for an H8/300 processor.
  849. @end ifclear
  850. @ifset man
  851. @c man begin OPTIONS
  852. The following options are available when @value{AS} is configured for an H8/300
  853. processor.
  854. @c man end
  855. @c man begin INCLUDE
  856. @include c-h8300.texi
  857. @c ended inside the included file
  858. @end ifset
  859. @end ifset
  860. @ifset I80386
  861. @ifclear man
  862. @xref{i386-Options}, for the options available when @value{AS} is
  863. configured for an i386 processor.
  864. @end ifclear
  865. @ifset man
  866. @c man begin OPTIONS
  867. The following options are available when @value{AS} is configured for
  868. an i386 processor.
  869. @c man end
  870. @c man begin INCLUDE
  871. @include c-i386.texi
  872. @c ended inside the included file
  873. @end ifset
  874. @end ifset
  875. @c man begin OPTIONS
  876. @ifset I960
  877. The following options are available when @value{AS} is configured for the
  878. Intel 80960 processor.
  879. @table @gcctabopt
  880. @item -ACA | -ACA_A | -ACB | -ACC | -AKA | -AKB | -AKC | -AMC
  881. Specify which variant of the 960 architecture is the target.
  882. @item -b
  883. Add code to collect statistics about branches taken.
  884. @item -no-relax
  885. Do not alter compare-and-branch instructions for long displacements;
  886. error if necessary.
  887. @end table
  888. @end ifset
  889. @ifset IP2K
  890. The following options are available when @value{AS} is configured for the
  891. Ubicom IP2K series.
  892. @table @gcctabopt
  893. @item -mip2022ext
  894. Specifies that the extended IP2022 instructions are allowed.
  895. @item -mip2022
  896. Restores the default behaviour, which restricts the permitted instructions to
  897. just the basic IP2022 ones.
  898. @end table
  899. @end ifset
  900. @ifset M32C
  901. The following options are available when @value{AS} is configured for the
  902. Renesas M32C and M16C processors.
  903. @table @gcctabopt
  904. @item -m32c
  905. Assemble M32C instructions.
  906. @item -m16c
  907. Assemble M16C instructions (the default).
  908. @item -relax
  909. Enable support for link-time relaxations.
  910. @item -h-tick-hex
  911. Support H'00 style hex constants in addition to 0x00 style.
  912. @end table
  913. @end ifset
  914. @ifset M32R
  915. The following options are available when @value{AS} is configured for the
  916. Renesas M32R (formerly Mitsubishi M32R) series.
  917. @table @gcctabopt
  918. @item --m32rx
  919. Specify which processor in the M32R family is the target. The default
  920. is normally the M32R, but this option changes it to the M32RX.
  921. @item --warn-explicit-parallel-conflicts or --Wp
  922. Produce warning messages when questionable parallel constructs are
  923. encountered.
  924. @item --no-warn-explicit-parallel-conflicts or --Wnp
  925. Do not produce warning messages when questionable parallel constructs are
  926. encountered.
  927. @end table
  928. @end ifset
  929. @ifset M680X0
  930. The following options are available when @value{AS} is configured for the
  931. Motorola 68000 series.
  932. @table @gcctabopt
  933. @item -l
  934. Shorten references to undefined symbols, to one word instead of two.
  935. @item -m68000 | -m68008 | -m68010 | -m68020 | -m68030
  936. @itemx | -m68040 | -m68060 | -m68302 | -m68331 | -m68332
  937. @itemx | -m68333 | -m68340 | -mcpu32 | -m5200
  938. Specify what processor in the 68000 family is the target. The default
  939. is normally the 68020, but this can be changed at configuration time.
  940. @item -m68881 | -m68882 | -mno-68881 | -mno-68882
  941. The target machine does (or does not) have a floating-point coprocessor.
  942. The default is to assume a coprocessor for 68020, 68030, and cpu32. Although
  943. the basic 68000 is not compatible with the 68881, a combination of the
  944. two can be specified, since it's possible to do emulation of the
  945. coprocessor instructions with the main processor.
  946. @item -m68851 | -mno-68851
  947. The target machine does (or does not) have a memory-management
  948. unit coprocessor. The default is to assume an MMU for 68020 and up.
  949. @end table
  950. @end ifset
  951. @ifset NIOSII
  952. @ifclear man
  953. @xref{Nios II Options}, for the options available when @value{AS} is configured
  954. for an Altera Nios II processor.
  955. @end ifclear
  956. @ifset man
  957. @c man begin OPTIONS
  958. The following options are available when @value{AS} is configured for an
  959. Altera Nios II processor.
  960. @c man end
  961. @c man begin INCLUDE
  962. @include c-nios2.texi
  963. @c ended inside the included file
  964. @end ifset
  965. @end ifset
  966. @ifset PDP11
  967. For details about the PDP-11 machine dependent features options,
  968. see @ref{PDP-11-Options}.
  969. @table @gcctabopt
  970. @item -mpic | -mno-pic
  971. Generate position-independent (or position-dependent) code. The
  972. default is @option{-mpic}.
  973. @item -mall
  974. @itemx -mall-extensions
  975. Enable all instruction set extensions. This is the default.
  976. @item -mno-extensions
  977. Disable all instruction set extensions.
  978. @item -m@var{extension} | -mno-@var{extension}
  979. Enable (or disable) a particular instruction set extension.
  980. @item -m@var{cpu}
  981. Enable the instruction set extensions supported by a particular CPU, and
  982. disable all other extensions.
  983. @item -m@var{machine}
  984. Enable the instruction set extensions supported by a particular machine
  985. model, and disable all other extensions.
  986. @end table
  987. @end ifset
  988. @ifset PJ
  989. The following options are available when @value{AS} is configured for
  990. a picoJava processor.
  991. @table @gcctabopt
  992. @cindex PJ endianness
  993. @cindex endianness, PJ
  994. @cindex big endian output, PJ
  995. @item -mb
  996. Generate ``big endian'' format output.
  997. @cindex little endian output, PJ
  998. @item -ml
  999. Generate ``little endian'' format output.
  1000. @end table
  1001. @end ifset
  1002. @ifset M68HC11
  1003. The following options are available when @value{AS} is configured for the
  1004. Motorola 68HC11 or 68HC12 series.
  1005. @table @gcctabopt
  1006. @item -m68hc11 | -m68hc12 | -m68hcs12 | -mm9s12x | -mm9s12xg
  1007. Specify what processor is the target. The default is
  1008. defined by the configuration option when building the assembler.
  1009. @item --xgate-ramoffset
  1010. Instruct the linker to offset RAM addresses from S12X address space into
  1011. XGATE address space.
  1012. @item -mshort
  1013. Specify to use the 16-bit integer ABI.
  1014. @item -mlong
  1015. Specify to use the 32-bit integer ABI.
  1016. @item -mshort-double
  1017. Specify to use the 32-bit double ABI.
  1018. @item -mlong-double
  1019. Specify to use the 64-bit double ABI.
  1020. @item --force-long-branches
  1021. Relative branches are turned into absolute ones. This concerns
  1022. conditional branches, unconditional branches and branches to a
  1023. sub routine.
  1024. @item -S | --short-branches
  1025. Do not turn relative branches into absolute ones
  1026. when the offset is out of range.
  1027. @item --strict-direct-mode
  1028. Do not turn the direct addressing mode into extended addressing mode
  1029. when the instruction does not support direct addressing mode.
  1030. @item --print-insn-syntax
  1031. Print the syntax of instruction in case of error.
  1032. @item --print-opcodes
  1033. Print the list of instructions with syntax and then exit.
  1034. @item --generate-example
  1035. Print an example of instruction for each possible instruction and then exit.
  1036. This option is only useful for testing @command{@value{AS}}.
  1037. @end table
  1038. @end ifset
  1039. @ifset SPARC
  1040. The following options are available when @command{@value{AS}} is configured
  1041. for the SPARC architecture:
  1042. @table @gcctabopt
  1043. @item -Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite
  1044. @itemx -Av8plus | -Av8plusa | -Av9 | -Av9a
  1045. Explicitly select a variant of the SPARC architecture.
  1046. @samp{-Av8plus} and @samp{-Av8plusa} select a 32 bit environment.
  1047. @samp{-Av9} and @samp{-Av9a} select a 64 bit environment.
  1048. @samp{-Av8plusa} and @samp{-Av9a} enable the SPARC V9 instruction set with
  1049. UltraSPARC extensions.
  1050. @item -xarch=v8plus | -xarch=v8plusa
  1051. For compatibility with the Solaris v9 assembler. These options are
  1052. equivalent to -Av8plus and -Av8plusa, respectively.
  1053. @item -bump
  1054. Warn when the assembler switches to another architecture.
  1055. @end table
  1056. @end ifset
  1057. @ifset TIC54X
  1058. The following options are available when @value{AS} is configured for the 'c54x
  1059. architecture.
  1060. @table @gcctabopt
  1061. @item -mfar-mode
  1062. Enable extended addressing mode. All addresses and relocations will assume
  1063. extended addressing (usually 23 bits).
  1064. @item -mcpu=@var{CPU_VERSION}
  1065. Sets the CPU version being compiled for.
  1066. @item -merrors-to-file @var{FILENAME}
  1067. Redirect error output to a file, for broken systems which don't support such
  1068. behaviour in the shell.
  1069. @end table
  1070. @end ifset
  1071. @ifset MIPS
  1072. The following options are available when @value{AS} is configured for
  1073. a MIPS processor.
  1074. @table @gcctabopt
  1075. @item -G @var{num}
  1076. This option sets the largest size of an object that can be referenced
  1077. implicitly with the @code{gp} register. It is only accepted for targets that
  1078. use ECOFF format, such as a DECstation running Ultrix. The default value is 8.
  1079. @cindex MIPS endianness
  1080. @cindex endianness, MIPS
  1081. @cindex big endian output, MIPS
  1082. @item -EB
  1083. Generate ``big endian'' format output.
  1084. @cindex little endian output, MIPS
  1085. @item -EL
  1086. Generate ``little endian'' format output.
  1087. @cindex MIPS ISA
  1088. @item -mips1
  1089. @itemx -mips2
  1090. @itemx -mips3
  1091. @itemx -mips4
  1092. @itemx -mips5
  1093. @itemx -mips32
  1094. @itemx -mips32r2
  1095. @itemx -mips32r3
  1096. @itemx -mips32r5
  1097. @itemx -mips32r6
  1098. @itemx -mips64
  1099. @itemx -mips64r2
  1100. @itemx -mips64r3
  1101. @itemx -mips64r5
  1102. @itemx -mips64r6
  1103. Generate code for a particular MIPS Instruction Set Architecture level.
  1104. @samp{-mips1} is an alias for @samp{-march=r3000}, @samp{-mips2} is an
  1105. alias for @samp{-march=r6000}, @samp{-mips3} is an alias for
  1106. @samp{-march=r4000} and @samp{-mips4} is an alias for @samp{-march=r8000}.
  1107. @samp{-mips5}, @samp{-mips32}, @samp{-mips32r2}, @samp{-mips32r3},
  1108. @samp{-mips32r5}, @samp{-mips32r6}, @samp{-mips64}, @samp{-mips64r2},
  1109. @samp{-mips64r3}, @samp{-mips64r5}, and @samp{-mips64r6} correspond to generic
  1110. MIPS V, MIPS32, MIPS32 Release 2, MIPS32 Release 3, MIPS32 Release 5, MIPS32
  1111. Release 6, MIPS64, MIPS64 Release 2, MIPS64 Release 3, MIPS64 Release 5, and
  1112. MIPS64 Release 6 ISA processors, respectively.
  1113. @item -march=@var{cpu}
  1114. Generate code for a particular MIPS CPU.
  1115. @item -mtune=@var{cpu}
  1116. Schedule and tune for a particular MIPS CPU.
  1117. @item -mfix7000
  1118. @itemx -mno-fix7000
  1119. Cause nops to be inserted if the read of the destination register
  1120. of an mfhi or mflo instruction occurs in the following two instructions.
  1121. @item -mfix-rm7000
  1122. @itemx -mno-fix-rm7000
  1123. Cause nops to be inserted if a dmult or dmultu instruction is
  1124. followed by a load instruction.
  1125. @item -mdebug
  1126. @itemx -no-mdebug
  1127. Cause stabs-style debugging output to go into an ECOFF-style .mdebug
  1128. section instead of the standard ELF .stabs sections.
  1129. @item -mpdr
  1130. @itemx -mno-pdr
  1131. Control generation of @code{.pdr} sections.
  1132. @item -mgp32
  1133. @itemx -mfp32
  1134. The register sizes are normally inferred from the ISA and ABI, but these
  1135. flags force a certain group of registers to be treated as 32 bits wide at
  1136. all times. @samp{-mgp32} controls the size of general-purpose registers
  1137. and @samp{-mfp32} controls the size of floating-point registers.
  1138. @item -mgp64
  1139. @itemx -mfp64
  1140. The register sizes are normally inferred from the ISA and ABI, but these
  1141. flags force a certain group of registers to be treated as 64 bits wide at
  1142. all times. @samp{-mgp64} controls the size of general-purpose registers
  1143. and @samp{-mfp64} controls the size of floating-point registers.
  1144. @item -mfpxx
  1145. The register sizes are normally inferred from the ISA and ABI, but using
  1146. this flag in combination with @samp{-mabi=32} enables an ABI variant
  1147. which will operate correctly with floating-point registers which are
  1148. 32 or 64 bits wide.
  1149. @item -modd-spreg
  1150. @itemx -mno-odd-spreg
  1151. Enable use of floating-point operations on odd-numbered single-precision
  1152. registers when supported by the ISA. @samp{-mfpxx} implies
  1153. @samp{-mno-odd-spreg}, otherwise the default is @samp{-modd-spreg}.
  1154. @item -mips16
  1155. @itemx -no-mips16
  1156. Generate code for the MIPS 16 processor. This is equivalent to putting
  1157. @code{.set mips16} at the start of the assembly file. @samp{-no-mips16}
  1158. turns off this option.
  1159. @item -mmicromips
  1160. @itemx -mno-micromips
  1161. Generate code for the microMIPS processor. This is equivalent to putting
  1162. @code{.set micromips} at the start of the assembly file. @samp{-mno-micromips}
  1163. turns off this option. This is equivalent to putting @code{.set nomicromips}
  1164. at the start of the assembly file.
  1165. @item -msmartmips
  1166. @itemx -mno-smartmips
  1167. Enables the SmartMIPS extension to the MIPS32 instruction set. This is
  1168. equivalent to putting @code{.set smartmips} at the start of the assembly file.
  1169. @samp{-mno-smartmips} turns off this option.
  1170. @item -mips3d
  1171. @itemx -no-mips3d
  1172. Generate code for the MIPS-3D Application Specific Extension.
  1173. This tells the assembler to accept MIPS-3D instructions.
  1174. @samp{-no-mips3d} turns off this option.
  1175. @item -mdmx
  1176. @itemx -no-mdmx
  1177. Generate code for the MDMX Application Specific Extension.
  1178. This tells the assembler to accept MDMX instructions.
  1179. @samp{-no-mdmx} turns off this option.
  1180. @item -mdsp
  1181. @itemx -mno-dsp
  1182. Generate code for the DSP Release 1 Application Specific Extension.
  1183. This tells the assembler to accept DSP Release 1 instructions.
  1184. @samp{-mno-dsp} turns off this option.
  1185. @item -mdspr2
  1186. @itemx -mno-dspr2
  1187. Generate code for the DSP Release 2 Application Specific Extension.
  1188. This option implies -mdsp.
  1189. This tells the assembler to accept DSP Release 2 instructions.
  1190. @samp{-mno-dspr2} turns off this option.
  1191. @item -mmsa
  1192. @itemx -mno-msa
  1193. Generate code for the MIPS SIMD Architecture Extension.
  1194. This tells the assembler to accept MSA instructions.
  1195. @samp{-mno-msa} turns off this option.
  1196. @item -mxpa
  1197. @itemx -mno-xpa
  1198. Generate code for the MIPS eXtended Physical Address (XPA) Extension.
  1199. This tells the assembler to accept XPA instructions.
  1200. @samp{-mno-xpa} turns off this option.
  1201. @item -mmt
  1202. @itemx -mno-mt
  1203. Generate code for the MT Application Specific Extension.
  1204. This tells the assembler to accept MT instructions.
  1205. @samp{-mno-mt} turns off this option.
  1206. @item -mmcu
  1207. @itemx -mno-mcu
  1208. Generate code for the MCU Application Specific Extension.
  1209. This tells the assembler to accept MCU instructions.
  1210. @samp{-mno-mcu} turns off this option.
  1211. @item -minsn32
  1212. @itemx -mno-insn32
  1213. Only use 32-bit instruction encodings when generating code for the
  1214. microMIPS processor. This option inhibits the use of any 16-bit
  1215. instructions. This is equivalent to putting @code{.set insn32} at
  1216. the start of the assembly file. @samp{-mno-insn32} turns off this
  1217. option. This is equivalent to putting @code{.set noinsn32} at the
  1218. start of the assembly file. By default @samp{-mno-insn32} is
  1219. selected, allowing all instructions to be used.
  1220. @item --construct-floats
  1221. @itemx --no-construct-floats
  1222. The @samp{--no-construct-floats} option disables the construction of
  1223. double width floating point constants by loading the two halves of the
  1224. value into the two single width floating point registers that make up
  1225. the double width register. By default @samp{--construct-floats} is
  1226. selected, allowing construction of these floating point constants.
  1227. @item --relax-branch
  1228. @itemx --no-relax-branch
  1229. The @samp{--relax-branch} option enables the relaxation of out-of-range
  1230. branches. By default @samp{--no-relax-branch} is selected, causing any
  1231. out-of-range branches to produce an error.
  1232. @item -mnan=@var{encoding}
  1233. Select between the IEEE 754-2008 (@option{-mnan=2008}) or the legacy
  1234. (@option{-mnan=legacy}) NaN encoding format. The latter is the default.
  1235. @cindex emulation
  1236. @item --emulation=@var{name}
  1237. This option was formerly used to switch between ELF and ECOFF output
  1238. on targets like IRIX 5 that supported both. MIPS ECOFF support was
  1239. removed in GAS 2.24, so the option now serves little purpose.
  1240. It is retained for backwards compatibility.
  1241. The available configuration names are: @samp{mipself}, @samp{mipslelf} and
  1242. @samp{mipsbelf}. Choosing @samp{mipself} now has no effect, since the output
  1243. is always ELF. @samp{mipslelf} and @samp{mipsbelf} select little- and
  1244. big-endian output respectively, but @samp{-EL} and @samp{-EB} are now the
  1245. preferred options instead.
  1246. @item -nocpp
  1247. @command{@value{AS}} ignores this option. It is accepted for compatibility with
  1248. the native tools.
  1249. @item --trap
  1250. @itemx --no-trap
  1251. @itemx --break
  1252. @itemx --no-break
  1253. Control how to deal with multiplication overflow and division by zero.
  1254. @samp{--trap} or @samp{--no-break} (which are synonyms) take a trap exception
  1255. (and only work for Instruction Set Architecture level 2 and higher);
  1256. @samp{--break} or @samp{--no-trap} (also synonyms, and the default) take a
  1257. break exception.
  1258. @item -n
  1259. When this option is used, @command{@value{AS}} will issue a warning every
  1260. time it generates a nop instruction from a macro.
  1261. @end table
  1262. @end ifset
  1263. @ifset MCORE
  1264. The following options are available when @value{AS} is configured for
  1265. an MCore processor.
  1266. @table @gcctabopt
  1267. @item -jsri2bsr
  1268. @itemx -nojsri2bsr
  1269. Enable or disable the JSRI to BSR transformation. By default this is enabled.
  1270. The command line option @samp{-nojsri2bsr} can be used to disable it.
  1271. @item -sifilter
  1272. @itemx -nosifilter
  1273. Enable or disable the silicon filter behaviour. By default this is disabled.
  1274. The default can be overridden by the @samp{-sifilter} command line option.
  1275. @item -relax
  1276. Alter jump instructions for long displacements.
  1277. @item -mcpu=[210|340]
  1278. Select the cpu type on the target hardware. This controls which instructions
  1279. can be assembled.
  1280. @item -EB
  1281. Assemble for a big endian target.
  1282. @item -EL
  1283. Assemble for a little endian target.
  1284. @end table
  1285. @end ifset
  1286. @c man end
  1287. @ifset METAG
  1288. @ifclear man
  1289. @xref{Meta Options}, for the options available when @value{AS} is configured
  1290. for a Meta processor.
  1291. @end ifclear
  1292. @ifset man
  1293. @c man begin OPTIONS
  1294. The following options are available when @value{AS} is configured for a
  1295. Meta processor.
  1296. @c man end
  1297. @c man begin INCLUDE
  1298. @include c-metag.texi
  1299. @c ended inside the included file
  1300. @end ifset
  1301. @end ifset
  1302. @c man begin OPTIONS
  1303. @ifset MMIX
  1304. See the info pages for documentation of the MMIX-specific options.
  1305. @end ifset
  1306. @ifset NDS32
  1307. @ifclear man
  1308. @xref{NDS32 Options}, for the options available when @value{AS} is configured
  1309. for a NDS32 processor.
  1310. @end ifclear
  1311. @c ended inside the included file
  1312. @end ifset
  1313. @ifset man
  1314. @c man begin OPTIONS
  1315. The following options are available when @value{AS} is configured for a
  1316. NDS32 processor.
  1317. @c man end
  1318. @c man begin INCLUDE
  1319. @include c-nds32.texi
  1320. @c ended inside the included file
  1321. @end ifset
  1322. @c man end
  1323. @ifset PPC
  1324. @ifclear man
  1325. @xref{PowerPC-Opts}, for the options available when @value{AS} is configured
  1326. for a PowerPC processor.
  1327. @end ifclear
  1328. @ifset man
  1329. @c man begin OPTIONS
  1330. The following options are available when @value{AS} is configured for a
  1331. PowerPC processor.
  1332. @c man end
  1333. @c man begin INCLUDE
  1334. @include c-ppc.texi
  1335. @c ended inside the included file
  1336. @end ifset
  1337. @end ifset
  1338. @c man begin OPTIONS
  1339. @ifset RX
  1340. See the info pages for documentation of the RX-specific options.
  1341. @end ifset
  1342. @ifset S390
  1343. The following options are available when @value{AS} is configured for the s390
  1344. processor family.
  1345. @table @gcctabopt
  1346. @item -m31
  1347. @itemx -m64
  1348. Select the word size, either 31/32 bits or 64 bits.
  1349. @item -mesa
  1350. @item -mzarch
  1351. Select the architecture mode, either the Enterprise System
  1352. Architecture (esa) or the z/Architecture mode (zarch).
  1353. @item -march=@var{processor}
  1354. Specify which s390 processor variant is the target, @samp{g6}, @samp{g6},
  1355. @samp{z900}, @samp{z990}, @samp{z9-109}, @samp{z9-ec}, @samp{z10},
  1356. @samp{z196}, @samp{zEC12}, or @samp{z13}.
  1357. @item -mregnames
  1358. @itemx -mno-regnames
  1359. Allow or disallow symbolic names for registers.
  1360. @item -mwarn-areg-zero
  1361. Warn whenever the operand for a base or index register has been specified
  1362. but evaluates to zero.
  1363. @end table
  1364. @end ifset
  1365. @c man end
  1366. @ifset TIC6X
  1367. @ifclear man
  1368. @xref{TIC6X Options}, for the options available when @value{AS} is configured
  1369. for a TMS320C6000 processor.
  1370. @end ifclear
  1371. @ifset man
  1372. @c man begin OPTIONS
  1373. The following options are available when @value{AS} is configured for a
  1374. TMS320C6000 processor.
  1375. @c man end
  1376. @c man begin INCLUDE
  1377. @include c-tic6x.texi
  1378. @c ended inside the included file
  1379. @end ifset
  1380. @end ifset
  1381. @ifset TILEGX
  1382. @ifclear man
  1383. @xref{TILE-Gx Options}, for the options available when @value{AS} is configured
  1384. for a TILE-Gx processor.
  1385. @end ifclear
  1386. @ifset man
  1387. @c man begin OPTIONS
  1388. The following options are available when @value{AS} is configured for a TILE-Gx
  1389. processor.
  1390. @c man end
  1391. @c man begin INCLUDE
  1392. @include c-tilegx.texi
  1393. @c ended inside the included file
  1394. @end ifset
  1395. @end ifset
  1396. @ifset VISIUM
  1397. @ifclear man
  1398. @xref{Visium Options}, for the options available when @value{AS} is configured
  1399. for a Visium processor.
  1400. @end ifclear
  1401. @ifset man
  1402. @c man begin OPTIONS
  1403. The following option is available when @value{AS} is configured for a Visium
  1404. processor.
  1405. @c man end
  1406. @c man begin INCLUDE
  1407. @include c-visium.texi
  1408. @c ended inside the included file
  1409. @end ifset
  1410. @end ifset
  1411. @ifset XTENSA
  1412. @ifclear man
  1413. @xref{Xtensa Options}, for the options available when @value{AS} is configured
  1414. for an Xtensa processor.
  1415. @end ifclear
  1416. @ifset man
  1417. @c man begin OPTIONS
  1418. The following options are available when @value{AS} is configured for an
  1419. Xtensa processor.
  1420. @c man end
  1421. @c man begin INCLUDE
  1422. @include c-xtensa.texi
  1423. @c ended inside the included file
  1424. @end ifset
  1425. @end ifset
  1426. @c man begin OPTIONS
  1427. @ifset Z80
  1428. The following options are available when @value{AS} is configured for
  1429. a Z80 family processor.
  1430. @table @gcctabopt
  1431. @item -z80
  1432. Assemble for Z80 processor.
  1433. @item -r800
  1434. Assemble for R800 processor.
  1435. @item -ignore-undocumented-instructions
  1436. @itemx -Wnud
  1437. Assemble undocumented Z80 instructions that also work on R800 without warning.
  1438. @item -ignore-unportable-instructions
  1439. @itemx -Wnup
  1440. Assemble all undocumented Z80 instructions without warning.
  1441. @item -warn-undocumented-instructions
  1442. @itemx -Wud
  1443. Issue a warning for undocumented Z80 instructions that also work on R800.
  1444. @item -warn-unportable-instructions
  1445. @itemx -Wup
  1446. Issue a warning for undocumented Z80 instructions that do not work on R800.
  1447. @item -forbid-undocumented-instructions
  1448. @itemx -Fud
  1449. Treat all undocumented instructions as errors.
  1450. @item -forbid-unportable-instructions
  1451. @itemx -Fup
  1452. Treat undocumented Z80 instructions that do not work on R800 as errors.
  1453. @end table
  1454. @end ifset
  1455. @c man end
  1456. @menu
  1457. * Manual:: Structure of this Manual
  1458. * GNU Assembler:: The GNU Assembler
  1459. * Object Formats:: Object File Formats
  1460. * Command Line:: Command Line
  1461. * Input Files:: Input Files
  1462. * Object:: Output (Object) File
  1463. * Errors:: Error and Warning Messages
  1464. @end menu
  1465. @node Manual
  1466. @section Structure of this Manual
  1467. @cindex manual, structure and purpose
  1468. This manual is intended to describe what you need to know to use
  1469. @sc{gnu} @command{@value{AS}}. We cover the syntax expected in source files, including
  1470. notation for symbols, constants, and expressions; the directives that
  1471. @command{@value{AS}} understands; and of course how to invoke @command{@value{AS}}.
  1472. @ifclear GENERIC
  1473. We also cover special features in the @value{TARGET}
  1474. configuration of @command{@value{AS}}, including assembler directives.
  1475. @end ifclear
  1476. @ifset GENERIC
  1477. This manual also describes some of the machine-dependent features of
  1478. various flavors of the assembler.
  1479. @end ifset
  1480. @cindex machine instructions (not covered)
  1481. On the other hand, this manual is @emph{not} intended as an introduction
  1482. to programming in assembly language---let alone programming in general!
  1483. In a similar vein, we make no attempt to introduce the machine
  1484. architecture; we do @emph{not} describe the instruction set, standard
  1485. mnemonics, registers or addressing modes that are standard to a
  1486. particular architecture.
  1487. @ifset GENERIC
  1488. You may want to consult the manufacturer's
  1489. machine architecture manual for this information.
  1490. @end ifset
  1491. @ifclear GENERIC
  1492. @ifset H8/300
  1493. For information on the H8/300 machine instruction set, see @cite{H8/300
  1494. Series Programming Manual}. For the H8/300H, see @cite{H8/300H Series
  1495. Programming Manual} (Renesas).
  1496. @end ifset
  1497. @ifset SH
  1498. For information on the Renesas (formerly Hitachi) / SuperH SH machine instruction set,
  1499. see @cite{SH-Microcomputer User's Manual} (Renesas) or
  1500. @cite{SH-4 32-bit CPU Core Architecture} (SuperH) and
  1501. @cite{SuperH (SH) 64-Bit RISC Series} (SuperH).
  1502. @end ifset
  1503. @ifset Z8000
  1504. For information on the Z8000 machine instruction set, see @cite{Z8000 CPU Technical Manual}
  1505. @end ifset
  1506. @end ifclear
  1507. @c I think this is premature---doc@cygnus.com, 17jan1991
  1508. @ignore
  1509. Throughout this manual, we assume that you are running @dfn{GNU},
  1510. the portable operating system from the @dfn{Free Software
  1511. Foundation, Inc.}. This restricts our attention to certain kinds of
  1512. computer (in particular, the kinds of computers that @sc{gnu} can run on);
  1513. once this assumption is granted examples and definitions need less
  1514. qualification.
  1515. @command{@value{AS}} is part of a team of programs that turn a high-level
  1516. human-readable series of instructions into a low-level
  1517. computer-readable series of instructions. Different versions of
  1518. @command{@value{AS}} are used for different kinds of computer.
  1519. @end ignore
  1520. @c There used to be a section "Terminology" here, which defined
  1521. @c "contents", "byte", "word", and "long". Defining "word" to any
  1522. @c particular size is confusing when the .word directive may generate 16
  1523. @c bits on one machine and 32 bits on another; in general, for the user
  1524. @c version of this manual, none of these terms seem essential to define.
  1525. @c They were used very little even in the former draft of the manual;
  1526. @c this draft makes an effort to avoid them (except in names of
  1527. @c directives).
  1528. @node GNU Assembler
  1529. @section The GNU Assembler
  1530. @c man begin DESCRIPTION
  1531. @sc{gnu} @command{as} is really a family of assemblers.
  1532. @ifclear GENERIC
  1533. This manual describes @command{@value{AS}}, a member of that family which is
  1534. configured for the @value{TARGET} architectures.
  1535. @end ifclear
  1536. If you use (or have used) the @sc{gnu} assembler on one architecture, you
  1537. should find a fairly similar environment when you use it on another
  1538. architecture. Each version has much in common with the others,
  1539. including object file formats, most assembler directives (often called
  1540. @dfn{pseudo-ops}) and assembler syntax.@refill
  1541. @cindex purpose of @sc{gnu} assembler
  1542. @command{@value{AS}} is primarily intended to assemble the output of the
  1543. @sc{gnu} C compiler @code{@value{GCC}} for use by the linker
  1544. @code{@value{LD}}. Nevertheless, we've tried to make @command{@value{AS}}
  1545. assemble correctly everything that other assemblers for the same
  1546. machine would assemble.
  1547. @ifset VAX
  1548. Any exceptions are documented explicitly (@pxref{Machine Dependencies}).
  1549. @end ifset
  1550. @ifset M680X0
  1551. @c This remark should appear in generic version of manual; assumption
  1552. @c here is that generic version sets M680x0.
  1553. This doesn't mean @command{@value{AS}} always uses the same syntax as another
  1554. assembler for the same architecture; for example, we know of several
  1555. incompatible versions of 680x0 assembly language syntax.
  1556. @end ifset
  1557. @c man end
  1558. Unlike older assemblers, @command{@value{AS}} is designed to assemble a source
  1559. program in one pass of the source file. This has a subtle impact on the
  1560. @kbd{.org} directive (@pxref{Org,,@code{.org}}).
  1561. @node Object Formats
  1562. @section Object File Formats
  1563. @cindex object file format
  1564. The @sc{gnu} assembler can be configured to produce several alternative
  1565. object file formats. For the most part, this does not affect how you
  1566. write assembly language programs; but directives for debugging symbols
  1567. are typically different in different file formats. @xref{Symbol
  1568. Attributes,,Symbol Attributes}.
  1569. @ifclear GENERIC
  1570. @ifclear MULTI-OBJ
  1571. For the @value{TARGET} target, @command{@value{AS}} is configured to produce
  1572. @value{OBJ-NAME} format object files.
  1573. @end ifclear
  1574. @c The following should exhaust all configs that set MULTI-OBJ, ideally
  1575. @ifset I960
  1576. On the @value{TARGET}, @command{@value{AS}} can be configured to produce either
  1577. @code{b.out} or COFF format object files.
  1578. @end ifset
  1579. @ifset HPPA
  1580. On the @value{TARGET}, @command{@value{AS}} can be configured to produce either
  1581. SOM or ELF format object files.
  1582. @end ifset
  1583. @end ifclear
  1584. @node Command Line
  1585. @section Command Line
  1586. @cindex command line conventions
  1587. After the program name @command{@value{AS}}, the command line may contain
  1588. options and file names. Options may appear in any order, and may be
  1589. before, after, or between file names. The order of file names is
  1590. significant.
  1591. @cindex standard input, as input file
  1592. @kindex --
  1593. @file{--} (two hyphens) by itself names the standard input file
  1594. explicitly, as one of the files for @command{@value{AS}} to assemble.
  1595. @cindex options, command line
  1596. Except for @samp{--} any command line argument that begins with a
  1597. hyphen (@samp{-}) is an option. Each option changes the behavior of
  1598. @command{@value{AS}}. No option changes the way another option works. An
  1599. option is a @samp{-} followed by one or more letters; the case of
  1600. the letter is important. All options are optional.
  1601. Some options expect exactly one file name to follow them. The file
  1602. name may either immediately follow the option's letter (compatible
  1603. with older assemblers) or it may be the next command argument (@sc{gnu}
  1604. standard). These two command lines are equivalent:
  1605. @smallexample
  1606. @value{AS} -o my-object-file.o mumble.s
  1607. @value{AS} -omy-object-file.o mumble.s
  1608. @end smallexample
  1609. @node Input Files
  1610. @section Input Files
  1611. @cindex input
  1612. @cindex source program
  1613. @cindex files, input
  1614. We use the phrase @dfn{source program}, abbreviated @dfn{source}, to
  1615. describe the program input to one run of @command{@value{AS}}. The program may
  1616. be in one or more files; how the source is partitioned into files
  1617. doesn't change the meaning of the source.
  1618. @c I added "con" prefix to "catenation" just to prove I can overcome my
  1619. @c APL training... doc@cygnus.com
  1620. The source program is a concatenation of the text in all the files, in the
  1621. order specified.
  1622. @c man begin DESCRIPTION
  1623. Each time you run @command{@value{AS}} it assembles exactly one source
  1624. program. The source program is made up of one or more files.
  1625. (The standard input is also a file.)
  1626. You give @command{@value{AS}} a command line that has zero or more input file
  1627. names. The input files are read (from left file name to right). A
  1628. command line argument (in any position) that has no special meaning
  1629. is taken to be an input file name.
  1630. If you give @command{@value{AS}} no file names it attempts to read one input file
  1631. from the @command{@value{AS}} standard input, which is normally your terminal. You
  1632. may have to type @key{ctl-D} to tell @command{@value{AS}} there is no more program
  1633. to assemble.
  1634. Use @samp{--} if you need to explicitly name the standard input file
  1635. in your command line.
  1636. If the source is empty, @command{@value{AS}} produces a small, empty object
  1637. file.
  1638. @c man end
  1639. @subheading Filenames and Line-numbers
  1640. @cindex input file linenumbers
  1641. @cindex line numbers, in input files
  1642. There are two ways of locating a line in the input file (or files) and
  1643. either may be used in reporting error messages. One way refers to a line
  1644. number in a physical file; the other refers to a line number in a
  1645. ``logical'' file. @xref{Errors, ,Error and Warning Messages}.
  1646. @dfn{Physical files} are those files named in the command line given
  1647. to @command{@value{AS}}.
  1648. @dfn{Logical files} are simply names declared explicitly by assembler
  1649. directives; they bear no relation to physical files. Logical file names help
  1650. error messages reflect the original source file, when @command{@value{AS}} source
  1651. is itself synthesized from other files. @command{@value{AS}} understands the
  1652. @samp{#} directives emitted by the @code{@value{GCC}} preprocessor. See also
  1653. @ref{File,,@code{.file}}.
  1654. @node Object
  1655. @section Output (Object) File
  1656. @cindex object file
  1657. @cindex output file
  1658. @kindex a.out
  1659. @kindex .o
  1660. Every time you run @command{@value{AS}} it produces an output file, which is
  1661. your assembly language program translated into numbers. This file
  1662. is the object file. Its default name is
  1663. @ifclear BOUT
  1664. @code{a.out}.
  1665. @end ifclear
  1666. @ifset BOUT
  1667. @ifset GENERIC
  1668. @code{a.out}, or
  1669. @end ifset
  1670. @code{b.out} when @command{@value{AS}} is configured for the Intel 80960.
  1671. @end ifset
  1672. You can give it another name by using the @option{-o} option. Conventionally,
  1673. object file names end with @file{.o}. The default name is used for historical
  1674. reasons: older assemblers were capable of assembling self-contained programs
  1675. directly into a runnable program. (For some formats, this isn't currently
  1676. possible, but it can be done for the @code{a.out} format.)
  1677. @cindex linker
  1678. @kindex ld
  1679. The object file is meant for input to the linker @code{@value{LD}}. It contains
  1680. assembled program code, information to help @code{@value{LD}} integrate
  1681. the assembled program into a runnable file, and (optionally) symbolic
  1682. information for the debugger.
  1683. @c link above to some info file(s) like the description of a.out.
  1684. @c don't forget to describe @sc{gnu} info as well as Unix lossage.
  1685. @node Errors
  1686. @section Error and Warning Messages
  1687. @c man begin DESCRIPTION
  1688. @cindex error messages
  1689. @cindex warning messages
  1690. @cindex messages from assembler
  1691. @command{@value{AS}} may write warnings and error messages to the standard error
  1692. file (usually your terminal). This should not happen when a compiler
  1693. runs @command{@value{AS}} automatically. Warnings report an assumption made so
  1694. that @command{@value{AS}} could keep assembling a flawed program; errors report a
  1695. grave problem that stops the assembly.
  1696. @c man end
  1697. @cindex format of warning messages
  1698. Warning messages have the format
  1699. @smallexample
  1700. file_name:@b{NNN}:Warning Message Text
  1701. @end smallexample
  1702. @noindent
  1703. @cindex line numbers, in warnings/errors
  1704. (where @b{NNN} is a line number). If a logical file name has been given
  1705. (@pxref{File,,@code{.file}}) it is used for the filename, otherwise the name of
  1706. the current input file is used. If a logical line number was given
  1707. @ifset GENERIC
  1708. (@pxref{Line,,@code{.line}})
  1709. @end ifset
  1710. then it is used to calculate the number printed,
  1711. otherwise the actual line in the current source file is printed. The
  1712. message text is intended to be self explanatory (in the grand Unix
  1713. tradition).
  1714. @cindex format of error messages
  1715. Error messages have the format
  1716. @smallexample
  1717. file_name:@b{NNN}:FATAL:Error Message Text
  1718. @end smallexample
  1719. The file name and line number are derived as for warning
  1720. messages. The actual message text may be rather less explanatory
  1721. because many of them aren't supposed to happen.
  1722. @node Invoking
  1723. @chapter Command-Line Options
  1724. @cindex options, all versions of assembler
  1725. This chapter describes command-line options available in @emph{all}
  1726. versions of the @sc{gnu} assembler; see @ref{Machine Dependencies},
  1727. for options specific
  1728. @ifclear GENERIC
  1729. to the @value{TARGET} target.
  1730. @end ifclear
  1731. @ifset GENERIC
  1732. to particular machine architectures.
  1733. @end ifset
  1734. @c man begin DESCRIPTION
  1735. If you are invoking @command{@value{AS}} via the @sc{gnu} C compiler,
  1736. you can use the @samp{-Wa} option to pass arguments through to the assembler.
  1737. The assembler arguments must be separated from each other (and the @samp{-Wa})
  1738. by commas. For example:
  1739. @smallexample
  1740. gcc -c -g -O -Wa,-alh,-L file.c
  1741. @end smallexample
  1742. @noindent
  1743. This passes two options to the assembler: @samp{-alh} (emit a listing to
  1744. standard output with high-level and assembly source) and @samp{-L} (retain
  1745. local symbols in the symbol table).
  1746. Usually you do not need to use this @samp{-Wa} mechanism, since many compiler
  1747. command-line options are automatically passed to the assembler by the compiler.
  1748. (You can call the @sc{gnu} compiler driver with the @samp{-v} option to see
  1749. precisely what options it passes to each compilation pass, including the
  1750. assembler.)
  1751. @c man end
  1752. @menu
  1753. * a:: -a[cdghlns] enable listings
  1754. * alternate:: --alternate enable alternate macro syntax
  1755. * D:: -D for compatibility
  1756. * f:: -f to work faster
  1757. * I:: -I for .include search path
  1758. @ifclear DIFF-TBL-KLUGE
  1759. * K:: -K for compatibility
  1760. @end ifclear
  1761. @ifset DIFF-TBL-KLUGE
  1762. * K:: -K for difference tables
  1763. @end ifset
  1764. * L:: -L to retain local symbols
  1765. * listing:: --listing-XXX to configure listing output
  1766. * M:: -M or --mri to assemble in MRI compatibility mode
  1767. * MD:: --MD for dependency tracking
  1768. * o:: -o to name the object file
  1769. * R:: -R to join data and text sections
  1770. * statistics:: --statistics to see statistics about assembly
  1771. * traditional-format:: --traditional-format for compatible output
  1772. * v:: -v to announce version
  1773. * W:: -W, --no-warn, --warn, --fatal-warnings to control warnings
  1774. * Z:: -Z to make object file even after errors
  1775. @end menu
  1776. @node a
  1777. @section Enable Listings: @option{-a[cdghlns]}
  1778. @kindex -a
  1779. @kindex -ac
  1780. @kindex -ad
  1781. @kindex -ag
  1782. @kindex -ah
  1783. @kindex -al
  1784. @kindex -an
  1785. @kindex -as
  1786. @cindex listings, enabling
  1787. @cindex assembly listings, enabling
  1788. These options enable listing output from the assembler. By itself,
  1789. @samp{-a} requests high-level, assembly, and symbols listing.
  1790. You can use other letters to select specific options for the list:
  1791. @samp{-ah} requests a high-level language listing,
  1792. @samp{-al} requests an output-program assembly listing, and
  1793. @samp{-as} requests a symbol table listing.
  1794. High-level listings require that a compiler debugging option like
  1795. @samp{-g} be used, and that assembly listings (@samp{-al}) be requested
  1796. also.
  1797. Use the @samp{-ag} option to print a first section with general assembly
  1798. information, like @value{AS} version, switches passed, or time stamp.
  1799. Use the @samp{-ac} option to omit false conditionals from a listing. Any lines
  1800. which are not assembled because of a false @code{.if} (or @code{.ifdef}, or any
  1801. other conditional), or a true @code{.if} followed by an @code{.else}, will be
  1802. omitted from the listing.
  1803. Use the @samp{-ad} option to omit debugging directives from the
  1804. listing.
  1805. Once you have specified one of these options, you can further control
  1806. listing output and its appearance using the directives @code{.list},
  1807. @code{.nolist}, @code{.psize}, @code{.eject}, @code{.title}, and
  1808. @code{.sbttl}.
  1809. The @samp{-an} option turns off all forms processing.
  1810. If you do not request listing output with one of the @samp{-a} options, the
  1811. listing-control directives have no effect.
  1812. The letters after @samp{-a} may be combined into one option,
  1813. @emph{e.g.}, @samp{-aln}.
  1814. Note if the assembler source is coming from the standard input (e.g.,
  1815. because it
  1816. is being created by @code{@value{GCC}} and the @samp{-pipe} command line switch
  1817. is being used) then the listing will not contain any comments or preprocessor
  1818. directives. This is because the listing code buffers input source lines from
  1819. stdin only after they have been preprocessed by the assembler. This reduces
  1820. memory usage and makes the code more efficient.
  1821. @node alternate
  1822. @section @option{--alternate}
  1823. @kindex --alternate
  1824. Begin in alternate macro mode, see @ref{Altmacro,,@code{.altmacro}}.
  1825. @node D
  1826. @section @option{-D}
  1827. @kindex -D
  1828. This option has no effect whatsoever, but it is accepted to make it more
  1829. likely that scripts written for other assemblers also work with
  1830. @command{@value{AS}}.
  1831. @node f
  1832. @section Work Faster: @option{-f}
  1833. @kindex -f
  1834. @cindex trusted compiler
  1835. @cindex faster processing (@option{-f})
  1836. @samp{-f} should only be used when assembling programs written by a
  1837. (trusted) compiler. @samp{-f} stops the assembler from doing whitespace
  1838. and comment preprocessing on
  1839. the input file(s) before assembling them. @xref{Preprocessing,
  1840. ,Preprocessing}.
  1841. @quotation
  1842. @emph{Warning:} if you use @samp{-f} when the files actually need to be
  1843. preprocessed (if they contain comments, for example), @command{@value{AS}} does
  1844. not work correctly.
  1845. @end quotation
  1846. @node I
  1847. @section @code{.include} Search Path: @option{-I} @var{path}
  1848. @kindex -I @var{path}
  1849. @cindex paths for @code{.include}
  1850. @cindex search path for @code{.include}
  1851. @cindex @code{include} directive search path
  1852. Use this option to add a @var{path} to the list of directories
  1853. @command{@value{AS}} searches for files specified in @code{.include}
  1854. directives (@pxref{Include,,@code{.include}}). You may use @option{-I} as
  1855. many times as necessary to include a variety of paths. The current
  1856. working directory is always searched first; after that, @command{@value{AS}}
  1857. searches any @samp{-I} directories in the same order as they were
  1858. specified (left to right) on the command line.
  1859. @node K
  1860. @section Difference Tables: @option{-K}
  1861. @kindex -K
  1862. @ifclear DIFF-TBL-KLUGE
  1863. On the @value{TARGET} family, this option is allowed, but has no effect. It is
  1864. permitted for compatibility with the @sc{gnu} assembler on other platforms,
  1865. where it can be used to warn when the assembler alters the machine code
  1866. generated for @samp{.word} directives in difference tables. The @value{TARGET}
  1867. family does not have the addressing limitations that sometimes lead to this
  1868. alteration on other platforms.
  1869. @end ifclear
  1870. @ifset DIFF-TBL-KLUGE
  1871. @cindex difference tables, warning
  1872. @cindex warning for altered difference tables
  1873. @command{@value{AS}} sometimes alters the code emitted for directives of the
  1874. form @samp{.word @var{sym1}-@var{sym2}}. @xref{Word,,@code{.word}}.
  1875. You can use the @samp{-K} option if you want a warning issued when this
  1876. is done.
  1877. @end ifset
  1878. @node L
  1879. @section Include Local Symbols: @option{-L}
  1880. @kindex -L
  1881. @cindex local symbols, retaining in output
  1882. Symbols beginning with system-specific local label prefixes, typically
  1883. @samp{.L} for ELF systems or @samp{L} for traditional a.out systems, are
  1884. called @dfn{local symbols}. @xref{Symbol Names}. Normally you do not see
  1885. such symbols when debugging, because they are intended for the use of
  1886. programs (like compilers) that compose assembler programs, not for your
  1887. notice. Normally both @command{@value{AS}} and @code{@value{LD}} discard
  1888. such symbols, so you do not normally debug with them.
  1889. This option tells @command{@value{AS}} to retain those local symbols
  1890. in the object file. Usually if you do this you also tell the linker
  1891. @code{@value{LD}} to preserve those symbols.
  1892. @node listing
  1893. @section Configuring listing output: @option{--listing}
  1894. The listing feature of the assembler can be enabled via the command line switch
  1895. @samp{-a} (@pxref{a}). This feature combines the input source file(s) with a
  1896. hex dump of the corresponding locations in the output object file, and displays
  1897. them as a listing file. The format of this listing can be controlled by
  1898. directives inside the assembler source (i.e., @code{.list} (@pxref{List}),
  1899. @code{.title} (@pxref{Title}), @code{.sbttl} (@pxref{Sbttl}),
  1900. @code{.psize} (@pxref{Psize}), and
  1901. @code{.eject} (@pxref{Eject}) and also by the following switches:
  1902. @table @gcctabopt
  1903. @item --listing-lhs-width=@samp{number}
  1904. @kindex --listing-lhs-width
  1905. @cindex Width of first line disassembly output
  1906. Sets the maximum width, in words, of the first line of the hex byte dump. This
  1907. dump appears on the left hand side of the listing output.
  1908. @item --listing-lhs-width2=@samp{number}
  1909. @kindex --listing-lhs-width2
  1910. @cindex Width of continuation lines of disassembly output
  1911. Sets the maximum width, in words, of any further lines of the hex byte dump for
  1912. a given input source line. If this value is not specified, it defaults to being
  1913. the same as the value specified for @samp{--listing-lhs-width}. If neither
  1914. switch is used the default is to one.
  1915. @item --listing-rhs-width=@samp{number}
  1916. @kindex --listing-rhs-width
  1917. @cindex Width of source line output
  1918. Sets the maximum width, in characters, of the source line that is displayed
  1919. alongside the hex dump. The default value for this parameter is 100. The
  1920. source line is displayed on the right hand side of the listing output.
  1921. @item --listing-cont-lines=@samp{number}
  1922. @kindex --listing-cont-lines
  1923. @cindex Maximum number of continuation lines
  1924. Sets the maximum number of continuation lines of hex dump that will be
  1925. displayed for a given single line of source input. The default value is 4.
  1926. @end table
  1927. @node M
  1928. @section Assemble in MRI Compatibility Mode: @option{-M}
  1929. @kindex -M
  1930. @cindex MRI compatibility mode
  1931. The @option{-M} or @option{--mri} option selects MRI compatibility mode. This
  1932. changes the syntax and pseudo-op handling of @command{@value{AS}} to make it
  1933. compatible with the @code{ASM68K} or the @code{ASM960} (depending upon the
  1934. configured target) assembler from Microtec Research. The exact nature of the
  1935. MRI syntax will not be documented here; see the MRI manuals for more
  1936. information. Note in particular that the handling of macros and macro
  1937. arguments is somewhat different. The purpose of this option is to permit
  1938. assembling existing MRI assembler code using @command{@value{AS}}.
  1939. The MRI compatibility is not complete. Certain operations of the MRI assembler
  1940. depend upon its object file format, and can not be supported using other object
  1941. file formats. Supporting these would require enhancing each object file format
  1942. individually. These are:
  1943. @itemize @bullet
  1944. @item global symbols in common section
  1945. The m68k MRI assembler supports common sections which are merged by the linker.
  1946. Other object file formats do not support this. @command{@value{AS}} handles
  1947. common sections by treating them as a single common symbol. It permits local
  1948. symbols to be defined within a common section, but it can not support global
  1949. symbols, since it has no way to describe them.
  1950. @item complex relocations
  1951. The MRI assemblers support relocations against a negated section address, and
  1952. relocations which combine the start addresses of two or more sections. These
  1953. are not support by other object file formats.
  1954. @item @code{END} pseudo-op specifying start address
  1955. The MRI @code{END} pseudo-op permits the specification of a start address.
  1956. This is not supported by other object file formats. The start address may
  1957. instead be specified using the @option{-e} option to the linker, or in a linker
  1958. script.
  1959. @item @code{IDNT}, @code{.ident} and @code{NAME} pseudo-ops
  1960. The MRI @code{IDNT}, @code{.ident} and @code{NAME} pseudo-ops assign a module
  1961. name to the output file. This is not supported by other object file formats.
  1962. @item @code{ORG} pseudo-op
  1963. The m68k MRI @code{ORG} pseudo-op begins an absolute section at a given
  1964. address. This differs from the usual @command{@value{AS}} @code{.org} pseudo-op,
  1965. which changes the location within the current section. Absolute sections are
  1966. not supported by other object file formats. The address of a section may be
  1967. assigned within a linker script.
  1968. @end itemize
  1969. There are some other features of the MRI assembler which are not supported by
  1970. @command{@value{AS}}, typically either because they are difficult or because they
  1971. seem of little consequence. Some of these may be supported in future releases.
  1972. @itemize @bullet
  1973. @item EBCDIC strings
  1974. EBCDIC strings are not supported.
  1975. @item packed binary coded decimal
  1976. Packed binary coded decimal is not supported. This means that the @code{DC.P}
  1977. and @code{DCB.P} pseudo-ops are not supported.
  1978. @item @code{FEQU} pseudo-op
  1979. The m68k @code{FEQU} pseudo-op is not supported.
  1980. @item @code{NOOBJ} pseudo-op
  1981. The m68k @code{NOOBJ} pseudo-op is not supported.
  1982. @item @code{OPT} branch control options
  1983. The m68k @code{OPT} branch control options---@code{B}, @code{BRS}, @code{BRB},
  1984. @code{BRL}, and @code{BRW}---are ignored. @command{@value{AS}} automatically
  1985. relaxes all branches, whether forward or backward, to an appropriate size, so
  1986. these options serve no purpose.
  1987. @item @code{OPT} list control options
  1988. The following m68k @code{OPT} list control options are ignored: @code{C},
  1989. @code{CEX}, @code{CL}, @code{CRE}, @code{E}, @code{G}, @code{I}, @code{M},
  1990. @code{MEX}, @code{MC}, @code{MD}, @code{X}.
  1991. @item other @code{OPT} options
  1992. The following m68k @code{OPT} options are ignored: @code{NEST}, @code{O},
  1993. @code{OLD}, @code{OP}, @code{P}, @code{PCO}, @code{PCR}, @code{PCS}, @code{R}.
  1994. @item @code{OPT} @code{D} option is default
  1995. The m68k @code{OPT} @code{D} option is the default, unlike the MRI assembler.
  1996. @code{OPT NOD} may be used to turn it off.
  1997. @item @code{XREF} pseudo-op.
  1998. The m68k @code{XREF} pseudo-op is ignored.
  1999. @item @code{.debug} pseudo-op
  2000. The i960 @code{.debug} pseudo-op is not supported.
  2001. @item @code{.extended} pseudo-op
  2002. The i960 @code{.extended} pseudo-op is not supported.
  2003. @item @code{.list} pseudo-op.
  2004. The various options of the i960 @code{.list} pseudo-op are not supported.
  2005. @item @code{.optimize} pseudo-op
  2006. The i960 @code{.optimize} pseudo-op is not supported.
  2007. @item @code{.output} pseudo-op
  2008. The i960 @code{.output} pseudo-op is not supported.
  2009. @item @code{.setreal} pseudo-op
  2010. The i960 @code{.setreal} pseudo-op is not supported.
  2011. @end itemize
  2012. @node MD
  2013. @section Dependency Tracking: @option{--MD}
  2014. @kindex --MD
  2015. @cindex dependency tracking
  2016. @cindex make rules
  2017. @command{@value{AS}} can generate a dependency file for the file it creates. This
  2018. file consists of a single rule suitable for @code{make} describing the
  2019. dependencies of the main source file.
  2020. The rule is written to the file named in its argument.
  2021. This feature is used in the automatic updating of makefiles.
  2022. @node o
  2023. @section Name the Object File: @option{-o}
  2024. @kindex -o
  2025. @cindex naming object file
  2026. @cindex object file name
  2027. There is always one object file output when you run @command{@value{AS}}. By
  2028. default it has the name
  2029. @ifset GENERIC
  2030. @ifset I960
  2031. @file{a.out} (or @file{b.out}, for Intel 960 targets only).
  2032. @end ifset
  2033. @ifclear I960
  2034. @file{a.out}.
  2035. @end ifclear
  2036. @end ifset
  2037. @ifclear GENERIC
  2038. @ifset I960
  2039. @file{b.out}.
  2040. @end ifset
  2041. @ifclear I960
  2042. @file{a.out}.
  2043. @end ifclear
  2044. @end ifclear
  2045. You use this option (which takes exactly one filename) to give the
  2046. object file a different name.
  2047. Whatever the object file is called, @command{@value{AS}} overwrites any
  2048. existing file of the same name.
  2049. @node R
  2050. @section Join Data and Text Sections: @option{-R}
  2051. @kindex -R
  2052. @cindex data and text sections, joining
  2053. @cindex text and data sections, joining
  2054. @cindex joining text and data sections
  2055. @cindex merging text and data sections
  2056. @option{-R} tells @command{@value{AS}} to write the object file as if all
  2057. data-section data lives in the text section. This is only done at
  2058. the very last moment: your binary data are the same, but data
  2059. section parts are relocated differently. The data section part of
  2060. your object file is zero bytes long because all its bytes are
  2061. appended to the text section. (@xref{Sections,,Sections and Relocation}.)
  2062. When you specify @option{-R} it would be possible to generate shorter
  2063. address displacements (because we do not have to cross between text and
  2064. data section). We refrain from doing this simply for compatibility with
  2065. older versions of @command{@value{AS}}. In future, @option{-R} may work this way.
  2066. @ifset COFF-ELF
  2067. When @command{@value{AS}} is configured for COFF or ELF output,
  2068. this option is only useful if you use sections named @samp{.text} and
  2069. @samp{.data}.
  2070. @end ifset
  2071. @ifset HPPA
  2072. @option{-R} is not supported for any of the HPPA targets. Using
  2073. @option{-R} generates a warning from @command{@value{AS}}.
  2074. @end ifset
  2075. @node statistics
  2076. @section Display Assembly Statistics: @option{--statistics}
  2077. @kindex --statistics
  2078. @cindex statistics, about assembly
  2079. @cindex time, total for assembly
  2080. @cindex space used, maximum for assembly
  2081. Use @samp{--statistics} to display two statistics about the resources used by
  2082. @command{@value{AS}}: the maximum amount of space allocated during the assembly
  2083. (in bytes), and the total execution time taken for the assembly (in @sc{cpu}
  2084. seconds).
  2085. @node traditional-format
  2086. @section Compatible Output: @option{--traditional-format}
  2087. @kindex --traditional-format
  2088. For some targets, the output of @command{@value{AS}} is different in some ways
  2089. from the output of some existing assembler. This switch requests
  2090. @command{@value{AS}} to use the traditional format instead.
  2091. For example, it disables the exception frame optimizations which
  2092. @command{@value{AS}} normally does by default on @code{@value{GCC}} output.
  2093. @node v
  2094. @section Announce Version: @option{-v}
  2095. @kindex -v
  2096. @kindex -version
  2097. @cindex assembler version
  2098. @cindex version of assembler
  2099. You can find out what version of as is running by including the
  2100. option @samp{-v} (which you can also spell as @samp{-version}) on the
  2101. command line.
  2102. @node W
  2103. @section Control Warnings: @option{-W}, @option{--warn}, @option{--no-warn}, @option{--fatal-warnings}
  2104. @command{@value{AS}} should never give a warning or error message when
  2105. assembling compiler output. But programs written by people often
  2106. cause @command{@value{AS}} to give a warning that a particular assumption was
  2107. made. All such warnings are directed to the standard error file.
  2108. @kindex -W
  2109. @kindex --no-warn
  2110. @cindex suppressing warnings
  2111. @cindex warnings, suppressing
  2112. If you use the @option{-W} and @option{--no-warn} options, no warnings are issued.
  2113. This only affects the warning messages: it does not change any particular of
  2114. how @command{@value{AS}} assembles your file. Errors, which stop the assembly,
  2115. are still reported.
  2116. @kindex --fatal-warnings
  2117. @cindex errors, caused by warnings
  2118. @cindex warnings, causing error
  2119. If you use the @option{--fatal-warnings} option, @command{@value{AS}} considers
  2120. files that generate warnings to be in error.
  2121. @kindex --warn
  2122. @cindex warnings, switching on
  2123. You can switch these options off again by specifying @option{--warn}, which
  2124. causes warnings to be output as usual.
  2125. @node Z
  2126. @section Generate Object File in Spite of Errors: @option{-Z}
  2127. @cindex object file, after errors
  2128. @cindex errors, continuing after
  2129. After an error message, @command{@value{AS}} normally produces no output. If for
  2130. some reason you are interested in object file output even after
  2131. @command{@value{AS}} gives an error message on your program, use the @samp{-Z}
  2132. option. If there are any errors, @command{@value{AS}} continues anyways, and
  2133. writes an object file after a final warning message of the form @samp{@var{n}
  2134. errors, @var{m} warnings, generating bad object file.}
  2135. @node Syntax
  2136. @chapter Syntax
  2137. @cindex machine-independent syntax
  2138. @cindex syntax, machine-independent
  2139. This chapter describes the machine-independent syntax allowed in a
  2140. source file. @command{@value{AS}} syntax is similar to what many other
  2141. assemblers use; it is inspired by the BSD 4.2
  2142. @ifclear VAX
  2143. assembler.
  2144. @end ifclear
  2145. @ifset VAX
  2146. assembler, except that @command{@value{AS}} does not assemble Vax bit-fields.
  2147. @end ifset
  2148. @menu
  2149. * Preprocessing:: Preprocessing
  2150. * Whitespace:: Whitespace
  2151. * Comments:: Comments
  2152. * Symbol Intro:: Symbols
  2153. * Statements:: Statements
  2154. * Constants:: Constants
  2155. @end menu
  2156. @node Preprocessing
  2157. @section Preprocessing
  2158. @cindex preprocessing
  2159. The @command{@value{AS}} internal preprocessor:
  2160. @itemize @bullet
  2161. @cindex whitespace, removed by preprocessor
  2162. @item
  2163. adjusts and removes extra whitespace. It leaves one space or tab before
  2164. the keywords on a line, and turns any other whitespace on the line into
  2165. a single space.
  2166. @cindex comments, removed by preprocessor
  2167. @item
  2168. removes all comments, replacing them with a single space, or an
  2169. appropriate number of newlines.
  2170. @cindex constants, converted by preprocessor
  2171. @item
  2172. converts character constants into the appropriate numeric values.
  2173. @end itemize
  2174. It does not do macro processing, include file handling, or
  2175. anything else you may get from your C compiler's preprocessor. You can
  2176. do include file processing with the @code{.include} directive
  2177. (@pxref{Include,,@code{.include}}). You can use the @sc{gnu} C compiler driver
  2178. to get other ``CPP'' style preprocessing by giving the input file a
  2179. @samp{.S} suffix. @xref{Overall Options, ,Options Controlling the Kind of
  2180. Output, gcc.info, Using GNU CC}.
  2181. Excess whitespace, comments, and character constants
  2182. cannot be used in the portions of the input text that are not
  2183. preprocessed.
  2184. @cindex turning preprocessing on and off
  2185. @cindex preprocessing, turning on and off
  2186. @kindex #NO_APP
  2187. @kindex #APP
  2188. If the first line of an input file is @code{#NO_APP} or if you use the
  2189. @samp{-f} option, whitespace and comments are not removed from the input file.
  2190. Within an input file, you can ask for whitespace and comment removal in
  2191. specific portions of the by putting a line that says @code{#APP} before the
  2192. text that may contain whitespace or comments, and putting a line that says
  2193. @code{#NO_APP} after this text. This feature is mainly intend to support
  2194. @code{asm} statements in compilers whose output is otherwise free of comments
  2195. and whitespace.
  2196. @node Whitespace
  2197. @section Whitespace
  2198. @cindex whitespace
  2199. @dfn{Whitespace} is one or more blanks or tabs, in any order.
  2200. Whitespace is used to separate symbols, and to make programs neater for
  2201. people to read. Unless within character constants
  2202. (@pxref{Characters,,Character Constants}), any whitespace means the same
  2203. as exactly one space.
  2204. @node Comments
  2205. @section Comments
  2206. @cindex comments
  2207. There are two ways of rendering comments to @command{@value{AS}}. In both
  2208. cases the comment is equivalent to one space.
  2209. Anything from @samp{/*} through the next @samp{*/} is a comment.
  2210. This means you may not nest these comments.
  2211. @smallexample
  2212. /*
  2213. The only way to include a newline ('\n') in a comment
  2214. is to use this sort of comment.
  2215. */
  2216. /* This sort of comment does not nest. */
  2217. @end smallexample
  2218. @cindex line comment character
  2219. Anything from a @dfn{line comment} character up to the next newline is
  2220. considered a comment and is ignored. The line comment character is target
  2221. specific, and some targets multiple comment characters. Some targets also have
  2222. line comment characters that only work if they are the first character on a
  2223. line. Some targets use a sequence of two characters to introduce a line
  2224. comment. Some targets can also change their line comment characters depending
  2225. upon command line options that have been used. For more details see the
  2226. @emph{Syntax} section in the documentation for individual targets.
  2227. If the line comment character is the hash sign (@samp{#}) then it still has the
  2228. special ability to enable and disable preprocessing (@pxref{Preprocessing}) and
  2229. to specify logical line numbers:
  2230. @kindex #
  2231. @cindex lines starting with @code{#}
  2232. @cindex logical line numbers
  2233. To be compatible with past assemblers, lines that begin with @samp{#} have a
  2234. special interpretation. Following the @samp{#} should be an absolute
  2235. expression (@pxref{Expressions}): the logical line number of the @emph{next}
  2236. line. Then a string (@pxref{Strings, ,Strings}) is allowed: if present it is a
  2237. new logical file name. The rest of the line, if any, should be whitespace.
  2238. If the first non-whitespace characters on the line are not numeric,
  2239. the line is ignored. (Just like a comment.)
  2240. @smallexample
  2241. # This is an ordinary comment.
  2242. # 42-6 "new_file_name" # New logical file name
  2243. # This is logical line # 36.
  2244. @end smallexample
  2245. This feature is deprecated, and may disappear from future versions
  2246. of @command{@value{AS}}.
  2247. @node Symbol Intro
  2248. @section Symbols
  2249. @cindex characters used in symbols
  2250. @ifclear SPECIAL-SYMS
  2251. A @dfn{symbol} is one or more characters chosen from the set of all
  2252. letters (both upper and lower case), digits and the three characters
  2253. @samp{_.$}.
  2254. @end ifclear
  2255. @ifset SPECIAL-SYMS
  2256. @ifclear GENERIC
  2257. @ifset H8
  2258. A @dfn{symbol} is one or more characters chosen from the set of all
  2259. letters (both upper and lower case), digits and the three characters
  2260. @samp{._$}. (Save that, on the H8/300 only, you may not use @samp{$} in
  2261. symbol names.)
  2262. @end ifset
  2263. @end ifclear
  2264. @end ifset
  2265. @ifset GENERIC
  2266. On most machines, you can also use @code{$} in symbol names; exceptions
  2267. are noted in @ref{Machine Dependencies}.
  2268. @end ifset
  2269. No symbol may begin with a digit. Case is significant.
  2270. There is no length limit; all characters are significant. Multibyte characters
  2271. are supported. Symbols are delimited by characters not in that set, or by the
  2272. beginning of a file (since the source program must end with a newline, the end
  2273. of a file is not a possible symbol delimiter). @xref{Symbols}.
  2274. Symbol names may also be enclosed in double quote @code{"} characters. In such
  2275. cases any characters are allowed, except for the NUL character. If a double
  2276. quote character is to be included in the symbol name it must be preceeded by a
  2277. backslash @code{\} character.
  2278. @cindex length of symbols
  2279. @node Statements
  2280. @section Statements
  2281. @cindex statements, structure of
  2282. @cindex line separator character
  2283. @cindex statement separator character
  2284. A @dfn{statement} ends at a newline character (@samp{\n}) or a
  2285. @dfn{line separator character}. The line separator character is target
  2286. specific and described in the @emph{Syntax} section of each
  2287. target's documentation. Not all targets support a line separator character.
  2288. The newline or line separator character is considered to be part of the
  2289. preceding statement. Newlines and separators within character constants are an
  2290. exception: they do not end statements.
  2291. @cindex newline, required at file end
  2292. @cindex EOF, newline must precede
  2293. It is an error to end any statement with end-of-file: the last
  2294. character of any input file should be a newline.@refill
  2295. An empty statement is allowed, and may include whitespace. It is ignored.
  2296. @cindex instructions and directives
  2297. @cindex directives and instructions
  2298. @c "key symbol" is not used elsewhere in the document; seems pedantic to
  2299. @c @defn{} it in that case, as was done previously... doc@cygnus.com,
  2300. @c 13feb91.
  2301. A statement begins with zero or more labels, optionally followed by a
  2302. key symbol which determines what kind of statement it is. The key
  2303. symbol determines the syntax of the rest of the statement. If the
  2304. symbol begins with a dot @samp{.} then the statement is an assembler
  2305. directive: typically valid for any computer. If the symbol begins with
  2306. a letter the statement is an assembly language @dfn{instruction}: it
  2307. assembles into a machine language instruction.
  2308. @ifset GENERIC
  2309. Different versions of @command{@value{AS}} for different computers
  2310. recognize different instructions. In fact, the same symbol may
  2311. represent a different instruction in a different computer's assembly
  2312. language.@refill
  2313. @end ifset
  2314. @cindex @code{:} (label)
  2315. @cindex label (@code{:})
  2316. A label is a symbol immediately followed by a colon (@code{:}).
  2317. Whitespace before a label or after a colon is permitted, but you may not
  2318. have whitespace between a label's symbol and its colon. @xref{Labels}.
  2319. @ifset HPPA
  2320. For HPPA targets, labels need not be immediately followed by a colon, but
  2321. the definition of a label must begin in column zero. This also implies that
  2322. only one label may be defined on each line.
  2323. @end ifset
  2324. @smallexample
  2325. label: .directive followed by something
  2326. another_label: # This is an empty statement.
  2327. instruction operand_1, operand_2, @dots{}
  2328. @end smallexample
  2329. @node Constants
  2330. @section Constants
  2331. @cindex constants
  2332. A constant is a number, written so that its value is known by
  2333. inspection, without knowing any context. Like this:
  2334. @smallexample
  2335. @group
  2336. .byte 74, 0112, 092, 0x4A, 0X4a, 'J, '\J # All the same value.
  2337. .ascii "Ring the bell\7" # A string constant.
  2338. .octa 0x123456789abcdef0123456789ABCDEF0 # A bignum.
  2339. .float 0f-314159265358979323846264338327\
  2340. 95028841971.693993751E-40 # - pi, a flonum.
  2341. @end group
  2342. @end smallexample
  2343. @menu
  2344. * Characters:: Character Constants
  2345. * Numbers:: Number Constants
  2346. @end menu
  2347. @node Characters
  2348. @subsection Character Constants
  2349. @cindex character constants
  2350. @cindex constants, character
  2351. There are two kinds of character constants. A @dfn{character} stands
  2352. for one character in one byte and its value may be used in
  2353. numeric expressions. String constants (properly called string
  2354. @emph{literals}) are potentially many bytes and their values may not be
  2355. used in arithmetic expressions.
  2356. @menu
  2357. * Strings:: Strings
  2358. * Chars:: Characters
  2359. @end menu
  2360. @node Strings
  2361. @subsubsection Strings
  2362. @cindex string constants
  2363. @cindex constants, string
  2364. A @dfn{string} is written between double-quotes. It may contain
  2365. double-quotes or null characters. The way to get special characters
  2366. into a string is to @dfn{escape} these characters: precede them with
  2367. a backslash @samp{\} character. For example @samp{\\} represents
  2368. one backslash: the first @code{\} is an escape which tells
  2369. @command{@value{AS}} to interpret the second character literally as a backslash
  2370. (which prevents @command{@value{AS}} from recognizing the second @code{\} as an
  2371. escape character). The complete list of escapes follows.
  2372. @cindex escape codes, character
  2373. @cindex character escape codes
  2374. @table @kbd
  2375. @c @item \a
  2376. @c Mnemonic for ACKnowledge; for ASCII this is octal code 007.
  2377. @c
  2378. @cindex @code{\b} (backspace character)
  2379. @cindex backspace (@code{\b})
  2380. @item \b
  2381. Mnemonic for backspace; for ASCII this is octal code 010.
  2382. @c @item \e
  2383. @c Mnemonic for EOText; for ASCII this is octal code 004.
  2384. @c
  2385. @cindex @code{\f} (formfeed character)
  2386. @cindex formfeed (@code{\f})
  2387. @item \f
  2388. Mnemonic for FormFeed; for ASCII this is octal code 014.
  2389. @cindex @code{\n} (newline character)
  2390. @cindex newline (@code{\n})
  2391. @item \n
  2392. Mnemonic for newline; for ASCII this is octal code 012.
  2393. @c @item \p
  2394. @c Mnemonic for prefix; for ASCII this is octal code 033, usually known as @code{escape}.
  2395. @c
  2396. @cindex @code{\r} (carriage return character)
  2397. @cindex carriage return (@code{\r})
  2398. @item \r
  2399. Mnemonic for carriage-Return; for ASCII this is octal code 015.
  2400. @c @item \s
  2401. @c Mnemonic for space; for ASCII this is octal code 040. Included for compliance with
  2402. @c other assemblers.
  2403. @c
  2404. @cindex @code{\t} (tab)
  2405. @cindex tab (@code{\t})
  2406. @item \t
  2407. Mnemonic for horizontal Tab; for ASCII this is octal code 011.
  2408. @c @item \v
  2409. @c Mnemonic for Vertical tab; for ASCII this is octal code 013.
  2410. @c @item \x @var{digit} @var{digit} @var{digit}
  2411. @c A hexadecimal character code. The numeric code is 3 hexadecimal digits.
  2412. @c
  2413. @cindex @code{\@var{ddd}} (octal character code)
  2414. @cindex octal character code (@code{\@var{ddd}})
  2415. @item \ @var{digit} @var{digit} @var{digit}
  2416. An octal character code. The numeric code is 3 octal digits.
  2417. For compatibility with other Unix systems, 8 and 9 are accepted as digits:
  2418. for example, @code{\008} has the value 010, and @code{\009} the value 011.
  2419. @cindex @code{\@var{xd...}} (hex character code)
  2420. @cindex hex character code (@code{\@var{xd...}})
  2421. @item \@code{x} @var{hex-digits...}
  2422. A hex character code. All trailing hex digits are combined. Either upper or
  2423. lower case @code{x} works.
  2424. @cindex @code{\\} (@samp{\} character)
  2425. @cindex backslash (@code{\\})
  2426. @item \\
  2427. Represents one @samp{\} character.
  2428. @c @item \'
  2429. @c Represents one @samp{'} (accent acute) character.
  2430. @c This is needed in single character literals
  2431. @c (@xref{Characters,,Character Constants}.) to represent
  2432. @c a @samp{'}.
  2433. @c
  2434. @cindex @code{\"} (doublequote character)
  2435. @cindex doublequote (@code{\"})
  2436. @item \"
  2437. Represents one @samp{"} character. Needed in strings to represent
  2438. this character, because an unescaped @samp{"} would end the string.
  2439. @item \ @var{anything-else}
  2440. Any other character when escaped by @kbd{\} gives a warning, but
  2441. assembles as if the @samp{\} was not present. The idea is that if
  2442. you used an escape sequence you clearly didn't want the literal
  2443. interpretation of the following character. However @command{@value{AS}} has no
  2444. other interpretation, so @command{@value{AS}} knows it is giving you the wrong
  2445. code and warns you of the fact.
  2446. @end table
  2447. Which characters are escapable, and what those escapes represent,
  2448. varies widely among assemblers. The current set is what we think
  2449. the BSD 4.2 assembler recognizes, and is a subset of what most C
  2450. compilers recognize. If you are in doubt, do not use an escape
  2451. sequence.
  2452. @node Chars
  2453. @subsubsection Characters
  2454. @cindex single character constant
  2455. @cindex character, single
  2456. @cindex constant, single character
  2457. A single character may be written as a single quote immediately
  2458. followed by that character. The same escapes apply to characters as
  2459. to strings. So if you want to write the character backslash, you
  2460. must write @kbd{'\\} where the first @code{\} escapes the second
  2461. @code{\}. As you can see, the quote is an acute accent, not a
  2462. grave accent. A newline
  2463. @ifclear GENERIC
  2464. @ifclear abnormal-separator
  2465. (or semicolon @samp{;})
  2466. @end ifclear
  2467. @ifset abnormal-separator
  2468. @ifset H8
  2469. (or dollar sign @samp{$}, for the H8/300; or semicolon @samp{;} for the
  2470. Renesas SH)
  2471. @end ifset
  2472. @end ifset
  2473. @end ifclear
  2474. immediately following an acute accent is taken as a literal character
  2475. and does not count as the end of a statement. The value of a character
  2476. constant in a numeric expression is the machine's byte-wide code for
  2477. that character. @command{@value{AS}} assumes your character code is ASCII:
  2478. @kbd{'A} means 65, @kbd{'B} means 66, and so on. @refill
  2479. @node Numbers
  2480. @subsection Number Constants
  2481. @cindex constants, number
  2482. @cindex number constants
  2483. @command{@value{AS}} distinguishes three kinds of numbers according to how they
  2484. are stored in the target machine. @emph{Integers} are numbers that
  2485. would fit into an @code{int} in the C language. @emph{Bignums} are
  2486. integers, but they are stored in more than 32 bits. @emph{Flonums}
  2487. are floating point numbers, described below.
  2488. @menu
  2489. * Integers:: Integers
  2490. * Bignums:: Bignums
  2491. * Flonums:: Flonums
  2492. @ifclear GENERIC
  2493. @ifset I960
  2494. * Bit Fields:: Bit Fields
  2495. @end ifset
  2496. @end ifclear
  2497. @end menu
  2498. @node Integers
  2499. @subsubsection Integers
  2500. @cindex integers
  2501. @cindex constants, integer
  2502. @cindex binary integers
  2503. @cindex integers, binary
  2504. A binary integer is @samp{0b} or @samp{0B} followed by zero or more of
  2505. the binary digits @samp{01}.
  2506. @cindex octal integers
  2507. @cindex integers, octal
  2508. An octal integer is @samp{0} followed by zero or more of the octal
  2509. digits (@samp{01234567}).
  2510. @cindex decimal integers
  2511. @cindex integers, decimal
  2512. A decimal integer starts with a non-zero digit followed by zero or
  2513. more digits (@samp{0123456789}).
  2514. @cindex hexadecimal integers
  2515. @cindex integers, hexadecimal
  2516. A hexadecimal integer is @samp{0x} or @samp{0X} followed by one or
  2517. more hexadecimal digits chosen from @samp{0123456789abcdefABCDEF}.
  2518. Integers have the usual values. To denote a negative integer, use
  2519. the prefix operator @samp{-} discussed under expressions
  2520. (@pxref{Prefix Ops,,Prefix Operators}).
  2521. @node Bignums
  2522. @subsubsection Bignums
  2523. @cindex bignums
  2524. @cindex constants, bignum
  2525. A @dfn{bignum} has the same syntax and semantics as an integer
  2526. except that the number (or its negative) takes more than 32 bits to
  2527. represent in binary. The distinction is made because in some places
  2528. integers are permitted while bignums are not.
  2529. @node Flonums
  2530. @subsubsection Flonums
  2531. @cindex flonums
  2532. @cindex floating point numbers
  2533. @cindex constants, floating point
  2534. @cindex precision, floating point
  2535. A @dfn{flonum} represents a floating point number. The translation is
  2536. indirect: a decimal floating point number from the text is converted by
  2537. @command{@value{AS}} to a generic binary floating point number of more than
  2538. sufficient precision. This generic floating point number is converted
  2539. to a particular computer's floating point format (or formats) by a
  2540. portion of @command{@value{AS}} specialized to that computer.
  2541. A flonum is written by writing (in order)
  2542. @itemize @bullet
  2543. @item
  2544. The digit @samp{0}.
  2545. @ifset HPPA
  2546. (@samp{0} is optional on the HPPA.)
  2547. @end ifset
  2548. @item
  2549. A letter, to tell @command{@value{AS}} the rest of the number is a flonum.
  2550. @ifset GENERIC
  2551. @kbd{e} is recommended. Case is not important.
  2552. @ignore
  2553. @c FIXME: verify if flonum syntax really this vague for most cases
  2554. (Any otherwise illegal letter works here, but that might be changed. Vax BSD
  2555. 4.2 assembler seems to allow any of @samp{defghDEFGH}.)
  2556. @end ignore
  2557. On the H8/300, Renesas / SuperH SH,
  2558. and AMD 29K architectures, the letter must be
  2559. one of the letters @samp{DFPRSX} (in upper or lower case).
  2560. On the ARC, the letter must be one of the letters @samp{DFRS}
  2561. (in upper or lower case).
  2562. On the Intel 960 architecture, the letter must be
  2563. one of the letters @samp{DFT} (in upper or lower case).
  2564. On the HPPA architecture, the letter must be @samp{E} (upper case only).
  2565. @end ifset
  2566. @ifclear GENERIC
  2567. @ifset ARC
  2568. One of the letters @samp{DFRS} (in upper or lower case).
  2569. @end ifset
  2570. @ifset H8
  2571. One of the letters @samp{DFPRSX} (in upper or lower case).
  2572. @end ifset
  2573. @ifset HPPA
  2574. The letter @samp{E} (upper case only).
  2575. @end ifset
  2576. @ifset I960
  2577. One of the letters @samp{DFT} (in upper or lower case).
  2578. @end ifset
  2579. @end ifclear
  2580. @item
  2581. An optional sign: either @samp{+} or @samp{-}.
  2582. @item
  2583. An optional @dfn{integer part}: zero or more decimal digits.
  2584. @item
  2585. An optional @dfn{fractional part}: @samp{.} followed by zero
  2586. or more decimal digits.
  2587. @item
  2588. An optional exponent, consisting of:
  2589. @itemize @bullet
  2590. @item
  2591. An @samp{E} or @samp{e}.
  2592. @c I can't find a config where "EXP_CHARS" is other than 'eE', but in
  2593. @c principle this can perfectly well be different on different targets.
  2594. @item
  2595. Optional sign: either @samp{+} or @samp{-}.
  2596. @item
  2597. One or more decimal digits.
  2598. @end itemize
  2599. @end itemize
  2600. At least one of the integer part or the fractional part must be
  2601. present. The floating point number has the usual base-10 value.
  2602. @command{@value{AS}} does all processing using integers. Flonums are computed
  2603. independently of any floating point hardware in the computer running
  2604. @command{@value{AS}}.
  2605. @ifclear GENERIC
  2606. @ifset I960
  2607. @c Bit fields are written as a general facility but are also controlled
  2608. @c by a conditional-compilation flag---which is as of now (21mar91)
  2609. @c turned on only by the i960 config of GAS.
  2610. @node Bit Fields
  2611. @subsubsection Bit Fields
  2612. @cindex bit fields
  2613. @cindex constants, bit field
  2614. You can also define numeric constants as @dfn{bit fields}.
  2615. Specify two numbers separated by a colon---
  2616. @example
  2617. @var{mask}:@var{value}
  2618. @end example
  2619. @noindent
  2620. @command{@value{AS}} applies a bitwise @sc{and} between @var{mask} and
  2621. @var{value}.
  2622. The resulting number is then packed
  2623. @ifset GENERIC
  2624. @c this conditional paren in case bit fields turned on elsewhere than 960
  2625. (in host-dependent byte order)
  2626. @end ifset
  2627. into a field whose width depends on which assembler directive has the
  2628. bit-field as its argument. Overflow (a result from the bitwise and
  2629. requiring more binary digits to represent) is not an error; instead,
  2630. more constants are generated, of the specified width, beginning with the
  2631. least significant digits.@refill
  2632. The directives @code{.byte}, @code{.hword}, @code{.int}, @code{.long},
  2633. @code{.short}, and @code{.word} accept bit-field arguments.
  2634. @end ifset
  2635. @end ifclear
  2636. @node Sections
  2637. @chapter Sections and Relocation
  2638. @cindex sections
  2639. @cindex relocation
  2640. @menu
  2641. * Secs Background:: Background
  2642. * Ld Sections:: Linker Sections
  2643. * As Sections:: Assembler Internal Sections
  2644. * Sub-Sections:: Sub-Sections
  2645. * bss:: bss Section
  2646. @end menu
  2647. @node Secs Background
  2648. @section Background
  2649. Roughly, a section is a range of addresses, with no gaps; all data
  2650. ``in'' those addresses is treated the same for some particular purpose.
  2651. For example there may be a ``read only'' section.
  2652. @cindex linker, and assembler
  2653. @cindex assembler, and linker
  2654. The linker @code{@value{LD}} reads many object files (partial programs) and
  2655. combines their contents to form a runnable program. When @command{@value{AS}}
  2656. emits an object file, the partial program is assumed to start at address 0.
  2657. @code{@value{LD}} assigns the final addresses for the partial program, so that
  2658. different partial programs do not overlap. This is actually an
  2659. oversimplification, but it suffices to explain how @command{@value{AS}} uses
  2660. sections.
  2661. @code{@value{LD}} moves blocks of bytes of your program to their run-time
  2662. addresses. These blocks slide to their run-time addresses as rigid
  2663. units; their length does not change and neither does the order of bytes
  2664. within them. Such a rigid unit is called a @emph{section}. Assigning
  2665. run-time addresses to sections is called @dfn{relocation}. It includes
  2666. the task of adjusting mentions of object-file addresses so they refer to
  2667. the proper run-time addresses.
  2668. @ifset H8
  2669. For the H8/300, and for the Renesas / SuperH SH,
  2670. @command{@value{AS}} pads sections if needed to
  2671. ensure they end on a word (sixteen bit) boundary.
  2672. @end ifset
  2673. @cindex standard assembler sections
  2674. An object file written by @command{@value{AS}} has at least three sections, any
  2675. of which may be empty. These are named @dfn{text}, @dfn{data} and
  2676. @dfn{bss} sections.
  2677. @ifset COFF-ELF
  2678. @ifset GENERIC
  2679. When it generates COFF or ELF output,
  2680. @end ifset
  2681. @command{@value{AS}} can also generate whatever other named sections you specify
  2682. using the @samp{.section} directive (@pxref{Section,,@code{.section}}).
  2683. If you do not use any directives that place output in the @samp{.text}
  2684. or @samp{.data} sections, these sections still exist, but are empty.
  2685. @end ifset
  2686. @ifset HPPA
  2687. @ifset GENERIC
  2688. When @command{@value{AS}} generates SOM or ELF output for the HPPA,
  2689. @end ifset
  2690. @command{@value{AS}} can also generate whatever other named sections you
  2691. specify using the @samp{.space} and @samp{.subspace} directives. See
  2692. @cite{HP9000 Series 800 Assembly Language Reference Manual}
  2693. (HP 92432-90001) for details on the @samp{.space} and @samp{.subspace}
  2694. assembler directives.
  2695. @ifset SOM
  2696. Additionally, @command{@value{AS}} uses different names for the standard
  2697. text, data, and bss sections when generating SOM output. Program text
  2698. is placed into the @samp{$CODE$} section, data into @samp{$DATA$}, and
  2699. BSS into @samp{$BSS$}.
  2700. @end ifset
  2701. @end ifset
  2702. Within the object file, the text section starts at address @code{0}, the
  2703. data section follows, and the bss section follows the data section.
  2704. @ifset HPPA
  2705. When generating either SOM or ELF output files on the HPPA, the text
  2706. section starts at address @code{0}, the data section at address
  2707. @code{0x4000000}, and the bss section follows the data section.
  2708. @end ifset
  2709. To let @code{@value{LD}} know which data changes when the sections are
  2710. relocated, and how to change that data, @command{@value{AS}} also writes to the
  2711. object file details of the relocation needed. To perform relocation
  2712. @code{@value{LD}} must know, each time an address in the object
  2713. file is mentioned:
  2714. @itemize @bullet
  2715. @item
  2716. Where in the object file is the beginning of this reference to
  2717. an address?
  2718. @item
  2719. How long (in bytes) is this reference?
  2720. @item
  2721. Which section does the address refer to? What is the numeric value of
  2722. @display
  2723. (@var{address}) @minus{} (@var{start-address of section})?
  2724. @end display
  2725. @item
  2726. Is the reference to an address ``Program-Counter relative''?
  2727. @end itemize
  2728. @cindex addresses, format of
  2729. @cindex section-relative addressing
  2730. In fact, every address @command{@value{AS}} ever uses is expressed as
  2731. @display
  2732. (@var{section}) + (@var{offset into section})
  2733. @end display
  2734. @noindent
  2735. Further, most expressions @command{@value{AS}} computes have this section-relative
  2736. nature.
  2737. @ifset SOM
  2738. (For some object formats, such as SOM for the HPPA, some expressions are
  2739. symbol-relative instead.)
  2740. @end ifset
  2741. In this manual we use the notation @{@var{secname} @var{N}@} to mean ``offset
  2742. @var{N} into section @var{secname}.''
  2743. Apart from text, data and bss sections you need to know about the
  2744. @dfn{absolute} section. When @code{@value{LD}} mixes partial programs,
  2745. addresses in the absolute section remain unchanged. For example, address
  2746. @code{@{absolute 0@}} is ``relocated'' to run-time address 0 by
  2747. @code{@value{LD}}. Although the linker never arranges two partial programs'
  2748. data sections with overlapping addresses after linking, @emph{by definition}
  2749. their absolute sections must overlap. Address @code{@{absolute@ 239@}} in one
  2750. part of a program is always the same address when the program is running as
  2751. address @code{@{absolute@ 239@}} in any other part of the program.
  2752. The idea of sections is extended to the @dfn{undefined} section. Any
  2753. address whose section is unknown at assembly time is by definition
  2754. rendered @{undefined @var{U}@}---where @var{U} is filled in later.
  2755. Since numbers are always defined, the only way to generate an undefined
  2756. address is to mention an undefined symbol. A reference to a named
  2757. common block would be such a symbol: its value is unknown at assembly
  2758. time so it has section @emph{undefined}.
  2759. By analogy the word @emph{section} is used to describe groups of sections in
  2760. the linked program. @code{@value{LD}} puts all partial programs' text
  2761. sections in contiguous addresses in the linked program. It is
  2762. customary to refer to the @emph{text section} of a program, meaning all
  2763. the addresses of all partial programs' text sections. Likewise for
  2764. data and bss sections.
  2765. Some sections are manipulated by @code{@value{LD}}; others are invented for
  2766. use of @command{@value{AS}} and have no meaning except during assembly.
  2767. @node Ld Sections
  2768. @section Linker Sections
  2769. @code{@value{LD}} deals with just four kinds of sections, summarized below.
  2770. @table @strong
  2771. @ifset COFF-ELF
  2772. @cindex named sections
  2773. @cindex sections, named
  2774. @item named sections
  2775. @end ifset
  2776. @ifset aout-bout
  2777. @cindex text section
  2778. @cindex data section
  2779. @itemx text section
  2780. @itemx data section
  2781. @end ifset
  2782. These sections hold your program. @command{@value{AS}} and @code{@value{LD}} treat them as
  2783. separate but equal sections. Anything you can say of one section is
  2784. true of another.
  2785. @c @ifset aout-bout
  2786. When the program is running, however, it is
  2787. customary for the text section to be unalterable. The
  2788. text section is often shared among processes: it contains
  2789. instructions, constants and the like. The data section of a running
  2790. program is usually alterable: for example, C variables would be stored
  2791. in the data section.
  2792. @c @end ifset
  2793. @cindex bss section
  2794. @item bss section
  2795. This section contains zeroed bytes when your program begins running. It
  2796. is used to hold uninitialized variables or common storage. The length of
  2797. each partial program's bss section is important, but because it starts
  2798. out containing zeroed bytes there is no need to store explicit zero
  2799. bytes in the object file. The bss section was invented to eliminate
  2800. those explicit zeros from object files.
  2801. @cindex absolute section
  2802. @item absolute section
  2803. Address 0 of this section is always ``relocated'' to runtime address 0.
  2804. This is useful if you want to refer to an address that @code{@value{LD}} must
  2805. not change when relocating. In this sense we speak of absolute
  2806. addresses being ``unrelocatable'': they do not change during relocation.
  2807. @cindex undefined section
  2808. @item undefined section
  2809. This ``section'' is a catch-all for address references to objects not in
  2810. the preceding sections.
  2811. @c FIXME: ref to some other doc on obj-file formats could go here.
  2812. @end table
  2813. @cindex relocation example
  2814. An idealized example of three relocatable sections follows.
  2815. @ifset COFF-ELF
  2816. The example uses the traditional section names @samp{.text} and @samp{.data}.
  2817. @end ifset
  2818. Memory addresses are on the horizontal axis.
  2819. @c TEXI2ROFF-KILL
  2820. @ifnottex
  2821. @c END TEXI2ROFF-KILL
  2822. @smallexample
  2823. +-----+----+--+
  2824. partial program # 1: |ttttt|dddd|00|
  2825. +-----+----+--+
  2826. text data bss
  2827. seg. seg. seg.
  2828. +---+---+---+
  2829. partial program # 2: |TTT|DDD|000|
  2830. +---+---+---+
  2831. +--+---+-----+--+----+---+-----+~~
  2832. linked program: | |TTT|ttttt| |dddd|DDD|00000|
  2833. +--+---+-----+--+----+---+-----+~~
  2834. addresses: 0 @dots{}
  2835. @end smallexample
  2836. @c TEXI2ROFF-KILL
  2837. @end ifnottex
  2838. @need 5000
  2839. @tex
  2840. \bigskip
  2841. \line{\it Partial program \#1: \hfil}
  2842. \line{\ibox{2.5cm}{\tt text}\ibox{2cm}{\tt data}\ibox{1cm}{\tt bss}\hfil}
  2843. \line{\boxit{2.5cm}{\tt ttttt}\boxit{2cm}{\tt dddd}\boxit{1cm}{\tt 00}\hfil}
  2844. \line{\it Partial program \#2: \hfil}
  2845. \line{\ibox{1cm}{\tt text}\ibox{1.5cm}{\tt data}\ibox{1cm}{\tt bss}\hfil}
  2846. \line{\boxit{1cm}{\tt TTT}\boxit{1.5cm}{\tt DDDD}\boxit{1cm}{\tt 000}\hfil}
  2847. \line{\it linked program: \hfil}
  2848. \line{\ibox{.5cm}{}\ibox{1cm}{\tt text}\ibox{2.5cm}{}\ibox{.75cm}{}\ibox{2cm}{\tt data}\ibox{1.5cm}{}\ibox{2cm}{\tt bss}\hfil}
  2849. \line{\boxit{.5cm}{}\boxit{1cm}{\tt TTT}\boxit{2.5cm}{\tt
  2850. ttttt}\boxit{.75cm}{}\boxit{2cm}{\tt dddd}\boxit{1.5cm}{\tt
  2851. DDDD}\boxit{2cm}{\tt 00000}\ \dots\hfil}
  2852. \line{\it addresses: \hfil}
  2853. \line{0\dots\hfil}
  2854. @end tex
  2855. @c END TEXI2ROFF-KILL
  2856. @node As Sections
  2857. @section Assembler Internal Sections
  2858. @cindex internal assembler sections
  2859. @cindex sections in messages, internal
  2860. These sections are meant only for the internal use of @command{@value{AS}}. They
  2861. have no meaning at run-time. You do not really need to know about these
  2862. sections for most purposes; but they can be mentioned in @command{@value{AS}}
  2863. warning messages, so it might be helpful to have an idea of their
  2864. meanings to @command{@value{AS}}. These sections are used to permit the
  2865. value of every expression in your assembly language program to be a
  2866. section-relative address.
  2867. @table @b
  2868. @cindex assembler internal logic error
  2869. @item ASSEMBLER-INTERNAL-LOGIC-ERROR!
  2870. An internal assembler logic error has been found. This means there is a
  2871. bug in the assembler.
  2872. @cindex expr (internal section)
  2873. @item expr section
  2874. The assembler stores complex expression internally as combinations of
  2875. symbols. When it needs to represent an expression as a symbol, it puts
  2876. it in the expr section.
  2877. @c FIXME item debug
  2878. @c FIXME item transfer[t] vector preload
  2879. @c FIXME item transfer[t] vector postload
  2880. @c FIXME item register
  2881. @end table
  2882. @node Sub-Sections
  2883. @section Sub-Sections
  2884. @cindex numbered subsections
  2885. @cindex grouping data
  2886. @ifset aout-bout
  2887. Assembled bytes
  2888. @ifset COFF-ELF
  2889. conventionally
  2890. @end ifset
  2891. fall into two sections: text and data.
  2892. @end ifset
  2893. You may have separate groups of
  2894. @ifset GENERIC
  2895. data in named sections
  2896. @end ifset
  2897. @ifclear GENERIC
  2898. @ifclear aout-bout
  2899. data in named sections
  2900. @end ifclear
  2901. @ifset aout-bout
  2902. text or data
  2903. @end ifset
  2904. @end ifclear
  2905. that you want to end up near to each other in the object file, even though they
  2906. are not contiguous in the assembler source. @command{@value{AS}} allows you to
  2907. use @dfn{subsections} for this purpose. Within each section, there can be
  2908. numbered subsections with values from 0 to 8192. Objects assembled into the
  2909. same subsection go into the object file together with other objects in the same
  2910. subsection. For example, a compiler might want to store constants in the text
  2911. section, but might not want to have them interspersed with the program being
  2912. assembled. In this case, the compiler could issue a @samp{.text 0} before each
  2913. section of code being output, and a @samp{.text 1} before each group of
  2914. constants being output.
  2915. Subsections are optional. If you do not use subsections, everything
  2916. goes in subsection number zero.
  2917. @ifset GENERIC
  2918. Each subsection is zero-padded up to a multiple of four bytes.
  2919. (Subsections may be padded a different amount on different flavors
  2920. of @command{@value{AS}}.)
  2921. @end ifset
  2922. @ifclear GENERIC
  2923. @ifset H8
  2924. On the H8/300 platform, each subsection is zero-padded to a word
  2925. boundary (two bytes).
  2926. The same is true on the Renesas SH.
  2927. @end ifset
  2928. @ifset I960
  2929. @c FIXME section padding (alignment)?
  2930. @c Rich Pixley says padding here depends on target obj code format; that
  2931. @c doesn't seem particularly useful to say without further elaboration,
  2932. @c so for now I say nothing about it. If this is a generic BFD issue,
  2933. @c these paragraphs might need to vanish from this manual, and be
  2934. @c discussed in BFD chapter of binutils (or some such).
  2935. @end ifset
  2936. @end ifclear
  2937. Subsections appear in your object file in numeric order, lowest numbered
  2938. to highest. (All this to be compatible with other people's assemblers.)
  2939. The object file contains no representation of subsections; @code{@value{LD}} and
  2940. other programs that manipulate object files see no trace of them.
  2941. They just see all your text subsections as a text section, and all your
  2942. data subsections as a data section.
  2943. To specify which subsection you want subsequent statements assembled
  2944. into, use a numeric argument to specify it, in a @samp{.text
  2945. @var{expression}} or a @samp{.data @var{expression}} statement.
  2946. @ifset COFF
  2947. @ifset GENERIC
  2948. When generating COFF output, you
  2949. @end ifset
  2950. @ifclear GENERIC
  2951. You
  2952. @end ifclear
  2953. can also use an extra subsection
  2954. argument with arbitrary named sections: @samp{.section @var{name},
  2955. @var{expression}}.
  2956. @end ifset
  2957. @ifset ELF
  2958. @ifset GENERIC
  2959. When generating ELF output, you
  2960. @end ifset
  2961. @ifclear GENERIC
  2962. You
  2963. @end ifclear
  2964. can also use the @code{.subsection} directive (@pxref{SubSection})
  2965. to specify a subsection: @samp{.subsection @var{expression}}.
  2966. @end ifset
  2967. @var{Expression} should be an absolute expression
  2968. (@pxref{Expressions}). If you just say @samp{.text} then @samp{.text 0}
  2969. is assumed. Likewise @samp{.data} means @samp{.data 0}. Assembly
  2970. begins in @code{text 0}. For instance:
  2971. @smallexample
  2972. .text 0 # The default subsection is text 0 anyway.
  2973. .ascii "This lives in the first text subsection. *"
  2974. .text 1
  2975. .ascii "But this lives in the second text subsection."
  2976. .data 0
  2977. .ascii "This lives in the data section,"
  2978. .ascii "in the first data subsection."
  2979. .text 0
  2980. .ascii "This lives in the first text section,"
  2981. .ascii "immediately following the asterisk (*)."
  2982. @end smallexample
  2983. Each section has a @dfn{location counter} incremented by one for every byte
  2984. assembled into that section. Because subsections are merely a convenience
  2985. restricted to @command{@value{AS}} there is no concept of a subsection location
  2986. counter. There is no way to directly manipulate a location counter---but the
  2987. @code{.align} directive changes it, and any label definition captures its
  2988. current value. The location counter of the section where statements are being
  2989. assembled is said to be the @dfn{active} location counter.
  2990. @node bss
  2991. @section bss Section
  2992. @cindex bss section
  2993. @cindex common variable storage
  2994. The bss section is used for local common variable storage.
  2995. You may allocate address space in the bss section, but you may
  2996. not dictate data to load into it before your program executes. When
  2997. your program starts running, all the contents of the bss
  2998. section are zeroed bytes.
  2999. The @code{.lcomm} pseudo-op defines a symbol in the bss section; see
  3000. @ref{Lcomm,,@code{.lcomm}}.
  3001. The @code{.comm} pseudo-op may be used to declare a common symbol, which is
  3002. another form of uninitialized symbol; see @ref{Comm,,@code{.comm}}.
  3003. @ifset GENERIC
  3004. When assembling for a target which supports multiple sections, such as ELF or
  3005. COFF, you may switch into the @code{.bss} section and define symbols as usual;
  3006. see @ref{Section,,@code{.section}}. You may only assemble zero values into the
  3007. section. Typically the section will only contain symbol definitions and
  3008. @code{.skip} directives (@pxref{Skip,,@code{.skip}}).
  3009. @end ifset
  3010. @node Symbols
  3011. @chapter Symbols
  3012. @cindex symbols
  3013. Symbols are a central concept: the programmer uses symbols to name
  3014. things, the linker uses symbols to link, and the debugger uses symbols
  3015. to debug.
  3016. @quotation
  3017. @cindex debuggers, and symbol order
  3018. @emph{Warning:} @command{@value{AS}} does not place symbols in the object file in
  3019. the same order they were declared. This may break some debuggers.
  3020. @end quotation
  3021. @menu
  3022. * Labels:: Labels
  3023. * Setting Symbols:: Giving Symbols Other Values
  3024. * Symbol Names:: Symbol Names
  3025. * Dot:: The Special Dot Symbol
  3026. * Symbol Attributes:: Symbol Attributes
  3027. @end menu
  3028. @node Labels
  3029. @section Labels
  3030. @cindex labels
  3031. A @dfn{label} is written as a symbol immediately followed by a colon
  3032. @samp{:}. The symbol then represents the current value of the
  3033. active location counter, and is, for example, a suitable instruction
  3034. operand. You are warned if you use the same symbol to represent two
  3035. different locations: the first definition overrides any other
  3036. definitions.
  3037. @ifset HPPA
  3038. On the HPPA, the usual form for a label need not be immediately followed by a
  3039. colon, but instead must start in column zero. Only one label may be defined on
  3040. a single line. To work around this, the HPPA version of @command{@value{AS}} also
  3041. provides a special directive @code{.label} for defining labels more flexibly.
  3042. @end ifset
  3043. @node Setting Symbols
  3044. @section Giving Symbols Other Values
  3045. @cindex assigning values to symbols
  3046. @cindex symbol values, assigning
  3047. A symbol can be given an arbitrary value by writing a symbol, followed
  3048. by an equals sign @samp{=}, followed by an expression
  3049. (@pxref{Expressions}). This is equivalent to using the @code{.set}
  3050. directive. @xref{Set,,@code{.set}}. In the same way, using a double
  3051. equals sign @samp{=}@samp{=} here represents an equivalent of the
  3052. @code{.eqv} directive. @xref{Eqv,,@code{.eqv}}.
  3053. @ifset Blackfin
  3054. Blackfin does not support symbol assignment with @samp{=}.
  3055. @end ifset
  3056. @node Symbol Names
  3057. @section Symbol Names
  3058. @cindex symbol names
  3059. @cindex names, symbol
  3060. @ifclear SPECIAL-SYMS
  3061. Symbol names begin with a letter or with one of @samp{._}. On most
  3062. machines, you can also use @code{$} in symbol names; exceptions are
  3063. noted in @ref{Machine Dependencies}. That character may be followed by any
  3064. string of digits, letters, dollar signs (unless otherwise noted for a
  3065. particular target machine), and underscores.
  3066. @end ifclear
  3067. @ifset SPECIAL-SYMS
  3068. @ifset H8
  3069. Symbol names begin with a letter or with one of @samp{._}. On the
  3070. Renesas SH you can also use @code{$} in symbol names. That
  3071. character may be followed by any string of digits, letters, dollar signs (save
  3072. on the H8/300), and underscores.
  3073. @end ifset
  3074. @end ifset
  3075. Case of letters is significant: @code{foo} is a different symbol name
  3076. than @code{Foo}.
  3077. Symbol names do not start with a digit. An exception to this rule is made for
  3078. Local Labels. See below.
  3079. Multibyte characters are supported. To generate a symbol name containing
  3080. multibyte characters enclose it within double quotes and use escape codes. cf
  3081. @xref{Strings}. Generating a multibyte symbol name from a label is not
  3082. currently supported.
  3083. Each symbol has exactly one name. Each name in an assembly language program
  3084. refers to exactly one symbol. You may use that symbol name any number of times
  3085. in a program.
  3086. @subheading Local Symbol Names
  3087. @cindex local symbol names
  3088. @cindex symbol names, local
  3089. A local symbol is any symbol beginning with certain local label prefixes.
  3090. By default, the local label prefix is @samp{.L} for ELF systems or
  3091. @samp{L} for traditional a.out systems, but each target may have its own
  3092. set of local label prefixes.
  3093. @ifset HPPA
  3094. On the HPPA local symbols begin with @samp{L$}.
  3095. @end ifset
  3096. Local symbols are defined and used within the assembler, but they are
  3097. normally not saved in object files. Thus, they are not visible when debugging.
  3098. You may use the @samp{-L} option (@pxref{L, ,Include Local Symbols})
  3099. to retain the local symbols in the object files.
  3100. @subheading Local Labels
  3101. @cindex local labels
  3102. @cindex temporary symbol names
  3103. @cindex symbol names, temporary
  3104. Local labels are different from local symbols. Local labels help compilers and
  3105. programmers use names temporarily. They create symbols which are guaranteed to
  3106. be unique over the entire scope of the input source code and which can be
  3107. referred to by a simple notation. To define a local label, write a label of
  3108. the form @samp{@b{N}:} (where @b{N} represents any non-negative integer).
  3109. To refer to the most recent previous definition of that label write
  3110. @samp{@b{N}b}, using the same number as when you defined the label. To refer
  3111. to the next definition of a local label, write @samp{@b{N}f}. The @samp{b}
  3112. stands for ``backwards'' and the @samp{f} stands for ``forwards''.
  3113. There is no restriction on how you can use these labels, and you can reuse them
  3114. too. So that it is possible to repeatedly define the same local label (using
  3115. the same number @samp{@b{N}}), although you can only refer to the most recently
  3116. defined local label of that number (for a backwards reference) or the next
  3117. definition of a specific local label for a forward reference. It is also worth
  3118. noting that the first 10 local labels (@samp{@b{0:}}@dots{}@samp{@b{9:}}) are
  3119. implemented in a slightly more efficient manner than the others.
  3120. Here is an example:
  3121. @smallexample
  3122. 1: branch 1f
  3123. 2: branch 1b
  3124. 1: branch 2f
  3125. 2: branch 1b
  3126. @end smallexample
  3127. Which is the equivalent of:
  3128. @smallexample
  3129. label_1: branch label_3
  3130. label_2: branch label_1
  3131. label_3: branch label_4
  3132. label_4: branch label_3
  3133. @end smallexample
  3134. Local label names are only a notational device. They are immediately
  3135. transformed into more conventional symbol names before the assembler uses them.
  3136. The symbol names are stored in the symbol table, appear in error messages, and
  3137. are optionally emitted to the object file. The names are constructed using
  3138. these parts:
  3139. @table @code
  3140. @item @emph{local label prefix}
  3141. All local symbols begin with the system-specific local label prefix.
  3142. Normally both @command{@value{AS}} and @code{@value{LD}} forget symbols
  3143. that start with the local label prefix. These labels are
  3144. used for symbols you are never intended to see. If you use the
  3145. @samp{-L} option then @command{@value{AS}} retains these symbols in the
  3146. object file. If you also instruct @code{@value{LD}} to retain these symbols,
  3147. you may use them in debugging.
  3148. @item @var{number}
  3149. This is the number that was used in the local label definition. So if the
  3150. label is written @samp{55:} then the number is @samp{55}.
  3151. @item @kbd{C-B}
  3152. This unusual character is included so you do not accidentally invent a symbol
  3153. of the same name. The character has ASCII value of @samp{\002} (control-B).
  3154. @item @emph{ordinal number}
  3155. This is a serial number to keep the labels distinct. The first definition of
  3156. @samp{0:} gets the number @samp{1}. The 15th definition of @samp{0:} gets the
  3157. number @samp{15}, and so on. Likewise the first definition of @samp{1:} gets
  3158. the number @samp{1} and its 15th definition gets @samp{15} as well.
  3159. @end table
  3160. So for example, the first @code{1:} may be named @code{.L1@kbd{C-B}1}, and
  3161. the 44th @code{3:} may be named @code{.L3@kbd{C-B}44}.
  3162. @subheading Dollar Local Labels
  3163. @cindex dollar local symbols
  3164. On some targets @code{@value{AS}} also supports an even more local form of
  3165. local labels called dollar labels. These labels go out of scope (i.e., they
  3166. become undefined) as soon as a non-local label is defined. Thus they remain
  3167. valid for only a small region of the input source code. Normal local labels,
  3168. by contrast, remain in scope for the entire file, or until they are redefined
  3169. by another occurrence of the same local label.
  3170. Dollar labels are defined in exactly the same way as ordinary local labels,
  3171. except that they have a dollar sign suffix to their numeric value, e.g.,
  3172. @samp{@b{55$:}}.
  3173. They can also be distinguished from ordinary local labels by their transformed
  3174. names which use ASCII character @samp{\001} (control-A) as the magic character
  3175. to distinguish them from ordinary labels. For example, the fifth definition of
  3176. @samp{6$} may be named @samp{.L6@kbd{C-A}5}.
  3177. @node Dot
  3178. @section The Special Dot Symbol
  3179. @cindex dot (symbol)
  3180. @cindex @code{.} (symbol)
  3181. @cindex current address
  3182. @cindex location counter
  3183. The special symbol @samp{.} refers to the current address that
  3184. @command{@value{AS}} is assembling into. Thus, the expression @samp{melvin:
  3185. .long .} defines @code{melvin} to contain its own address.
  3186. Assigning a value to @code{.} is treated the same as a @code{.org}
  3187. directive.
  3188. @ifclear no-space-dir
  3189. Thus, the expression @samp{.=.+4} is the same as saying
  3190. @samp{.space 4}.
  3191. @end ifclear
  3192. @node Symbol Attributes
  3193. @section Symbol Attributes
  3194. @cindex symbol attributes
  3195. @cindex attributes, symbol
  3196. Every symbol has, as well as its name, the attributes ``Value'' and
  3197. ``Type''. Depending on output format, symbols can also have auxiliary
  3198. attributes.
  3199. @ifset INTERNALS
  3200. The detailed definitions are in @file{a.out.h}.
  3201. @end ifset
  3202. If you use a symbol without defining it, @command{@value{AS}} assumes zero for
  3203. all these attributes, and probably won't warn you. This makes the
  3204. symbol an externally defined symbol, which is generally what you
  3205. would want.
  3206. @menu
  3207. * Symbol Value:: Value
  3208. * Symbol Type:: Type
  3209. @ifset aout-bout
  3210. @ifset GENERIC
  3211. * a.out Symbols:: Symbol Attributes: @code{a.out}
  3212. @end ifset
  3213. @ifclear GENERIC
  3214. @ifclear BOUT
  3215. * a.out Symbols:: Symbol Attributes: @code{a.out}
  3216. @end ifclear
  3217. @ifset BOUT
  3218. * a.out Symbols:: Symbol Attributes: @code{a.out}, @code{b.out}
  3219. @end ifset
  3220. @end ifclear
  3221. @end ifset
  3222. @ifset COFF
  3223. * COFF Symbols:: Symbol Attributes for COFF
  3224. @end ifset
  3225. @ifset SOM
  3226. * SOM Symbols:: Symbol Attributes for SOM
  3227. @end ifset
  3228. @end menu
  3229. @node Symbol Value
  3230. @subsection Value
  3231. @cindex value of a symbol
  3232. @cindex symbol value
  3233. The value of a symbol is (usually) 32 bits. For a symbol which labels a
  3234. location in the text, data, bss or absolute sections the value is the
  3235. number of addresses from the start of that section to the label.
  3236. Naturally for text, data and bss sections the value of a symbol changes
  3237. as @code{@value{LD}} changes section base addresses during linking. Absolute
  3238. symbols' values do not change during linking: that is why they are
  3239. called absolute.
  3240. The value of an undefined symbol is treated in a special way. If it is
  3241. 0 then the symbol is not defined in this assembler source file, and
  3242. @code{@value{LD}} tries to determine its value from other files linked into the
  3243. same program. You make this kind of symbol simply by mentioning a symbol
  3244. name without defining it. A non-zero value represents a @code{.comm}
  3245. common declaration. The value is how much common storage to reserve, in
  3246. bytes (addresses). The symbol refers to the first address of the
  3247. allocated storage.
  3248. @node Symbol Type
  3249. @subsection Type
  3250. @cindex type of a symbol
  3251. @cindex symbol type
  3252. The type attribute of a symbol contains relocation (section)
  3253. information, any flag settings indicating that a symbol is external, and
  3254. (optionally), other information for linkers and debuggers. The exact
  3255. format depends on the object-code output format in use.
  3256. @ifset aout-bout
  3257. @ifclear GENERIC
  3258. @ifset BOUT
  3259. @c The following avoids a "widow" subsection title. @group would be
  3260. @c better if it were available outside examples.
  3261. @need 1000
  3262. @node a.out Symbols
  3263. @subsection Symbol Attributes: @code{a.out}, @code{b.out}
  3264. @cindex @code{b.out} symbol attributes
  3265. @cindex symbol attributes, @code{b.out}
  3266. These symbol attributes appear only when @command{@value{AS}} is configured for
  3267. one of the Berkeley-descended object output formats---@code{a.out} or
  3268. @code{b.out}.
  3269. @end ifset
  3270. @ifclear BOUT
  3271. @node a.out Symbols
  3272. @subsection Symbol Attributes: @code{a.out}
  3273. @cindex @code{a.out} symbol attributes
  3274. @cindex symbol attributes, @code{a.out}
  3275. @end ifclear
  3276. @end ifclear
  3277. @ifset GENERIC
  3278. @node a.out Symbols
  3279. @subsection Symbol Attributes: @code{a.out}
  3280. @cindex @code{a.out} symbol attributes
  3281. @cindex symbol attributes, @code{a.out}
  3282. @end ifset
  3283. @menu
  3284. * Symbol Desc:: Descriptor
  3285. * Symbol Other:: Other
  3286. @end menu
  3287. @node Symbol Desc
  3288. @subsubsection Descriptor
  3289. @cindex descriptor, of @code{a.out} symbol
  3290. This is an arbitrary 16-bit value. You may establish a symbol's
  3291. descriptor value by using a @code{.desc} statement
  3292. (@pxref{Desc,,@code{.desc}}). A descriptor value means nothing to
  3293. @command{@value{AS}}.
  3294. @node Symbol Other
  3295. @subsubsection Other
  3296. @cindex other attribute, of @code{a.out} symbol
  3297. This is an arbitrary 8-bit value. It means nothing to @command{@value{AS}}.
  3298. @end ifset
  3299. @ifset COFF
  3300. @node COFF Symbols
  3301. @subsection Symbol Attributes for COFF
  3302. @cindex COFF symbol attributes
  3303. @cindex symbol attributes, COFF
  3304. The COFF format supports a multitude of auxiliary symbol attributes;
  3305. like the primary symbol attributes, they are set between @code{.def} and
  3306. @code{.endef} directives.
  3307. @subsubsection Primary Attributes
  3308. @cindex primary attributes, COFF symbols
  3309. The symbol name is set with @code{.def}; the value and type,
  3310. respectively, with @code{.val} and @code{.type}.
  3311. @subsubsection Auxiliary Attributes
  3312. @cindex auxiliary attributes, COFF symbols
  3313. The @command{@value{AS}} directives @code{.dim}, @code{.line}, @code{.scl},
  3314. @code{.size}, @code{.tag}, and @code{.weak} can generate auxiliary symbol
  3315. table information for COFF.
  3316. @end ifset
  3317. @ifset SOM
  3318. @node SOM Symbols
  3319. @subsection Symbol Attributes for SOM
  3320. @cindex SOM symbol attributes
  3321. @cindex symbol attributes, SOM
  3322. The SOM format for the HPPA supports a multitude of symbol attributes set with
  3323. the @code{.EXPORT} and @code{.IMPORT} directives.
  3324. The attributes are described in @cite{HP9000 Series 800 Assembly
  3325. Language Reference Manual} (HP 92432-90001) under the @code{IMPORT} and
  3326. @code{EXPORT} assembler directive documentation.
  3327. @end ifset
  3328. @node Expressions
  3329. @chapter Expressions
  3330. @cindex expressions
  3331. @cindex addresses
  3332. @cindex numeric values
  3333. An @dfn{expression} specifies an address or numeric value.
  3334. Whitespace may precede and/or follow an expression.
  3335. The result of an expression must be an absolute number, or else an offset into
  3336. a particular section. If an expression is not absolute, and there is not
  3337. enough information when @command{@value{AS}} sees the expression to know its
  3338. section, a second pass over the source program might be necessary to interpret
  3339. the expression---but the second pass is currently not implemented.
  3340. @command{@value{AS}} aborts with an error message in this situation.
  3341. @menu
  3342. * Empty Exprs:: Empty Expressions
  3343. * Integer Exprs:: Integer Expressions
  3344. @end menu
  3345. @node Empty Exprs
  3346. @section Empty Expressions
  3347. @cindex empty expressions
  3348. @cindex expressions, empty
  3349. An empty expression has no value: it is just whitespace or null.
  3350. Wherever an absolute expression is required, you may omit the
  3351. expression, and @command{@value{AS}} assumes a value of (absolute) 0. This
  3352. is compatible with other assemblers.
  3353. @node Integer Exprs
  3354. @section Integer Expressions
  3355. @cindex integer expressions
  3356. @cindex expressions, integer
  3357. An @dfn{integer expression} is one or more @emph{arguments} delimited
  3358. by @emph{operators}.
  3359. @menu
  3360. * Arguments:: Arguments
  3361. * Operators:: Operators
  3362. * Prefix Ops:: Prefix Operators
  3363. * Infix Ops:: Infix Operators
  3364. @end menu
  3365. @node Arguments
  3366. @subsection Arguments
  3367. @cindex expression arguments
  3368. @cindex arguments in expressions
  3369. @cindex operands in expressions
  3370. @cindex arithmetic operands
  3371. @dfn{Arguments} are symbols, numbers or subexpressions. In other
  3372. contexts arguments are sometimes called ``arithmetic operands''. In
  3373. this manual, to avoid confusing them with the ``instruction operands'' of
  3374. the machine language, we use the term ``argument'' to refer to parts of
  3375. expressions only, reserving the word ``operand'' to refer only to machine
  3376. instruction operands.
  3377. Symbols are evaluated to yield @{@var{section} @var{NNN}@} where
  3378. @var{section} is one of text, data, bss, absolute,
  3379. or undefined. @var{NNN} is a signed, 2's complement 32 bit
  3380. integer.
  3381. Numbers are usually integers.
  3382. A number can be a flonum or bignum. In this case, you are warned
  3383. that only the low order 32 bits are used, and @command{@value{AS}} pretends
  3384. these 32 bits are an integer. You may write integer-manipulating
  3385. instructions that act on exotic constants, compatible with other
  3386. assemblers.
  3387. @cindex subexpressions
  3388. Subexpressions are a left parenthesis @samp{(} followed by an integer
  3389. expression, followed by a right parenthesis @samp{)}; or a prefix
  3390. operator followed by an argument.
  3391. @node Operators
  3392. @subsection Operators
  3393. @cindex operators, in expressions
  3394. @cindex arithmetic functions
  3395. @cindex functions, in expressions
  3396. @dfn{Operators} are arithmetic functions, like @code{+} or @code{%}. Prefix
  3397. operators are followed by an argument. Infix operators appear
  3398. between their arguments. Operators may be preceded and/or followed by
  3399. whitespace.
  3400. @node Prefix Ops
  3401. @subsection Prefix Operator
  3402. @cindex prefix operators
  3403. @command{@value{AS}} has the following @dfn{prefix operators}. They each take
  3404. one argument, which must be absolute.
  3405. @c the tex/end tex stuff surrounding this small table is meant to make
  3406. @c it align, on the printed page, with the similar table in the next
  3407. @c section (which is inside an enumerate).
  3408. @tex
  3409. \global\advance\leftskip by \itemindent
  3410. @end tex
  3411. @table @code
  3412. @item -
  3413. @dfn{Negation}. Two's complement negation.
  3414. @item ~
  3415. @dfn{Complementation}. Bitwise not.
  3416. @end table
  3417. @tex
  3418. \global\advance\leftskip by -\itemindent
  3419. @end tex
  3420. @node Infix Ops
  3421. @subsection Infix Operators
  3422. @cindex infix operators
  3423. @cindex operators, permitted arguments
  3424. @dfn{Infix operators} take two arguments, one on either side. Operators
  3425. have precedence, but operations with equal precedence are performed left
  3426. to right. Apart from @code{+} or @option{-}, both arguments must be
  3427. absolute, and the result is absolute.
  3428. @enumerate
  3429. @cindex operator precedence
  3430. @cindex precedence of operators
  3431. @item
  3432. Highest Precedence
  3433. @table @code
  3434. @item *
  3435. @dfn{Multiplication}.
  3436. @item /
  3437. @dfn{Division}. Truncation is the same as the C operator @samp{/}
  3438. @item %
  3439. @dfn{Remainder}.
  3440. @item <<
  3441. @dfn{Shift Left}. Same as the C operator @samp{<<}.
  3442. @item >>
  3443. @dfn{Shift Right}. Same as the C operator @samp{>>}.
  3444. @end table
  3445. @item
  3446. Intermediate precedence
  3447. @table @code
  3448. @item |
  3449. @dfn{Bitwise Inclusive Or}.
  3450. @item &
  3451. @dfn{Bitwise And}.
  3452. @item ^
  3453. @dfn{Bitwise Exclusive Or}.
  3454. @item !
  3455. @dfn{Bitwise Or Not}.
  3456. @end table
  3457. @item
  3458. Low Precedence
  3459. @table @code
  3460. @cindex addition, permitted arguments
  3461. @cindex plus, permitted arguments
  3462. @cindex arguments for addition
  3463. @item +
  3464. @dfn{Addition}. If either argument is absolute, the result has the section of
  3465. the other argument. You may not add together arguments from different
  3466. sections.
  3467. @cindex subtraction, permitted arguments
  3468. @cindex minus, permitted arguments
  3469. @cindex arguments for subtraction
  3470. @item -
  3471. @dfn{Subtraction}. If the right argument is absolute, the
  3472. result has the section of the left argument.
  3473. If both arguments are in the same section, the result is absolute.
  3474. You may not subtract arguments from different sections.
  3475. @c FIXME is there still something useful to say about undefined - undefined ?
  3476. @cindex comparison expressions
  3477. @cindex expressions, comparison
  3478. @item ==
  3479. @dfn{Is Equal To}
  3480. @item <>
  3481. @itemx !=
  3482. @dfn{Is Not Equal To}
  3483. @item <
  3484. @dfn{Is Less Than}
  3485. @item >
  3486. @dfn{Is Greater Than}
  3487. @item >=
  3488. @dfn{Is Greater Than Or Equal To}
  3489. @item <=
  3490. @dfn{Is Less Than Or Equal To}
  3491. The comparison operators can be used as infix operators. A true results has a
  3492. value of -1 whereas a false result has a value of 0. Note, these operators
  3493. perform signed comparisons.
  3494. @end table
  3495. @item Lowest Precedence
  3496. @table @code
  3497. @item &&
  3498. @dfn{Logical And}.
  3499. @item ||
  3500. @dfn{Logical Or}.
  3501. These two logical operations can be used to combine the results of sub
  3502. expressions. Note, unlike the comparison operators a true result returns a
  3503. value of 1 but a false results does still return 0. Also note that the logical
  3504. or operator has a slightly lower precedence than logical and.
  3505. @end table
  3506. @end enumerate
  3507. In short, it's only meaningful to add or subtract the @emph{offsets} in an
  3508. address; you can only have a defined section in one of the two arguments.
  3509. @node Pseudo Ops
  3510. @chapter Assembler Directives
  3511. @cindex directives, machine independent
  3512. @cindex pseudo-ops, machine independent
  3513. @cindex machine independent directives
  3514. All assembler directives have names that begin with a period (@samp{.}).
  3515. The names are case insensitive for most targets, and usually written
  3516. in lower case.
  3517. This chapter discusses directives that are available regardless of the
  3518. target machine configuration for the @sc{gnu} assembler.
  3519. @ifset GENERIC
  3520. Some machine configurations provide additional directives.
  3521. @xref{Machine Dependencies}.
  3522. @end ifset
  3523. @ifclear GENERIC
  3524. @ifset machine-directives
  3525. @xref{Machine Dependencies}, for additional directives.
  3526. @end ifset
  3527. @end ifclear
  3528. @menu
  3529. * Abort:: @code{.abort}
  3530. @ifset COFF
  3531. * ABORT (COFF):: @code{.ABORT}
  3532. @end ifset
  3533. * Align:: @code{.align @var{abs-expr} , @var{abs-expr}}
  3534. * Altmacro:: @code{.altmacro}
  3535. * Ascii:: @code{.ascii "@var{string}"}@dots{}
  3536. * Asciz:: @code{.asciz "@var{string}"}@dots{}
  3537. * Balign:: @code{.balign @var{abs-expr} , @var{abs-expr}}
  3538. * Bundle directives:: @code{.bundle_align_mode @var{abs-expr}}, etc
  3539. * Byte:: @code{.byte @var{expressions}}
  3540. * CFI directives:: @code{.cfi_startproc [simple]}, @code{.cfi_endproc}, etc.
  3541. * Comm:: @code{.comm @var{symbol} , @var{length} }
  3542. * Data:: @code{.data @var{subsection}}
  3543. @ifset COFF
  3544. * Def:: @code{.def @var{name}}
  3545. @end ifset
  3546. @ifset aout-bout
  3547. * Desc:: @code{.desc @var{symbol}, @var{abs-expression}}
  3548. @end ifset
  3549. @ifset COFF
  3550. * Dim:: @code{.dim}
  3551. @end ifset
  3552. * Double:: @code{.double @var{flonums}}
  3553. * Eject:: @code{.eject}
  3554. * Else:: @code{.else}
  3555. * Elseif:: @code{.elseif}
  3556. * End:: @code{.end}
  3557. @ifset COFF
  3558. * Endef:: @code{.endef}
  3559. @end ifset
  3560. * Endfunc:: @code{.endfunc}
  3561. * Endif:: @code{.endif}
  3562. * Equ:: @code{.equ @var{symbol}, @var{expression}}
  3563. * Equiv:: @code{.equiv @var{symbol}, @var{expression}}
  3564. * Eqv:: @code{.eqv @var{symbol}, @var{expression}}
  3565. * Err:: @code{.err}
  3566. * Error:: @code{.error @var{string}}
  3567. * Exitm:: @code{.exitm}
  3568. * Extern:: @code{.extern}
  3569. * Fail:: @code{.fail}
  3570. * File:: @code{.file}
  3571. * Fill:: @code{.fill @var{repeat} , @var{size} , @var{value}}
  3572. * Float:: @code{.float @var{flonums}}
  3573. * Func:: @code{.func}
  3574. * Global:: @code{.global @var{symbol}}, @code{.globl @var{symbol}}
  3575. @ifset ELF
  3576. * Gnu_attribute:: @code{.gnu_attribute @var{tag},@var{value}}
  3577. * Hidden:: @code{.hidden @var{names}}
  3578. @end ifset
  3579. * hword:: @code{.hword @var{expressions}}
  3580. * Ident:: @code{.ident}
  3581. * If:: @code{.if @var{absolute expression}}
  3582. * Incbin:: @code{.incbin "@var{file}"[,@var{skip}[,@var{count}]]}
  3583. * Include:: @code{.include "@var{file}"}
  3584. * Int:: @code{.int @var{expressions}}
  3585. @ifset ELF
  3586. * Internal:: @code{.internal @var{names}}
  3587. @end ifset
  3588. * Irp:: @code{.irp @var{symbol},@var{values}}@dots{}
  3589. * Irpc:: @code{.irpc @var{symbol},@var{values}}@dots{}
  3590. * Lcomm:: @code{.lcomm @var{symbol} , @var{length}}
  3591. * Lflags:: @code{.lflags}
  3592. @ifclear no-line-dir
  3593. * Line:: @code{.line @var{line-number}}
  3594. @end ifclear
  3595. * Linkonce:: @code{.linkonce [@var{type}]}
  3596. * List:: @code{.list}
  3597. * Ln:: @code{.ln @var{line-number}}
  3598. * Loc:: @code{.loc @var{fileno} @var{lineno}}
  3599. * Loc_mark_labels:: @code{.loc_mark_labels @var{enable}}
  3600. @ifset ELF
  3601. * Local:: @code{.local @var{names}}
  3602. @end ifset
  3603. * Long:: @code{.long @var{expressions}}
  3604. @ignore
  3605. * Lsym:: @code{.lsym @var{symbol}, @var{expression}}
  3606. @end ignore
  3607. * Macro:: @code{.macro @var{name} @var{args}}@dots{}
  3608. * MRI:: @code{.mri @var{val}}
  3609. * Noaltmacro:: @code{.noaltmacro}
  3610. * Nolist:: @code{.nolist}
  3611. * Octa:: @code{.octa @var{bignums}}
  3612. * Offset:: @code{.offset @var{loc}}
  3613. * Org:: @code{.org @var{new-lc}, @var{fill}}
  3614. * P2align:: @code{.p2align @var{abs-expr}, @var{abs-expr}, @var{abs-expr}}
  3615. @ifset ELF
  3616. * PopSection:: @code{.popsection}
  3617. * Previous:: @code{.previous}
  3618. @end ifset
  3619. * Print:: @code{.print @var{string}}
  3620. @ifset ELF
  3621. * Protected:: @code{.protected @var{names}}
  3622. @end ifset
  3623. * Psize:: @code{.psize @var{lines}, @var{columns}}
  3624. * Purgem:: @code{.purgem @var{name}}
  3625. @ifset ELF
  3626. * PushSection:: @code{.pushsection @var{name}}
  3627. @end ifset
  3628. * Quad:: @code{.quad @var{bignums}}
  3629. * Reloc:: @code{.reloc @var{offset}, @var{reloc_name}[, @var{expression}]}
  3630. * Rept:: @code{.rept @var{count}}
  3631. * Sbttl:: @code{.sbttl "@var{subheading}"}
  3632. @ifset COFF
  3633. * Scl:: @code{.scl @var{class}}
  3634. @end ifset
  3635. @ifset COFF-ELF
  3636. * Section:: @code{.section @var{name}[, @var{flags}]}
  3637. @end ifset
  3638. * Set:: @code{.set @var{symbol}, @var{expression}}
  3639. * Short:: @code{.short @var{expressions}}
  3640. * Single:: @code{.single @var{flonums}}
  3641. @ifset COFF-ELF
  3642. * Size:: @code{.size [@var{name} , @var{expression}]}
  3643. @end ifset
  3644. @ifclear no-space-dir
  3645. * Skip:: @code{.skip @var{size} , @var{fill}}
  3646. @end ifclear
  3647. * Sleb128:: @code{.sleb128 @var{expressions}}
  3648. @ifclear no-space-dir
  3649. * Space:: @code{.space @var{size} , @var{fill}}
  3650. @end ifclear
  3651. @ifset have-stabs
  3652. * Stab:: @code{.stabd, .stabn, .stabs}
  3653. @end ifset
  3654. * String:: @code{.string "@var{str}"}, @code{.string8 "@var{str}"}, @code{.string16 "@var{str}"}, @code{.string32 "@var{str}"}, @code{.string64 "@var{str}"}
  3655. * Struct:: @code{.struct @var{expression}}
  3656. @ifset ELF
  3657. * SubSection:: @code{.subsection}
  3658. * Symver:: @code{.symver @var{name},@var{name2@@nodename}}
  3659. @end ifset
  3660. @ifset COFF
  3661. * Tag:: @code{.tag @var{structname}}
  3662. @end ifset
  3663. * Text:: @code{.text @var{subsection}}
  3664. * Title:: @code{.title "@var{heading}"}
  3665. @ifset COFF-ELF
  3666. * Type:: @code{.type <@var{int} | @var{name} , @var{type description}>}
  3667. @end ifset
  3668. * Uleb128:: @code{.uleb128 @var{expressions}}
  3669. @ifset COFF
  3670. * Val:: @code{.val @var{addr}}
  3671. @end ifset
  3672. @ifset ELF
  3673. * Version:: @code{.version "@var{string}"}
  3674. * VTableEntry:: @code{.vtable_entry @var{table}, @var{offset}}
  3675. * VTableInherit:: @code{.vtable_inherit @var{child}, @var{parent}}
  3676. @end ifset
  3677. * Warning:: @code{.warning @var{string}}
  3678. * Weak:: @code{.weak @var{names}}
  3679. * Weakref:: @code{.weakref @var{alias}, @var{symbol}}
  3680. * Word:: @code{.word @var{expressions}}
  3681. @ifclear no-space-dir
  3682. * Zero:: @code{.zero @var{size}}
  3683. @end ifclear
  3684. * Deprecated:: Deprecated Directives
  3685. @end menu
  3686. @node Abort
  3687. @section @code{.abort}
  3688. @cindex @code{abort} directive
  3689. @cindex stopping the assembly
  3690. This directive stops the assembly immediately. It is for
  3691. compatibility with other assemblers. The original idea was that the
  3692. assembly language source would be piped into the assembler. If the sender
  3693. of the source quit, it could use this directive tells @command{@value{AS}} to
  3694. quit also. One day @code{.abort} will not be supported.
  3695. @ifset COFF
  3696. @node ABORT (COFF)
  3697. @section @code{.ABORT} (COFF)
  3698. @cindex @code{ABORT} directive
  3699. When producing COFF output, @command{@value{AS}} accepts this directive as a
  3700. synonym for @samp{.abort}.
  3701. @ifset BOUT
  3702. When producing @code{b.out} output, @command{@value{AS}} accepts this directive,
  3703. but ignores it.
  3704. @end ifset
  3705. @end ifset
  3706. @node Align
  3707. @section @code{.align @var{abs-expr}, @var{abs-expr}, @var{abs-expr}}
  3708. @cindex padding the location counter
  3709. @cindex @code{align} directive
  3710. Pad the location counter (in the current subsection) to a particular storage
  3711. boundary. The first expression (which must be absolute) is the alignment
  3712. required, as described below.
  3713. The second expression (also absolute) gives the fill value to be stored in the
  3714. padding bytes. It (and the comma) may be omitted. If it is omitted, the
  3715. padding bytes are normally zero. However, on some systems, if the section is
  3716. marked as containing code and the fill value is omitted, the space is filled
  3717. with no-op instructions.
  3718. The third expression is also absolute, and is also optional. If it is present,
  3719. it is the maximum number of bytes that should be skipped by this alignment
  3720. directive. If doing the alignment would require skipping more bytes than the
  3721. specified maximum, then the alignment is not done at all. You can omit the
  3722. fill value (the second argument) entirely by simply using two commas after the
  3723. required alignment; this can be useful if you want the alignment to be filled
  3724. with no-op instructions when appropriate.
  3725. The way the required alignment is specified varies from system to system.
  3726. For the arc, hppa, i386 using ELF, i860, iq2000, m68k, or1k,
  3727. s390, sparc, tic4x, tic80 and xtensa, the first expression is the
  3728. alignment request in bytes. For example @samp{.align 8} advances
  3729. the location counter until it is a multiple of 8. If the location counter
  3730. is already a multiple of 8, no change is needed. For the tic54x, the
  3731. first expression is the alignment request in words.
  3732. For other systems, including ppc, i386 using a.out format, arm and
  3733. strongarm, it is the
  3734. number of low-order zero bits the location counter must have after
  3735. advancement. For example @samp{.align 3} advances the location
  3736. counter until it a multiple of 8. If the location counter is already a
  3737. multiple of 8, no change is needed.
  3738. This inconsistency is due to the different behaviors of the various
  3739. native assemblers for these systems which GAS must emulate.
  3740. GAS also provides @code{.balign} and @code{.p2align} directives,
  3741. described later, which have a consistent behavior across all
  3742. architectures (but are specific to GAS).
  3743. @node Altmacro
  3744. @section @code{.altmacro}
  3745. Enable alternate macro mode, enabling:
  3746. @ftable @code
  3747. @item LOCAL @var{name} [ , @dots{} ]
  3748. One additional directive, @code{LOCAL}, is available. It is used to
  3749. generate a string replacement for each of the @var{name} arguments, and
  3750. replace any instances of @var{name} in each macro expansion. The
  3751. replacement string is unique in the assembly, and different for each
  3752. separate macro expansion. @code{LOCAL} allows you to write macros that
  3753. define symbols, without fear of conflict between separate macro expansions.
  3754. @item String delimiters
  3755. You can write strings delimited in these other ways besides
  3756. @code{"@var{string}"}:
  3757. @table @code
  3758. @item '@var{string}'
  3759. You can delimit strings with single-quote characters.
  3760. @item <@var{string}>
  3761. You can delimit strings with matching angle brackets.
  3762. @end table
  3763. @item single-character string escape
  3764. To include any single character literally in a string (even if the
  3765. character would otherwise have some special meaning), you can prefix the
  3766. character with @samp{!} (an exclamation mark). For example, you can
  3767. write @samp{<4.3 !> 5.4!!>} to get the literal text @samp{4.3 > 5.4!}.
  3768. @item Expression results as strings
  3769. You can write @samp{%@var{expr}} to evaluate the expression @var{expr}
  3770. and use the result as a string.
  3771. @end ftable
  3772. @node Ascii
  3773. @section @code{.ascii "@var{string}"}@dots{}
  3774. @cindex @code{ascii} directive
  3775. @cindex string literals
  3776. @code{.ascii} expects zero or more string literals (@pxref{Strings})
  3777. separated by commas. It assembles each string (with no automatic
  3778. trailing zero byte) into consecutive addresses.
  3779. @node Asciz
  3780. @section @code{.asciz "@var{string}"}@dots{}
  3781. @cindex @code{asciz} directive
  3782. @cindex zero-terminated strings
  3783. @cindex null-terminated strings
  3784. @code{.asciz} is just like @code{.ascii}, but each string is followed by
  3785. a zero byte. The ``z'' in @samp{.asciz} stands for ``zero''.
  3786. @node Balign
  3787. @section @code{.balign[wl] @var{abs-expr}, @var{abs-expr}, @var{abs-expr}}
  3788. @cindex padding the location counter given number of bytes
  3789. @cindex @code{balign} directive
  3790. Pad the location counter (in the current subsection) to a particular
  3791. storage boundary. The first expression (which must be absolute) is the
  3792. alignment request in bytes. For example @samp{.balign 8} advances
  3793. the location counter until it is a multiple of 8. If the location counter
  3794. is already a multiple of 8, no change is needed.
  3795. The second expression (also absolute) gives the fill value to be stored in the
  3796. padding bytes. It (and the comma) may be omitted. If it is omitted, the
  3797. padding bytes are normally zero. However, on some systems, if the section is
  3798. marked as containing code and the fill value is omitted, the space is filled
  3799. with no-op instructions.
  3800. The third expression is also absolute, and is also optional. If it is present,
  3801. it is the maximum number of bytes that should be skipped by this alignment
  3802. directive. If doing the alignment would require skipping more bytes than the
  3803. specified maximum, then the alignment is not done at all. You can omit the
  3804. fill value (the second argument) entirely by simply using two commas after the
  3805. required alignment; this can be useful if you want the alignment to be filled
  3806. with no-op instructions when appropriate.
  3807. @cindex @code{balignw} directive
  3808. @cindex @code{balignl} directive
  3809. The @code{.balignw} and @code{.balignl} directives are variants of the
  3810. @code{.balign} directive. The @code{.balignw} directive treats the fill
  3811. pattern as a two byte word value. The @code{.balignl} directives treats the
  3812. fill pattern as a four byte longword value. For example, @code{.balignw
  3813. 4,0x368d} will align to a multiple of 4. If it skips two bytes, they will be
  3814. filled in with the value 0x368d (the exact placement of the bytes depends upon
  3815. the endianness of the processor). If it skips 1 or 3 bytes, the fill value is
  3816. undefined.
  3817. @node Bundle directives
  3818. @section Bundle directives
  3819. @subsection @code{.bundle_align_mode @var{abs-expr}}
  3820. @cindex @code{bundle_align_mode} directive
  3821. @cindex bundle
  3822. @cindex instruction bundle
  3823. @cindex aligned instruction bundle
  3824. @code{.bundle_align_mode} enables or disables @dfn{aligned instruction
  3825. bundle} mode. In this mode, sequences of adjacent instructions are grouped
  3826. into fixed-sized @dfn{bundles}. If the argument is zero, this mode is
  3827. disabled (which is the default state). If the argument it not zero, it
  3828. gives the size of an instruction bundle as a power of two (as for the
  3829. @code{.p2align} directive, @pxref{P2align}).
  3830. For some targets, it's an ABI requirement that no instruction may span a
  3831. certain aligned boundary. A @dfn{bundle} is simply a sequence of
  3832. instructions that starts on an aligned boundary. For example, if
  3833. @var{abs-expr} is @code{5} then the bundle size is 32, so each aligned
  3834. chunk of 32 bytes is a bundle. When aligned instruction bundle mode is in
  3835. effect, no single instruction may span a boundary between bundles. If an
  3836. instruction would start too close to the end of a bundle for the length of
  3837. that particular instruction to fit within the bundle, then the space at the
  3838. end of that bundle is filled with no-op instructions so the instruction
  3839. starts in the next bundle. As a corollary, it's an error if any single
  3840. instruction's encoding is longer than the bundle size.
  3841. @subsection @code{.bundle_lock} and @code{.bundle_unlock}
  3842. @cindex @code{bundle_lock} directive
  3843. @cindex @code{bundle_unlock} directive
  3844. The @code{.bundle_lock} and directive @code{.bundle_unlock} directives
  3845. allow explicit control over instruction bundle padding. These directives
  3846. are only valid when @code{.bundle_align_mode} has been used to enable
  3847. aligned instruction bundle mode. It's an error if they appear when
  3848. @code{.bundle_align_mode} has not been used at all, or when the last
  3849. directive was @w{@code{.bundle_align_mode 0}}.
  3850. @cindex bundle-locked
  3851. For some targets, it's an ABI requirement that certain instructions may
  3852. appear only as part of specified permissible sequences of multiple
  3853. instructions, all within the same bundle. A pair of @code{.bundle_lock}
  3854. and @code{.bundle_unlock} directives define a @dfn{bundle-locked}
  3855. instruction sequence. For purposes of aligned instruction bundle mode, a
  3856. sequence starting with @code{.bundle_lock} and ending with
  3857. @code{.bundle_unlock} is treated as a single instruction. That is, the
  3858. entire sequence must fit into a single bundle and may not span a bundle
  3859. boundary. If necessary, no-op instructions will be inserted before the
  3860. first instruction of the sequence so that the whole sequence starts on an
  3861. aligned bundle boundary. It's an error if the sequence is longer than the
  3862. bundle size.
  3863. For convenience when using @code{.bundle_lock} and @code{.bundle_unlock}
  3864. inside assembler macros (@pxref{Macro}), bundle-locked sequences may be
  3865. nested. That is, a second @code{.bundle_lock} directive before the next
  3866. @code{.bundle_unlock} directive has no effect except that it must be
  3867. matched by another closing @code{.bundle_unlock} so that there is the
  3868. same number of @code{.bundle_lock} and @code{.bundle_unlock} directives.
  3869. @node Byte
  3870. @section @code{.byte @var{expressions}}
  3871. @cindex @code{byte} directive
  3872. @cindex integers, one byte
  3873. @code{.byte} expects zero or more expressions, separated by commas.
  3874. Each expression is assembled into the next byte.
  3875. @node CFI directives
  3876. @section CFI directives
  3877. @subsection @code{.cfi_sections @var{section_list}}
  3878. @cindex @code{cfi_sections} directive
  3879. @code{.cfi_sections} may be used to specify whether CFI directives
  3880. should emit @code{.eh_frame} section and/or @code{.debug_frame} section.
  3881. If @var{section_list} is @code{.eh_frame}, @code{.eh_frame} is emitted,
  3882. if @var{section_list} is @code{.debug_frame}, @code{.debug_frame} is emitted.
  3883. To emit both use @code{.eh_frame, .debug_frame}. The default if this
  3884. directive is not used is @code{.cfi_sections .eh_frame}.
  3885. On targets that support compact unwinding tables these can be generated
  3886. by specifying @code{.eh_frame_entry} instead of @code{.eh_frame}.
  3887. @subsection @code{.cfi_startproc [simple]}
  3888. @cindex @code{cfi_startproc} directive
  3889. @code{.cfi_startproc} is used at the beginning of each function that
  3890. should have an entry in @code{.eh_frame}. It initializes some internal
  3891. data structures. Don't forget to close the function by
  3892. @code{.cfi_endproc}.
  3893. Unless @code{.cfi_startproc} is used along with parameter @code{simple}
  3894. it also emits some architecture dependent initial CFI instructions.
  3895. @subsection @code{.cfi_endproc}
  3896. @cindex @code{cfi_endproc} directive
  3897. @code{.cfi_endproc} is used at the end of a function where it closes its
  3898. unwind entry previously opened by
  3899. @code{.cfi_startproc}, and emits it to @code{.eh_frame}.
  3900. @subsection @code{.cfi_personality @var{encoding} [, @var{exp}]}
  3901. @cindex @code{cfi_personality} directive
  3902. @code{.cfi_personality} defines personality routine and its encoding.
  3903. @var{encoding} must be a constant determining how the personality
  3904. should be encoded. If it is 255 (@code{DW_EH_PE_omit}), second
  3905. argument is not present, otherwise second argument should be
  3906. a constant or a symbol name. When using indirect encodings,
  3907. the symbol provided should be the location where personality
  3908. can be loaded from, not the personality routine itself.
  3909. The default after @code{.cfi_startproc} is @code{.cfi_personality 0xff},
  3910. no personality routine.
  3911. @subsection @code{.cfi_personality_id @var{id}}
  3912. @cindex @code{cfi_personality_id} directive
  3913. @code{cfi_personality_id} defines a personality routine by its index as
  3914. defined in a compact unwinding format.
  3915. Only valid when generating compact EH frames (i.e.
  3916. with @code{.cfi_sections eh_frame_entry}.
  3917. @subsection @code{.cfi_fde_data [@var{opcode1} [, @dots{}]]}
  3918. @cindex @code{cfi_fde_data} directive
  3919. @code{cfi_fde_data} is used to describe the compact unwind opcodes to be
  3920. used for the current function. These are emitted inline in the
  3921. @code{.eh_frame_entry} section if small enough and there is no LSDA, or
  3922. in the @code{.gnu.extab} section otherwise.
  3923. Only valid when generating compact EH frames (i.e.
  3924. with @code{.cfi_sections eh_frame_entry}.
  3925. @subsection @code{.cfi_lsda @var{encoding} [, @var{exp}]}
  3926. @code{.cfi_lsda} defines LSDA and its encoding.
  3927. @var{encoding} must be a constant determining how the LSDA
  3928. should be encoded. If it is 255 (@code{DW_EH_PE_omit}), the second
  3929. argument is not present, otherwise the second argument should be a constant
  3930. or a symbol name. The default after @code{.cfi_startproc} is @code{.cfi_lsda 0xff},
  3931. meaning that no LSDA is present.
  3932. @subsection @code{.cfi_inline_lsda} [@var{align}]
  3933. @code{.cfi_inline_lsda} marks the start of a LSDA data section and
  3934. switches to the corresponding @code{.gnu.extab} section.
  3935. Must be preceded by a CFI block containing a @code{.cfi_lsda} directive.
  3936. Only valid when generating compact EH frames (i.e.
  3937. with @code{.cfi_sections eh_frame_entry}.
  3938. The table header and unwinding opcodes will be generated at this point,
  3939. so that they are immediately followed by the LSDA data. The symbol
  3940. referenced by the @code{.cfi_lsda} directive should still be defined
  3941. in case a fallback FDE based encoding is used. The LSDA data is terminated
  3942. by a section directive.
  3943. The optional @var{align} argument specifies the alignment required.
  3944. The alignment is specified as a power of two, as with the
  3945. @code{.p2align} directive.
  3946. @subsection @code{.cfi_def_cfa @var{register}, @var{offset}}
  3947. @code{.cfi_def_cfa} defines a rule for computing CFA as: @i{take
  3948. address from @var{register} and add @var{offset} to it}.
  3949. @subsection @code{.cfi_def_cfa_register @var{register}}
  3950. @code{.cfi_def_cfa_register} modifies a rule for computing CFA. From
  3951. now on @var{register} will be used instead of the old one. Offset
  3952. remains the same.
  3953. @subsection @code{.cfi_def_cfa_offset @var{offset}}
  3954. @code{.cfi_def_cfa_offset} modifies a rule for computing CFA. Register
  3955. remains the same, but @var{offset} is new. Note that it is the
  3956. absolute offset that will be added to a defined register to compute
  3957. CFA address.
  3958. @subsection @code{.cfi_adjust_cfa_offset @var{offset}}
  3959. Same as @code{.cfi_def_cfa_offset} but @var{offset} is a relative
  3960. value that is added/substracted from the previous offset.
  3961. @subsection @code{.cfi_offset @var{register}, @var{offset}}
  3962. Previous value of @var{register} is saved at offset @var{offset} from
  3963. CFA.
  3964. @subsection @code{.cfi_rel_offset @var{register}, @var{offset}}
  3965. Previous value of @var{register} is saved at offset @var{offset} from
  3966. the current CFA register. This is transformed to @code{.cfi_offset}
  3967. using the known displacement of the CFA register from the CFA.
  3968. This is often easier to use, because the number will match the
  3969. code it's annotating.
  3970. @subsection @code{.cfi_register @var{register1}, @var{register2}}
  3971. Previous value of @var{register1} is saved in register @var{register2}.
  3972. @subsection @code{.cfi_restore @var{register}}
  3973. @code{.cfi_restore} says that the rule for @var{register} is now the
  3974. same as it was at the beginning of the function, after all initial
  3975. instruction added by @code{.cfi_startproc} were executed.
  3976. @subsection @code{.cfi_undefined @var{register}}
  3977. From now on the previous value of @var{register} can't be restored anymore.
  3978. @subsection @code{.cfi_same_value @var{register}}
  3979. Current value of @var{register} is the same like in the previous frame,
  3980. i.e. no restoration needed.
  3981. @subsection @code{.cfi_remember_state},
  3982. First save all current rules for all registers by @code{.cfi_remember_state},
  3983. then totally screw them up by subsequent @code{.cfi_*} directives and when
  3984. everything is hopelessly bad, use @code{.cfi_restore_state} to restore
  3985. the previous saved state.
  3986. @subsection @code{.cfi_return_column @var{register}}
  3987. Change return column @var{register}, i.e. the return address is either
  3988. directly in @var{register} or can be accessed by rules for @var{register}.
  3989. @subsection @code{.cfi_signal_frame}
  3990. Mark current function as signal trampoline.
  3991. @subsection @code{.cfi_window_save}
  3992. SPARC register window has been saved.
  3993. @subsection @code{.cfi_escape} @var{expression}[, @dots{}]
  3994. Allows the user to add arbitrary bytes to the unwind info. One
  3995. might use this to add OS-specific CFI opcodes, or generic CFI
  3996. opcodes that GAS does not yet support.
  3997. @subsection @code{.cfi_val_encoded_addr @var{register}, @var{encoding}, @var{label}}
  3998. The current value of @var{register} is @var{label}. The value of @var{label}
  3999. will be encoded in the output file according to @var{encoding}; see the
  4000. description of @code{.cfi_personality} for details on this encoding.
  4001. The usefulness of equating a register to a fixed label is probably
  4002. limited to the return address register. Here, it can be useful to
  4003. mark a code segment that has only one return address which is reached
  4004. by a direct branch and no copy of the return address exists in memory
  4005. or another register.
  4006. @node Comm
  4007. @section @code{.comm @var{symbol} , @var{length} }
  4008. @cindex @code{comm} directive
  4009. @cindex symbol, common
  4010. @code{.comm} declares a common symbol named @var{symbol}. When linking, a
  4011. common symbol in one object file may be merged with a defined or common symbol
  4012. of the same name in another object file. If @code{@value{LD}} does not see a
  4013. definition for the symbol--just one or more common symbols--then it will
  4014. allocate @var{length} bytes of uninitialized memory. @var{length} must be an
  4015. absolute expression. If @code{@value{LD}} sees multiple common symbols with
  4016. the same name, and they do not all have the same size, it will allocate space
  4017. using the largest size.
  4018. @ifset COFF-ELF
  4019. When using ELF or (as a GNU extension) PE, the @code{.comm} directive takes
  4020. an optional third argument. This is the desired alignment of the symbol,
  4021. specified for ELF as a byte boundary (for example, an alignment of 16 means
  4022. that the least significant 4 bits of the address should be zero), and for PE
  4023. as a power of two (for example, an alignment of 5 means aligned to a 32-byte
  4024. boundary). The alignment must be an absolute expression, and it must be a
  4025. power of two. If @code{@value{LD}} allocates uninitialized memory for the
  4026. common symbol, it will use the alignment when placing the symbol. If no
  4027. alignment is specified, @command{@value{AS}} will set the alignment to the
  4028. largest power of two less than or equal to the size of the symbol, up to a
  4029. maximum of 16 on ELF, or the default section alignment of 4 on PE@footnote{This
  4030. is not the same as the executable image file alignment controlled by @code{@value{LD}}'s
  4031. @samp{--section-alignment} option; image file sections in PE are aligned to
  4032. multiples of 4096, which is far too large an alignment for ordinary variables.
  4033. It is rather the default alignment for (non-debug) sections within object
  4034. (@samp{*.o}) files, which are less strictly aligned.}.
  4035. @end ifset
  4036. @ifset HPPA
  4037. The syntax for @code{.comm} differs slightly on the HPPA. The syntax is
  4038. @samp{@var{symbol} .comm, @var{length}}; @var{symbol} is optional.
  4039. @end ifset
  4040. @node Data
  4041. @section @code{.data @var{subsection}}
  4042. @cindex @code{data} directive
  4043. @code{.data} tells @command{@value{AS}} to assemble the following statements onto the
  4044. end of the data subsection numbered @var{subsection} (which is an
  4045. absolute expression). If @var{subsection} is omitted, it defaults
  4046. to zero.
  4047. @ifset COFF
  4048. @node Def
  4049. @section @code{.def @var{name}}
  4050. @cindex @code{def} directive
  4051. @cindex COFF symbols, debugging
  4052. @cindex debugging COFF symbols
  4053. Begin defining debugging information for a symbol @var{name}; the
  4054. definition extends until the @code{.endef} directive is encountered.
  4055. @ifset BOUT
  4056. This directive is only observed when @command{@value{AS}} is configured for COFF
  4057. format output; when producing @code{b.out}, @samp{.def} is recognized,
  4058. but ignored.
  4059. @end ifset
  4060. @end ifset
  4061. @ifset aout-bout
  4062. @node Desc
  4063. @section @code{.desc @var{symbol}, @var{abs-expression}}
  4064. @cindex @code{desc} directive
  4065. @cindex COFF symbol descriptor
  4066. @cindex symbol descriptor, COFF
  4067. This directive sets the descriptor of the symbol (@pxref{Symbol Attributes})
  4068. to the low 16 bits of an absolute expression.
  4069. @ifset COFF
  4070. The @samp{.desc} directive is not available when @command{@value{AS}} is
  4071. configured for COFF output; it is only for @code{a.out} or @code{b.out}
  4072. object format. For the sake of compatibility, @command{@value{AS}} accepts
  4073. it, but produces no output, when configured for COFF.
  4074. @end ifset
  4075. @end ifset
  4076. @ifset COFF
  4077. @node Dim
  4078. @section @code{.dim}
  4079. @cindex @code{dim} directive
  4080. @cindex COFF auxiliary symbol information
  4081. @cindex auxiliary symbol information, COFF
  4082. This directive is generated by compilers to include auxiliary debugging
  4083. information in the symbol table. It is only permitted inside
  4084. @code{.def}/@code{.endef} pairs.
  4085. @ifset BOUT
  4086. @samp{.dim} is only meaningful when generating COFF format output; when
  4087. @command{@value{AS}} is generating @code{b.out}, it accepts this directive but
  4088. ignores it.
  4089. @end ifset
  4090. @end ifset
  4091. @node Double
  4092. @section @code{.double @var{flonums}}
  4093. @cindex @code{double} directive
  4094. @cindex floating point numbers (double)
  4095. @code{.double} expects zero or more flonums, separated by commas. It
  4096. assembles floating point numbers.
  4097. @ifset GENERIC
  4098. The exact kind of floating point numbers emitted depends on how
  4099. @command{@value{AS}} is configured. @xref{Machine Dependencies}.
  4100. @end ifset
  4101. @ifclear GENERIC
  4102. @ifset IEEEFLOAT
  4103. On the @value{TARGET} family @samp{.double} emits 64-bit floating-point numbers
  4104. in @sc{ieee} format.
  4105. @end ifset
  4106. @end ifclear
  4107. @node Eject
  4108. @section @code{.eject}
  4109. @cindex @code{eject} directive
  4110. @cindex new page, in listings
  4111. @cindex page, in listings
  4112. @cindex listing control: new page
  4113. Force a page break at this point, when generating assembly listings.
  4114. @node Else
  4115. @section @code{.else}
  4116. @cindex @code{else} directive
  4117. @code{.else} is part of the @command{@value{AS}} support for conditional
  4118. assembly; see @ref{If,,@code{.if}}. It marks the beginning of a section
  4119. of code to be assembled if the condition for the preceding @code{.if}
  4120. was false.
  4121. @node Elseif
  4122. @section @code{.elseif}
  4123. @cindex @code{elseif} directive
  4124. @code{.elseif} is part of the @command{@value{AS}} support for conditional
  4125. assembly; see @ref{If,,@code{.if}}. It is shorthand for beginning a new
  4126. @code{.if} block that would otherwise fill the entire @code{.else} section.
  4127. @node End
  4128. @section @code{.end}
  4129. @cindex @code{end} directive
  4130. @code{.end} marks the end of the assembly file. @command{@value{AS}} does not
  4131. process anything in the file past the @code{.end} directive.
  4132. @ifset COFF
  4133. @node Endef
  4134. @section @code{.endef}
  4135. @cindex @code{endef} directive
  4136. This directive flags the end of a symbol definition begun with
  4137. @code{.def}.
  4138. @ifset BOUT
  4139. @samp{.endef} is only meaningful when generating COFF format output; if
  4140. @command{@value{AS}} is configured to generate @code{b.out}, it accepts this
  4141. directive but ignores it.
  4142. @end ifset
  4143. @end ifset
  4144. @node Endfunc
  4145. @section @code{.endfunc}
  4146. @cindex @code{endfunc} directive
  4147. @code{.endfunc} marks the end of a function specified with @code{.func}.
  4148. @node Endif
  4149. @section @code{.endif}
  4150. @cindex @code{endif} directive
  4151. @code{.endif} is part of the @command{@value{AS}} support for conditional assembly;
  4152. it marks the end of a block of code that is only assembled
  4153. conditionally. @xref{If,,@code{.if}}.
  4154. @node Equ
  4155. @section @code{.equ @var{symbol}, @var{expression}}
  4156. @cindex @code{equ} directive
  4157. @cindex assigning values to symbols
  4158. @cindex symbols, assigning values to
  4159. This directive sets the value of @var{symbol} to @var{expression}.
  4160. It is synonymous with @samp{.set}; see @ref{Set,,@code{.set}}.
  4161. @ifset HPPA
  4162. The syntax for @code{equ} on the HPPA is
  4163. @samp{@var{symbol} .equ @var{expression}}.
  4164. @end ifset
  4165. @ifset Z80
  4166. The syntax for @code{equ} on the Z80 is
  4167. @samp{@var{symbol} equ @var{expression}}.
  4168. On the Z80 it is an eror if @var{symbol} is already defined,
  4169. but the symbol is not protected from later redefinition.
  4170. Compare @ref{Equiv}.
  4171. @end ifset
  4172. @node Equiv
  4173. @section @code{.equiv @var{symbol}, @var{expression}}
  4174. @cindex @code{equiv} directive
  4175. The @code{.equiv} directive is like @code{.equ} and @code{.set}, except that
  4176. the assembler will signal an error if @var{symbol} is already defined. Note a
  4177. symbol which has been referenced but not actually defined is considered to be
  4178. undefined.
  4179. Except for the contents of the error message, this is roughly equivalent to
  4180. @smallexample
  4181. .ifdef SYM
  4182. .err
  4183. .endif
  4184. .equ SYM,VAL
  4185. @end smallexample
  4186. plus it protects the symbol from later redefinition.
  4187. @node Eqv
  4188. @section @code{.eqv @var{symbol}, @var{expression}}
  4189. @cindex @code{eqv} directive
  4190. The @code{.eqv} directive is like @code{.equiv}, but no attempt is made to
  4191. evaluate the expression or any part of it immediately. Instead each time
  4192. the resulting symbol is used in an expression, a snapshot of its current
  4193. value is taken.
  4194. @node Err
  4195. @section @code{.err}
  4196. @cindex @code{err} directive
  4197. If @command{@value{AS}} assembles a @code{.err} directive, it will print an error
  4198. message and, unless the @option{-Z} option was used, it will not generate an
  4199. object file. This can be used to signal an error in conditionally compiled code.
  4200. @node Error
  4201. @section @code{.error "@var{string}"}
  4202. @cindex error directive
  4203. Similarly to @code{.err}, this directive emits an error, but you can specify a
  4204. string that will be emitted as the error message. If you don't specify the
  4205. message, it defaults to @code{".error directive invoked in source file"}.
  4206. @xref{Errors, ,Error and Warning Messages}.
  4207. @smallexample
  4208. .error "This code has not been assembled and tested."
  4209. @end smallexample
  4210. @node Exitm
  4211. @section @code{.exitm}
  4212. Exit early from the current macro definition. @xref{Macro}.
  4213. @node Extern
  4214. @section @code{.extern}
  4215. @cindex @code{extern} directive
  4216. @code{.extern} is accepted in the source program---for compatibility
  4217. with other assemblers---but it is ignored. @command{@value{AS}} treats
  4218. all undefined symbols as external.
  4219. @node Fail
  4220. @section @code{.fail @var{expression}}
  4221. @cindex @code{fail} directive
  4222. Generates an error or a warning. If the value of the @var{expression} is 500
  4223. or more, @command{@value{AS}} will print a warning message. If the value is less
  4224. than 500, @command{@value{AS}} will print an error message. The message will
  4225. include the value of @var{expression}. This can occasionally be useful inside
  4226. complex nested macros or conditional assembly.
  4227. @node File
  4228. @section @code{.file}
  4229. @cindex @code{file} directive
  4230. @ifclear no-file-dir
  4231. There are two different versions of the @code{.file} directive. Targets
  4232. that support DWARF2 line number information use the DWARF2 version of
  4233. @code{.file}. Other targets use the default version.
  4234. @subheading Default Version
  4235. @cindex logical file name
  4236. @cindex file name, logical
  4237. This version of the @code{.file} directive tells @command{@value{AS}} that we
  4238. are about to start a new logical file. The syntax is:
  4239. @smallexample
  4240. .file @var{string}
  4241. @end smallexample
  4242. @var{string} is the new file name. In general, the filename is
  4243. recognized whether or not it is surrounded by quotes @samp{"}; but if you wish
  4244. to specify an empty file name, you must give the quotes--@code{""}. This
  4245. statement may go away in future: it is only recognized to be compatible with
  4246. old @command{@value{AS}} programs.
  4247. @subheading DWARF2 Version
  4248. @end ifclear
  4249. When emitting DWARF2 line number information, @code{.file} assigns filenames
  4250. to the @code{.debug_line} file name table. The syntax is:
  4251. @smallexample
  4252. .file @var{fileno} @var{filename}
  4253. @end smallexample
  4254. The @var{fileno} operand should be a unique positive integer to use as the
  4255. index of the entry in the table. The @var{filename} operand is a C string
  4256. literal.
  4257. The detail of filename indices is exposed to the user because the filename
  4258. table is shared with the @code{.debug_info} section of the DWARF2 debugging
  4259. information, and thus the user must know the exact indices that table
  4260. entries will have.
  4261. @node Fill
  4262. @section @code{.fill @var{repeat} , @var{size} , @var{value}}
  4263. @cindex @code{fill} directive
  4264. @cindex writing patterns in memory
  4265. @cindex patterns, writing in memory
  4266. @var{repeat}, @var{size} and @var{value} are absolute expressions.
  4267. This emits @var{repeat} copies of @var{size} bytes. @var{Repeat}
  4268. may be zero or more. @var{Size} may be zero or more, but if it is
  4269. more than 8, then it is deemed to have the value 8, compatible with
  4270. other people's assemblers. The contents of each @var{repeat} bytes
  4271. is taken from an 8-byte number. The highest order 4 bytes are
  4272. zero. The lowest order 4 bytes are @var{value} rendered in the
  4273. byte-order of an integer on the computer @command{@value{AS}} is assembling for.
  4274. Each @var{size} bytes in a repetition is taken from the lowest order
  4275. @var{size} bytes of this number. Again, this bizarre behavior is
  4276. compatible with other people's assemblers.
  4277. @var{size} and @var{value} are optional.
  4278. If the second comma and @var{value} are absent, @var{value} is
  4279. assumed zero. If the first comma and following tokens are absent,
  4280. @var{size} is assumed to be 1.
  4281. @node Float
  4282. @section @code{.float @var{flonums}}
  4283. @cindex floating point numbers (single)
  4284. @cindex @code{float} directive
  4285. This directive assembles zero or more flonums, separated by commas. It
  4286. has the same effect as @code{.single}.
  4287. @ifset GENERIC
  4288. The exact kind of floating point numbers emitted depends on how
  4289. @command{@value{AS}} is configured.
  4290. @xref{Machine Dependencies}.
  4291. @end ifset
  4292. @ifclear GENERIC
  4293. @ifset IEEEFLOAT
  4294. On the @value{TARGET} family, @code{.float} emits 32-bit floating point numbers
  4295. in @sc{ieee} format.
  4296. @end ifset
  4297. @end ifclear
  4298. @node Func
  4299. @section @code{.func @var{name}[,@var{label}]}
  4300. @cindex @code{func} directive
  4301. @code{.func} emits debugging information to denote function @var{name}, and
  4302. is ignored unless the file is assembled with debugging enabled.
  4303. Only @samp{--gstabs[+]} is currently supported.
  4304. @var{label} is the entry point of the function and if omitted @var{name}
  4305. prepended with the @samp{leading char} is used.
  4306. @samp{leading char} is usually @code{_} or nothing, depending on the target.
  4307. All functions are currently defined to have @code{void} return type.
  4308. The function must be terminated with @code{.endfunc}.
  4309. @node Global
  4310. @section @code{.global @var{symbol}}, @code{.globl @var{symbol}}
  4311. @cindex @code{global} directive
  4312. @cindex symbol, making visible to linker
  4313. @code{.global} makes the symbol visible to @code{@value{LD}}. If you define
  4314. @var{symbol} in your partial program, its value is made available to
  4315. other partial programs that are linked with it. Otherwise,
  4316. @var{symbol} takes its attributes from a symbol of the same name
  4317. from another file linked into the same program.
  4318. Both spellings (@samp{.globl} and @samp{.global}) are accepted, for
  4319. compatibility with other assemblers.
  4320. @ifset HPPA
  4321. On the HPPA, @code{.global} is not always enough to make it accessible to other
  4322. partial programs. You may need the HPPA-only @code{.EXPORT} directive as well.
  4323. @xref{HPPA Directives, ,HPPA Assembler Directives}.
  4324. @end ifset
  4325. @ifset ELF
  4326. @node Gnu_attribute
  4327. @section @code{.gnu_attribute @var{tag},@var{value}}
  4328. Record a @sc{gnu} object attribute for this file. @xref{Object Attributes}.
  4329. @node Hidden
  4330. @section @code{.hidden @var{names}}
  4331. @cindex @code{hidden} directive
  4332. @cindex visibility
  4333. This is one of the ELF visibility directives. The other two are
  4334. @code{.internal} (@pxref{Internal,,@code{.internal}}) and
  4335. @code{.protected} (@pxref{Protected,,@code{.protected}}).
  4336. This directive overrides the named symbols default visibility (which is set by
  4337. their binding: local, global or weak). The directive sets the visibility to
  4338. @code{hidden} which means that the symbols are not visible to other components.
  4339. Such symbols are always considered to be @code{protected} as well.
  4340. @end ifset
  4341. @node hword
  4342. @section @code{.hword @var{expressions}}
  4343. @cindex @code{hword} directive
  4344. @cindex integers, 16-bit
  4345. @cindex numbers, 16-bit
  4346. @cindex sixteen bit integers
  4347. This expects zero or more @var{expressions}, and emits
  4348. a 16 bit number for each.
  4349. @ifset GENERIC
  4350. This directive is a synonym for @samp{.short}; depending on the target
  4351. architecture, it may also be a synonym for @samp{.word}.
  4352. @end ifset
  4353. @ifclear GENERIC
  4354. @ifset W32
  4355. This directive is a synonym for @samp{.short}.
  4356. @end ifset
  4357. @ifset W16
  4358. This directive is a synonym for both @samp{.short} and @samp{.word}.
  4359. @end ifset
  4360. @end ifclear
  4361. @node Ident
  4362. @section @code{.ident}
  4363. @cindex @code{ident} directive
  4364. This directive is used by some assemblers to place tags in object files. The
  4365. behavior of this directive varies depending on the target. When using the
  4366. a.out object file format, @command{@value{AS}} simply accepts the directive for
  4367. source-file compatibility with existing assemblers, but does not emit anything
  4368. for it. When using COFF, comments are emitted to the @code{.comment} or
  4369. @code{.rdata} section, depending on the target. When using ELF, comments are
  4370. emitted to the @code{.comment} section.
  4371. @node If
  4372. @section @code{.if @var{absolute expression}}
  4373. @cindex conditional assembly
  4374. @cindex @code{if} directive
  4375. @code{.if} marks the beginning of a section of code which is only
  4376. considered part of the source program being assembled if the argument
  4377. (which must be an @var{absolute expression}) is non-zero. The end of
  4378. the conditional section of code must be marked by @code{.endif}
  4379. (@pxref{Endif,,@code{.endif}}); optionally, you may include code for the
  4380. alternative condition, flagged by @code{.else} (@pxref{Else,,@code{.else}}).
  4381. If you have several conditions to check, @code{.elseif} may be used to avoid
  4382. nesting blocks if/else within each subsequent @code{.else} block.
  4383. The following variants of @code{.if} are also supported:
  4384. @table @code
  4385. @cindex @code{ifdef} directive
  4386. @item .ifdef @var{symbol}
  4387. Assembles the following section of code if the specified @var{symbol}
  4388. has been defined. Note a symbol which has been referenced but not yet defined
  4389. is considered to be undefined.
  4390. @cindex @code{ifb} directive
  4391. @item .ifb @var{text}
  4392. Assembles the following section of code if the operand is blank (empty).
  4393. @cindex @code{ifc} directive
  4394. @item .ifc @var{string1},@var{string2}
  4395. Assembles the following section of code if the two strings are the same. The
  4396. strings may be optionally quoted with single quotes. If they are not quoted,
  4397. the first string stops at the first comma, and the second string stops at the
  4398. end of the line. Strings which contain whitespace should be quoted. The
  4399. string comparison is case sensitive.
  4400. @cindex @code{ifeq} directive
  4401. @item .ifeq @var{absolute expression}
  4402. Assembles the following section of code if the argument is zero.
  4403. @cindex @code{ifeqs} directive
  4404. @item .ifeqs @var{string1},@var{string2}
  4405. Another form of @code{.ifc}. The strings must be quoted using double quotes.
  4406. @cindex @code{ifge} directive
  4407. @item .ifge @var{absolute expression}
  4408. Assembles the following section of code if the argument is greater than or
  4409. equal to zero.
  4410. @cindex @code{ifgt} directive
  4411. @item .ifgt @var{absolute expression}
  4412. Assembles the following section of code if the argument is greater than zero.
  4413. @cindex @code{ifle} directive
  4414. @item .ifle @var{absolute expression}
  4415. Assembles the following section of code if the argument is less than or equal
  4416. to zero.
  4417. @cindex @code{iflt} directive
  4418. @item .iflt @var{absolute expression}
  4419. Assembles the following section of code if the argument is less than zero.
  4420. @cindex @code{ifnb} directive
  4421. @item .ifnb @var{text}
  4422. Like @code{.ifb}, but the sense of the test is reversed: this assembles the
  4423. following section of code if the operand is non-blank (non-empty).
  4424. @cindex @code{ifnc} directive
  4425. @item .ifnc @var{string1},@var{string2}.
  4426. Like @code{.ifc}, but the sense of the test is reversed: this assembles the
  4427. following section of code if the two strings are not the same.
  4428. @cindex @code{ifndef} directive
  4429. @cindex @code{ifnotdef} directive
  4430. @item .ifndef @var{symbol}
  4431. @itemx .ifnotdef @var{symbol}
  4432. Assembles the following section of code if the specified @var{symbol}
  4433. has not been defined. Both spelling variants are equivalent. Note a symbol
  4434. which has been referenced but not yet defined is considered to be undefined.
  4435. @cindex @code{ifne} directive
  4436. @item .ifne @var{absolute expression}
  4437. Assembles the following section of code if the argument is not equal to zero
  4438. (in other words, this is equivalent to @code{.if}).
  4439. @cindex @code{ifnes} directive
  4440. @item .ifnes @var{string1},@var{string2}
  4441. Like @code{.ifeqs}, but the sense of the test is reversed: this assembles the
  4442. following section of code if the two strings are not the same.
  4443. @end table
  4444. @node Incbin
  4445. @section @code{.incbin "@var{file}"[,@var{skip}[,@var{count}]]}
  4446. @cindex @code{incbin} directive
  4447. @cindex binary files, including
  4448. The @code{incbin} directive includes @var{file} verbatim at the current
  4449. location. You can control the search paths used with the @samp{-I} command-line
  4450. option (@pxref{Invoking,,Command-Line Options}). Quotation marks are required
  4451. around @var{file}.
  4452. The @var{skip} argument skips a number of bytes from the start of the
  4453. @var{file}. The @var{count} argument indicates the maximum number of bytes to
  4454. read. Note that the data is not aligned in any way, so it is the user's
  4455. responsibility to make sure that proper alignment is provided both before and
  4456. after the @code{incbin} directive.
  4457. @node Include
  4458. @section @code{.include "@var{file}"}
  4459. @cindex @code{include} directive
  4460. @cindex supporting files, including
  4461. @cindex files, including
  4462. This directive provides a way to include supporting files at specified
  4463. points in your source program. The code from @var{file} is assembled as
  4464. if it followed the point of the @code{.include}; when the end of the
  4465. included file is reached, assembly of the original file continues. You
  4466. can control the search paths used with the @samp{-I} command-line option
  4467. (@pxref{Invoking,,Command-Line Options}). Quotation marks are required
  4468. around @var{file}.
  4469. @node Int
  4470. @section @code{.int @var{expressions}}
  4471. @cindex @code{int} directive
  4472. @cindex integers, 32-bit
  4473. Expect zero or more @var{expressions}, of any section, separated by commas.
  4474. For each expression, emit a number that, at run time, is the value of that
  4475. expression. The byte order and bit size of the number depends on what kind
  4476. of target the assembly is for.
  4477. @ifclear GENERIC
  4478. @ifset H8
  4479. On most forms of the H8/300, @code{.int} emits 16-bit
  4480. integers. On the H8/300H and the Renesas SH, however, @code{.int} emits
  4481. 32-bit integers.
  4482. @end ifset
  4483. @end ifclear
  4484. @ifset ELF
  4485. @node Internal
  4486. @section @code{.internal @var{names}}
  4487. @cindex @code{internal} directive
  4488. @cindex visibility
  4489. This is one of the ELF visibility directives. The other two are
  4490. @code{.hidden} (@pxref{Hidden,,@code{.hidden}}) and
  4491. @code{.protected} (@pxref{Protected,,@code{.protected}}).
  4492. This directive overrides the named symbols default visibility (which is set by
  4493. their binding: local, global or weak). The directive sets the visibility to
  4494. @code{internal} which means that the symbols are considered to be @code{hidden}
  4495. (i.e., not visible to other components), and that some extra, processor specific
  4496. processing must also be performed upon the symbols as well.
  4497. @end ifset
  4498. @node Irp
  4499. @section @code{.irp @var{symbol},@var{values}}@dots{}
  4500. @cindex @code{irp} directive
  4501. Evaluate a sequence of statements assigning different values to @var{symbol}.
  4502. The sequence of statements starts at the @code{.irp} directive, and is
  4503. terminated by an @code{.endr} directive. For each @var{value}, @var{symbol} is
  4504. set to @var{value}, and the sequence of statements is assembled. If no
  4505. @var{value} is listed, the sequence of statements is assembled once, with
  4506. @var{symbol} set to the null string. To refer to @var{symbol} within the
  4507. sequence of statements, use @var{\symbol}.
  4508. For example, assembling
  4509. @example
  4510. .irp param,1,2,3
  4511. move d\param,sp@@-
  4512. .endr
  4513. @end example
  4514. is equivalent to assembling
  4515. @example
  4516. move d1,sp@@-
  4517. move d2,sp@@-
  4518. move d3,sp@@-
  4519. @end example
  4520. For some caveats with the spelling of @var{symbol}, see also @ref{Macro}.
  4521. @node Irpc
  4522. @section @code{.irpc @var{symbol},@var{values}}@dots{}
  4523. @cindex @code{irpc} directive
  4524. Evaluate a sequence of statements assigning different values to @var{symbol}.
  4525. The sequence of statements starts at the @code{.irpc} directive, and is
  4526. terminated by an @code{.endr} directive. For each character in @var{value},
  4527. @var{symbol} is set to the character, and the sequence of statements is
  4528. assembled. If no @var{value} is listed, the sequence of statements is
  4529. assembled once, with @var{symbol} set to the null string. To refer to
  4530. @var{symbol} within the sequence of statements, use @var{\symbol}.
  4531. For example, assembling
  4532. @example
  4533. .irpc param,123
  4534. move d\param,sp@@-
  4535. .endr
  4536. @end example
  4537. is equivalent to assembling
  4538. @example
  4539. move d1,sp@@-
  4540. move d2,sp@@-
  4541. move d3,sp@@-
  4542. @end example
  4543. For some caveats with the spelling of @var{symbol}, see also the discussion
  4544. at @xref{Macro}.
  4545. @node Lcomm
  4546. @section @code{.lcomm @var{symbol} , @var{length}}
  4547. @cindex @code{lcomm} directive
  4548. @cindex local common symbols
  4549. @cindex symbols, local common
  4550. Reserve @var{length} (an absolute expression) bytes for a local common
  4551. denoted by @var{symbol}. The section and value of @var{symbol} are
  4552. those of the new local common. The addresses are allocated in the bss
  4553. section, so that at run-time the bytes start off zeroed. @var{Symbol}
  4554. is not declared global (@pxref{Global,,@code{.global}}), so is normally
  4555. not visible to @code{@value{LD}}.
  4556. @ifset GENERIC
  4557. Some targets permit a third argument to be used with @code{.lcomm}. This
  4558. argument specifies the desired alignment of the symbol in the bss section.
  4559. @end ifset
  4560. @ifset HPPA
  4561. The syntax for @code{.lcomm} differs slightly on the HPPA. The syntax is
  4562. @samp{@var{symbol} .lcomm, @var{length}}; @var{symbol} is optional.
  4563. @end ifset
  4564. @node Lflags
  4565. @section @code{.lflags}
  4566. @cindex @code{lflags} directive (ignored)
  4567. @command{@value{AS}} accepts this directive, for compatibility with other
  4568. assemblers, but ignores it.
  4569. @ifclear no-line-dir
  4570. @node Line
  4571. @section @code{.line @var{line-number}}
  4572. @cindex @code{line} directive
  4573. @cindex logical line number
  4574. @ifset aout-bout
  4575. Change the logical line number. @var{line-number} must be an absolute
  4576. expression. The next line has that logical line number. Therefore any other
  4577. statements on the current line (after a statement separator character) are
  4578. reported as on logical line number @var{line-number} @minus{} 1. One day
  4579. @command{@value{AS}} will no longer support this directive: it is recognized only
  4580. for compatibility with existing assembler programs.
  4581. @end ifset
  4582. Even though this is a directive associated with the @code{a.out} or
  4583. @code{b.out} object-code formats, @command{@value{AS}} still recognizes it
  4584. when producing COFF output, and treats @samp{.line} as though it
  4585. were the COFF @samp{.ln} @emph{if} it is found outside a
  4586. @code{.def}/@code{.endef} pair.
  4587. Inside a @code{.def}, @samp{.line} is, instead, one of the directives
  4588. used by compilers to generate auxiliary symbol information for
  4589. debugging.
  4590. @end ifclear
  4591. @node Linkonce
  4592. @section @code{.linkonce [@var{type}]}
  4593. @cindex COMDAT
  4594. @cindex @code{linkonce} directive
  4595. @cindex common sections
  4596. Mark the current section so that the linker only includes a single copy of it.
  4597. This may be used to include the same section in several different object files,
  4598. but ensure that the linker will only include it once in the final output file.
  4599. The @code{.linkonce} pseudo-op must be used for each instance of the section.
  4600. Duplicate sections are detected based on the section name, so it should be
  4601. unique.
  4602. This directive is only supported by a few object file formats; as of this
  4603. writing, the only object file format which supports it is the Portable
  4604. Executable format used on Windows NT.
  4605. The @var{type} argument is optional. If specified, it must be one of the
  4606. following strings. For example:
  4607. @smallexample
  4608. .linkonce same_size
  4609. @end smallexample
  4610. Not all types may be supported on all object file formats.
  4611. @table @code
  4612. @item discard
  4613. Silently discard duplicate sections. This is the default.
  4614. @item one_only
  4615. Warn if there are duplicate sections, but still keep only one copy.
  4616. @item same_size
  4617. Warn if any of the duplicates have different sizes.
  4618. @item same_contents
  4619. Warn if any of the duplicates do not have exactly the same contents.
  4620. @end table
  4621. @node List
  4622. @section @code{.list}
  4623. @cindex @code{list} directive
  4624. @cindex listing control, turning on
  4625. Control (in conjunction with the @code{.nolist} directive) whether or
  4626. not assembly listings are generated. These two directives maintain an
  4627. internal counter (which is zero initially). @code{.list} increments the
  4628. counter, and @code{.nolist} decrements it. Assembly listings are
  4629. generated whenever the counter is greater than zero.
  4630. By default, listings are disabled. When you enable them (with the
  4631. @samp{-a} command line option; @pxref{Invoking,,Command-Line Options}),
  4632. the initial value of the listing counter is one.
  4633. @node Ln
  4634. @section @code{.ln @var{line-number}}
  4635. @cindex @code{ln} directive
  4636. @ifclear no-line-dir
  4637. @samp{.ln} is a synonym for @samp{.line}.
  4638. @end ifclear
  4639. @ifset no-line-dir
  4640. Tell @command{@value{AS}} to change the logical line number. @var{line-number}
  4641. must be an absolute expression. The next line has that logical
  4642. line number, so any other statements on the current line (after a
  4643. statement separator character @code{;}) are reported as on logical
  4644. line number @var{line-number} @minus{} 1.
  4645. @ifset BOUT
  4646. This directive is accepted, but ignored, when @command{@value{AS}} is
  4647. configured for @code{b.out}; its effect is only associated with COFF
  4648. output format.
  4649. @end ifset
  4650. @end ifset
  4651. @node Loc
  4652. @section @code{.loc @var{fileno} @var{lineno} [@var{column}] [@var{options}]}
  4653. @cindex @code{loc} directive
  4654. When emitting DWARF2 line number information,
  4655. the @code{.loc} directive will add a row to the @code{.debug_line} line
  4656. number matrix corresponding to the immediately following assembly
  4657. instruction. The @var{fileno}, @var{lineno}, and optional @var{column}
  4658. arguments will be applied to the @code{.debug_line} state machine before
  4659. the row is added.
  4660. The @var{options} are a sequence of the following tokens in any order:
  4661. @table @code
  4662. @item basic_block
  4663. This option will set the @code{basic_block} register in the
  4664. @code{.debug_line} state machine to @code{true}.
  4665. @item prologue_end
  4666. This option will set the @code{prologue_end} register in the
  4667. @code{.debug_line} state machine to @code{true}.
  4668. @item epilogue_begin
  4669. This option will set the @code{epilogue_begin} register in the
  4670. @code{.debug_line} state machine to @code{true}.
  4671. @item is_stmt @var{value}
  4672. This option will set the @code{is_stmt} register in the
  4673. @code{.debug_line} state machine to @code{value}, which must be
  4674. either 0 or 1.
  4675. @item isa @var{value}
  4676. This directive will set the @code{isa} register in the @code{.debug_line}
  4677. state machine to @var{value}, which must be an unsigned integer.
  4678. @item discriminator @var{value}
  4679. This directive will set the @code{discriminator} register in the @code{.debug_line}
  4680. state machine to @var{value}, which must be an unsigned integer.
  4681. @end table
  4682. @node Loc_mark_labels
  4683. @section @code{.loc_mark_labels @var{enable}}
  4684. @cindex @code{loc_mark_labels} directive
  4685. When emitting DWARF2 line number information,
  4686. the @code{.loc_mark_labels} directive makes the assembler emit an entry
  4687. to the @code{.debug_line} line number matrix with the @code{basic_block}
  4688. register in the state machine set whenever a code label is seen.
  4689. The @var{enable} argument should be either 1 or 0, to enable or disable
  4690. this function respectively.
  4691. @ifset ELF
  4692. @node Local
  4693. @section @code{.local @var{names}}
  4694. @cindex @code{local} directive
  4695. This directive, which is available for ELF targets, marks each symbol in
  4696. the comma-separated list of @code{names} as a local symbol so that it
  4697. will not be externally visible. If the symbols do not already exist,
  4698. they will be created.
  4699. For targets where the @code{.lcomm} directive (@pxref{Lcomm}) does not
  4700. accept an alignment argument, which is the case for most ELF targets,
  4701. the @code{.local} directive can be used in combination with @code{.comm}
  4702. (@pxref{Comm}) to define aligned local common data.
  4703. @end ifset
  4704. @node Long
  4705. @section @code{.long @var{expressions}}
  4706. @cindex @code{long} directive
  4707. @code{.long} is the same as @samp{.int}. @xref{Int,,@code{.int}}.
  4708. @ignore
  4709. @c no one seems to know what this is for or whether this description is
  4710. @c what it really ought to do
  4711. @node Lsym
  4712. @section @code{.lsym @var{symbol}, @var{expression}}
  4713. @cindex @code{lsym} directive
  4714. @cindex symbol, not referenced in assembly
  4715. @code{.lsym} creates a new symbol named @var{symbol}, but does not put it in
  4716. the hash table, ensuring it cannot be referenced by name during the
  4717. rest of the assembly. This sets the attributes of the symbol to be
  4718. the same as the expression value:
  4719. @smallexample
  4720. @var{other} = @var{descriptor} = 0
  4721. @var{type} = @r{(section of @var{expression})}
  4722. @var{value} = @var{expression}
  4723. @end smallexample
  4724. @noindent
  4725. The new symbol is not flagged as external.
  4726. @end ignore
  4727. @node Macro
  4728. @section @code{.macro}
  4729. @cindex macros
  4730. The commands @code{.macro} and @code{.endm} allow you to define macros that
  4731. generate assembly output. For example, this definition specifies a macro
  4732. @code{sum} that puts a sequence of numbers into memory:
  4733. @example
  4734. .macro sum from=0, to=5
  4735. .long \from
  4736. .if \to-\from
  4737. sum "(\from+1)",\to
  4738. .endif
  4739. .endm
  4740. @end example
  4741. @noindent
  4742. With that definition, @samp{SUM 0,5} is equivalent to this assembly input:
  4743. @example
  4744. .long 0
  4745. .long 1
  4746. .long 2
  4747. .long 3
  4748. .long 4
  4749. .long 5
  4750. @end example
  4751. @ftable @code
  4752. @item .macro @var{macname}
  4753. @itemx .macro @var{macname} @var{macargs} @dots{}
  4754. @cindex @code{macro} directive
  4755. Begin the definition of a macro called @var{macname}. If your macro
  4756. definition requires arguments, specify their names after the macro name,
  4757. separated by commas or spaces. You can qualify the macro argument to
  4758. indicate whether all invocations must specify a non-blank value (through
  4759. @samp{:@code{req}}), or whether it takes all of the remaining arguments
  4760. (through @samp{:@code{vararg}}). You can supply a default value for any
  4761. macro argument by following the name with @samp{=@var{deflt}}. You
  4762. cannot define two macros with the same @var{macname} unless it has been
  4763. subject to the @code{.purgem} directive (@pxref{Purgem}) between the two
  4764. definitions. For example, these are all valid @code{.macro} statements:
  4765. @table @code
  4766. @item .macro comm
  4767. Begin the definition of a macro called @code{comm}, which takes no
  4768. arguments.
  4769. @item .macro plus1 p, p1
  4770. @itemx .macro plus1 p p1
  4771. Either statement begins the definition of a macro called @code{plus1},
  4772. which takes two arguments; within the macro definition, write
  4773. @samp{\p} or @samp{\p1} to evaluate the arguments.
  4774. @item .macro reserve_str p1=0 p2
  4775. Begin the definition of a macro called @code{reserve_str}, with two
  4776. arguments. The first argument has a default value, but not the second.
  4777. After the definition is complete, you can call the macro either as
  4778. @samp{reserve_str @var{a},@var{b}} (with @samp{\p1} evaluating to
  4779. @var{a} and @samp{\p2} evaluating to @var{b}), or as @samp{reserve_str
  4780. ,@var{b}} (with @samp{\p1} evaluating as the default, in this case
  4781. @samp{0}, and @samp{\p2} evaluating to @var{b}).
  4782. @item .macro m p1:req, p2=0, p3:vararg
  4783. Begin the definition of a macro called @code{m}, with at least three
  4784. arguments. The first argument must always have a value specified, but
  4785. not the second, which instead has a default value. The third formal
  4786. will get assigned all remaining arguments specified at invocation time.
  4787. When you call a macro, you can specify the argument values either by
  4788. position, or by keyword. For example, @samp{sum 9,17} is equivalent to
  4789. @samp{sum to=17, from=9}.
  4790. @end table
  4791. Note that since each of the @var{macargs} can be an identifier exactly
  4792. as any other one permitted by the target architecture, there may be
  4793. occasional problems if the target hand-crafts special meanings to certain
  4794. characters when they occur in a special position. For example, if the colon
  4795. (@code{:}) is generally permitted to be part of a symbol name, but the
  4796. architecture specific code special-cases it when occurring as the final
  4797. character of a symbol (to denote a label), then the macro parameter
  4798. replacement code will have no way of knowing that and consider the whole
  4799. construct (including the colon) an identifier, and check only this
  4800. identifier for being the subject to parameter substitution. So for example
  4801. this macro definition:
  4802. @example
  4803. .macro label l
  4804. \l:
  4805. .endm
  4806. @end example
  4807. might not work as expected. Invoking @samp{label foo} might not create a label
  4808. called @samp{foo} but instead just insert the text @samp{\l:} into the
  4809. assembler source, probably generating an error about an unrecognised
  4810. identifier.
  4811. Similarly problems might occur with the period character (@samp{.})
  4812. which is often allowed inside opcode names (and hence identifier names). So
  4813. for example constructing a macro to build an opcode from a base name and a
  4814. length specifier like this:
  4815. @example
  4816. .macro opcode base length
  4817. \base.\length
  4818. .endm
  4819. @end example
  4820. and invoking it as @samp{opcode store l} will not create a @samp{store.l}
  4821. instruction but instead generate some kind of error as the assembler tries to
  4822. interpret the text @samp{\base.\length}.
  4823. There are several possible ways around this problem:
  4824. @table @code
  4825. @item Insert white space
  4826. If it is possible to use white space characters then this is the simplest
  4827. solution. eg:
  4828. @example
  4829. .macro label l
  4830. \l :
  4831. .endm
  4832. @end example
  4833. @item Use @samp{\()}
  4834. The string @samp{\()} can be used to separate the end of a macro argument from
  4835. the following text. eg:
  4836. @example
  4837. .macro opcode base length
  4838. \base\().\length
  4839. .endm
  4840. @end example
  4841. @item Use the alternate macro syntax mode
  4842. In the alternative macro syntax mode the ampersand character (@samp{&}) can be
  4843. used as a separator. eg:
  4844. @example
  4845. .altmacro
  4846. .macro label l
  4847. l&:
  4848. .endm
  4849. @end example
  4850. @end table
  4851. Note: this problem of correctly identifying string parameters to pseudo ops
  4852. also applies to the identifiers used in @code{.irp} (@pxref{Irp})
  4853. and @code{.irpc} (@pxref{Irpc}) as well.
  4854. @item .endm
  4855. @cindex @code{endm} directive
  4856. Mark the end of a macro definition.
  4857. @item .exitm
  4858. @cindex @code{exitm} directive
  4859. Exit early from the current macro definition.
  4860. @cindex number of macros executed
  4861. @cindex macros, count executed
  4862. @item \@@
  4863. @command{@value{AS}} maintains a counter of how many macros it has
  4864. executed in this pseudo-variable; you can copy that number to your
  4865. output with @samp{\@@}, but @emph{only within a macro definition}.
  4866. @item LOCAL @var{name} [ , @dots{} ]
  4867. @emph{Warning: @code{LOCAL} is only available if you select ``alternate
  4868. macro syntax'' with @samp{--alternate} or @code{.altmacro}.}
  4869. @xref{Altmacro,,@code{.altmacro}}.
  4870. @end ftable
  4871. @node MRI
  4872. @section @code{.mri @var{val}}
  4873. @cindex @code{mri} directive
  4874. @cindex MRI mode, temporarily
  4875. If @var{val} is non-zero, this tells @command{@value{AS}} to enter MRI mode. If
  4876. @var{val} is zero, this tells @command{@value{AS}} to exit MRI mode. This change
  4877. affects code assembled until the next @code{.mri} directive, or until the end
  4878. of the file. @xref{M, MRI mode, MRI mode}.
  4879. @node Noaltmacro
  4880. @section @code{.noaltmacro}
  4881. Disable alternate macro mode. @xref{Altmacro}.
  4882. @node Nolist
  4883. @section @code{.nolist}
  4884. @cindex @code{nolist} directive
  4885. @cindex listing control, turning off
  4886. Control (in conjunction with the @code{.list} directive) whether or
  4887. not assembly listings are generated. These two directives maintain an
  4888. internal counter (which is zero initially). @code{.list} increments the
  4889. counter, and @code{.nolist} decrements it. Assembly listings are
  4890. generated whenever the counter is greater than zero.
  4891. @node Octa
  4892. @section @code{.octa @var{bignums}}
  4893. @c FIXME: double size emitted for "octa" on i960, others? Or warn?
  4894. @cindex @code{octa} directive
  4895. @cindex integer, 16-byte
  4896. @cindex sixteen byte integer
  4897. This directive expects zero or more bignums, separated by commas. For each
  4898. bignum, it emits a 16-byte integer.
  4899. The term ``octa'' comes from contexts in which a ``word'' is two bytes;
  4900. hence @emph{octa}-word for 16 bytes.
  4901. @node Offset
  4902. @section @code{.offset @var{loc}}
  4903. @cindex @code{offset} directive
  4904. Set the location counter to @var{loc} in the absolute section. @var{loc} must
  4905. be an absolute expression. This directive may be useful for defining
  4906. symbols with absolute values. Do not confuse it with the @code{.org}
  4907. directive.
  4908. @node Org
  4909. @section @code{.org @var{new-lc} , @var{fill}}
  4910. @cindex @code{org} directive
  4911. @cindex location counter, advancing
  4912. @cindex advancing location counter
  4913. @cindex current address, advancing
  4914. Advance the location counter of the current section to
  4915. @var{new-lc}. @var{new-lc} is either an absolute expression or an
  4916. expression with the same section as the current subsection. That is,
  4917. you can't use @code{.org} to cross sections: if @var{new-lc} has the
  4918. wrong section, the @code{.org} directive is ignored. To be compatible
  4919. with former assemblers, if the section of @var{new-lc} is absolute,
  4920. @command{@value{AS}} issues a warning, then pretends the section of @var{new-lc}
  4921. is the same as the current subsection.
  4922. @code{.org} may only increase the location counter, or leave it
  4923. unchanged; you cannot use @code{.org} to move the location counter
  4924. backwards.
  4925. @c double negative used below "not undefined" because this is a specific
  4926. @c reference to "undefined" (as SEG_UNKNOWN is called in this manual)
  4927. @c section. doc@cygnus.com 18feb91
  4928. Because @command{@value{AS}} tries to assemble programs in one pass, @var{new-lc}
  4929. may not be undefined. If you really detest this restriction we eagerly await
  4930. a chance to share your improved assembler.
  4931. Beware that the origin is relative to the start of the section, not
  4932. to the start of the subsection. This is compatible with other
  4933. people's assemblers.
  4934. When the location counter (of the current subsection) is advanced, the
  4935. intervening bytes are filled with @var{fill} which should be an
  4936. absolute expression. If the comma and @var{fill} are omitted,
  4937. @var{fill} defaults to zero.
  4938. @node P2align
  4939. @section @code{.p2align[wl] @var{abs-expr}, @var{abs-expr}, @var{abs-expr}}
  4940. @cindex padding the location counter given a power of two
  4941. @cindex @code{p2align} directive
  4942. Pad the location counter (in the current subsection) to a particular
  4943. storage boundary. The first expression (which must be absolute) is the
  4944. number of low-order zero bits the location counter must have after
  4945. advancement. For example @samp{.p2align 3} advances the location
  4946. counter until it a multiple of 8. If the location counter is already a
  4947. multiple of 8, no change is needed.
  4948. The second expression (also absolute) gives the fill value to be stored in the
  4949. padding bytes. It (and the comma) may be omitted. If it is omitted, the
  4950. padding bytes are normally zero. However, on some systems, if the section is
  4951. marked as containing code and the fill value is omitted, the space is filled
  4952. with no-op instructions.
  4953. The third expression is also absolute, and is also optional. If it is present,
  4954. it is the maximum number of bytes that should be skipped by this alignment
  4955. directive. If doing the alignment would require skipping more bytes than the
  4956. specified maximum, then the alignment is not done at all. You can omit the
  4957. fill value (the second argument) entirely by simply using two commas after the
  4958. required alignment; this can be useful if you want the alignment to be filled
  4959. with no-op instructions when appropriate.
  4960. @cindex @code{p2alignw} directive
  4961. @cindex @code{p2alignl} directive
  4962. The @code{.p2alignw} and @code{.p2alignl} directives are variants of the
  4963. @code{.p2align} directive. The @code{.p2alignw} directive treats the fill
  4964. pattern as a two byte word value. The @code{.p2alignl} directives treats the
  4965. fill pattern as a four byte longword value. For example, @code{.p2alignw
  4966. 2,0x368d} will align to a multiple of 4. If it skips two bytes, they will be
  4967. filled in with the value 0x368d (the exact placement of the bytes depends upon
  4968. the endianness of the processor). If it skips 1 or 3 bytes, the fill value is
  4969. undefined.
  4970. @ifset ELF
  4971. @node PopSection
  4972. @section @code{.popsection}
  4973. @cindex @code{popsection} directive
  4974. @cindex Section Stack
  4975. This is one of the ELF section stack manipulation directives. The others are
  4976. @code{.section} (@pxref{Section}), @code{.subsection} (@pxref{SubSection}),
  4977. @code{.pushsection} (@pxref{PushSection}), and @code{.previous}
  4978. (@pxref{Previous}).
  4979. This directive replaces the current section (and subsection) with the top
  4980. section (and subsection) on the section stack. This section is popped off the
  4981. stack.
  4982. @end ifset
  4983. @ifset ELF
  4984. @node Previous
  4985. @section @code{.previous}
  4986. @cindex @code{previous} directive
  4987. @cindex Section Stack
  4988. This is one of the ELF section stack manipulation directives. The others are
  4989. @code{.section} (@pxref{Section}), @code{.subsection} (@pxref{SubSection}),
  4990. @code{.pushsection} (@pxref{PushSection}), and @code{.popsection}
  4991. (@pxref{PopSection}).
  4992. This directive swaps the current section (and subsection) with most recently
  4993. referenced section/subsection pair prior to this one. Multiple
  4994. @code{.previous} directives in a row will flip between two sections (and their
  4995. subsections). For example:
  4996. @smallexample
  4997. .section A
  4998. .subsection 1
  4999. .word 0x1234
  5000. .subsection 2
  5001. .word 0x5678
  5002. .previous
  5003. .word 0x9abc
  5004. @end smallexample
  5005. Will place 0x1234 and 0x9abc into subsection 1 and 0x5678 into subsection 2 of
  5006. section A. Whilst:
  5007. @smallexample
  5008. .section A
  5009. .subsection 1
  5010. # Now in section A subsection 1
  5011. .word 0x1234
  5012. .section B
  5013. .subsection 0
  5014. # Now in section B subsection 0
  5015. .word 0x5678
  5016. .subsection 1
  5017. # Now in section B subsection 1
  5018. .word 0x9abc
  5019. .previous
  5020. # Now in section B subsection 0
  5021. .word 0xdef0
  5022. @end smallexample
  5023. Will place 0x1234 into section A, 0x5678 and 0xdef0 into subsection 0 of
  5024. section B and 0x9abc into subsection 1 of section B.
  5025. In terms of the section stack, this directive swaps the current section with
  5026. the top section on the section stack.
  5027. @end ifset
  5028. @node Print
  5029. @section @code{.print @var{string}}
  5030. @cindex @code{print} directive
  5031. @command{@value{AS}} will print @var{string} on the standard output during
  5032. assembly. You must put @var{string} in double quotes.
  5033. @ifset ELF
  5034. @node Protected
  5035. @section @code{.protected @var{names}}
  5036. @cindex @code{protected} directive
  5037. @cindex visibility
  5038. This is one of the ELF visibility directives. The other two are
  5039. @code{.hidden} (@pxref{Hidden}) and @code{.internal} (@pxref{Internal}).
  5040. This directive overrides the named symbols default visibility (which is set by
  5041. their binding: local, global or weak). The directive sets the visibility to
  5042. @code{protected} which means that any references to the symbols from within the
  5043. components that defines them must be resolved to the definition in that
  5044. component, even if a definition in another component would normally preempt
  5045. this.
  5046. @end ifset
  5047. @node Psize
  5048. @section @code{.psize @var{lines} , @var{columns}}
  5049. @cindex @code{psize} directive
  5050. @cindex listing control: paper size
  5051. @cindex paper size, for listings
  5052. Use this directive to declare the number of lines---and, optionally, the
  5053. number of columns---to use for each page, when generating listings.
  5054. If you do not use @code{.psize}, listings use a default line-count
  5055. of 60. You may omit the comma and @var{columns} specification; the
  5056. default width is 200 columns.
  5057. @command{@value{AS}} generates formfeeds whenever the specified number of
  5058. lines is exceeded (or whenever you explicitly request one, using
  5059. @code{.eject}).
  5060. If you specify @var{lines} as @code{0}, no formfeeds are generated save
  5061. those explicitly specified with @code{.eject}.
  5062. @node Purgem
  5063. @section @code{.purgem @var{name}}
  5064. @cindex @code{purgem} directive
  5065. Undefine the macro @var{name}, so that later uses of the string will not be
  5066. expanded. @xref{Macro}.
  5067. @ifset ELF
  5068. @node PushSection
  5069. @section @code{.pushsection @var{name} [, @var{subsection}] [, "@var{flags}"[, @@@var{type}[,@var{arguments}]]]}
  5070. @cindex @code{pushsection} directive
  5071. @cindex Section Stack
  5072. This is one of the ELF section stack manipulation directives. The others are
  5073. @code{.section} (@pxref{Section}), @code{.subsection} (@pxref{SubSection}),
  5074. @code{.popsection} (@pxref{PopSection}), and @code{.previous}
  5075. (@pxref{Previous}).
  5076. This directive pushes the current section (and subsection) onto the
  5077. top of the section stack, and then replaces the current section and
  5078. subsection with @code{name} and @code{subsection}. The optional
  5079. @code{flags}, @code{type} and @code{arguments} are treated the same
  5080. as in the @code{.section} (@pxref{Section}) directive.
  5081. @end ifset
  5082. @node Quad
  5083. @section @code{.quad @var{bignums}}
  5084. @cindex @code{quad} directive
  5085. @code{.quad} expects zero or more bignums, separated by commas. For
  5086. each bignum, it emits
  5087. @ifclear bignum-16
  5088. an 8-byte integer. If the bignum won't fit in 8 bytes, it prints a
  5089. warning message; and just takes the lowest order 8 bytes of the bignum.
  5090. @cindex eight-byte integer
  5091. @cindex integer, 8-byte
  5092. The term ``quad'' comes from contexts in which a ``word'' is two bytes;
  5093. hence @emph{quad}-word for 8 bytes.
  5094. @end ifclear
  5095. @ifset bignum-16
  5096. a 16-byte integer. If the bignum won't fit in 16 bytes, it prints a
  5097. warning message; and just takes the lowest order 16 bytes of the bignum.
  5098. @cindex sixteen-byte integer
  5099. @cindex integer, 16-byte
  5100. @end ifset
  5101. @node Reloc
  5102. @section @code{.reloc @var{offset}, @var{reloc_name}[, @var{expression}]}
  5103. @cindex @code{reloc} directive
  5104. Generate a relocation at @var{offset} of type @var{reloc_name} with value
  5105. @var{expression}. If @var{offset} is a number, the relocation is generated in
  5106. the current section. If @var{offset} is an expression that resolves to a
  5107. symbol plus offset, the relocation is generated in the given symbol's section.
  5108. @var{expression}, if present, must resolve to a symbol plus addend or to an
  5109. absolute value, but note that not all targets support an addend. e.g. ELF REL
  5110. targets such as i386 store an addend in the section contents rather than in the
  5111. relocation. This low level interface does not support addends stored in the
  5112. section.
  5113. @node Rept
  5114. @section @code{.rept @var{count}}
  5115. @cindex @code{rept} directive
  5116. Repeat the sequence of lines between the @code{.rept} directive and the next
  5117. @code{.endr} directive @var{count} times.
  5118. For example, assembling
  5119. @example
  5120. .rept 3
  5121. .long 0
  5122. .endr
  5123. @end example
  5124. is equivalent to assembling
  5125. @example
  5126. .long 0
  5127. .long 0
  5128. .long 0
  5129. @end example
  5130. @node Sbttl
  5131. @section @code{.sbttl "@var{subheading}"}
  5132. @cindex @code{sbttl} directive
  5133. @cindex subtitles for listings
  5134. @cindex listing control: subtitle
  5135. Use @var{subheading} as the title (third line, immediately after the
  5136. title line) when generating assembly listings.
  5137. This directive affects subsequent pages, as well as the current page if
  5138. it appears within ten lines of the top of a page.
  5139. @ifset COFF
  5140. @node Scl
  5141. @section @code{.scl @var{class}}
  5142. @cindex @code{scl} directive
  5143. @cindex symbol storage class (COFF)
  5144. @cindex COFF symbol storage class
  5145. Set the storage-class value for a symbol. This directive may only be
  5146. used inside a @code{.def}/@code{.endef} pair. Storage class may flag
  5147. whether a symbol is static or external, or it may record further
  5148. symbolic debugging information.
  5149. @ifset BOUT
  5150. The @samp{.scl} directive is primarily associated with COFF output; when
  5151. configured to generate @code{b.out} output format, @command{@value{AS}}
  5152. accepts this directive but ignores it.
  5153. @end ifset
  5154. @end ifset
  5155. @ifset COFF-ELF
  5156. @node Section
  5157. @section @code{.section @var{name}}
  5158. @cindex named section
  5159. Use the @code{.section} directive to assemble the following code into a section
  5160. named @var{name}.
  5161. This directive is only supported for targets that actually support arbitrarily
  5162. named sections; on @code{a.out} targets, for example, it is not accepted, even
  5163. with a standard @code{a.out} section name.
  5164. @ifset COFF
  5165. @ifset ELF
  5166. @c only print the extra heading if both COFF and ELF are set
  5167. @subheading COFF Version
  5168. @end ifset
  5169. @cindex @code{section} directive (COFF version)
  5170. For COFF targets, the @code{.section} directive is used in one of the following
  5171. ways:
  5172. @smallexample
  5173. .section @var{name}[, "@var{flags}"]
  5174. .section @var{name}[, @var{subsection}]
  5175. @end smallexample
  5176. If the optional argument is quoted, it is taken as flags to use for the
  5177. section. Each flag is a single character. The following flags are recognized:
  5178. @table @code
  5179. @item b
  5180. bss section (uninitialized data)
  5181. @item n
  5182. section is not loaded
  5183. @item w
  5184. writable section
  5185. @item d
  5186. data section
  5187. @item e
  5188. exclude section from linking
  5189. @item r
  5190. read-only section
  5191. @item x
  5192. executable section
  5193. @item s
  5194. shared section (meaningful for PE targets)
  5195. @item a
  5196. ignored. (For compatibility with the ELF version)
  5197. @item y
  5198. section is not readable (meaningful for PE targets)
  5199. @item 0-9
  5200. single-digit power-of-two section alignment (GNU extension)
  5201. @end table
  5202. If no flags are specified, the default flags depend upon the section name. If
  5203. the section name is not recognized, the default will be for the section to be
  5204. loaded and writable. Note the @code{n} and @code{w} flags remove attributes
  5205. from the section, rather than adding them, so if they are used on their own it
  5206. will be as if no flags had been specified at all.
  5207. If the optional argument to the @code{.section} directive is not quoted, it is
  5208. taken as a subsection number (@pxref{Sub-Sections}).
  5209. @end ifset
  5210. @ifset ELF
  5211. @ifset COFF
  5212. @c only print the extra heading if both COFF and ELF are set
  5213. @subheading ELF Version
  5214. @end ifset
  5215. @cindex Section Stack
  5216. This is one of the ELF section stack manipulation directives. The others are
  5217. @code{.subsection} (@pxref{SubSection}), @code{.pushsection}
  5218. (@pxref{PushSection}), @code{.popsection} (@pxref{PopSection}), and
  5219. @code{.previous} (@pxref{Previous}).
  5220. @cindex @code{section} directive (ELF version)
  5221. For ELF targets, the @code{.section} directive is used like this:
  5222. @smallexample
  5223. .section @var{name} [, "@var{flags}"[, @@@var{type}[,@var{flag_specific_arguments}]]]
  5224. @end smallexample
  5225. @anchor{Section Name Substitutions}
  5226. @kindex --sectname-subst
  5227. @cindex section name substitution
  5228. If the @samp{--sectname-subst} command-line option is provided, the @var{name}
  5229. argument may contain a substitution sequence. Only @code{%S} is supported
  5230. at the moment, and substitutes the current section name. For example:
  5231. @smallexample
  5232. .macro exception_code
  5233. .section %S.exception
  5234. [exception code here]
  5235. .previous
  5236. .endm
  5237. .text
  5238. [code]
  5239. exception_code
  5240. [...]
  5241. .section .init
  5242. [init code]
  5243. exception_code
  5244. [...]
  5245. @end smallexample
  5246. The two @code{exception_code} invocations above would create the
  5247. @code{.text.exception} and @code{.init.exception} sections respectively.
  5248. This is useful e.g. to discriminate between anciliary sections that are
  5249. tied to setup code to be discarded after use from anciliary sections that
  5250. need to stay resident without having to define multiple @code{exception_code}
  5251. macros just for that purpose.
  5252. The optional @var{flags} argument is a quoted string which may contain any
  5253. combination of the following characters:
  5254. @table @code
  5255. @item a
  5256. section is allocatable
  5257. @item e
  5258. section is excluded from executable and shared library.
  5259. @item w
  5260. section is writable
  5261. @item x
  5262. section is executable
  5263. @item M
  5264. section is mergeable
  5265. @item S
  5266. section contains zero terminated strings
  5267. @item G
  5268. section is a member of a section group
  5269. @item T
  5270. section is used for thread-local-storage
  5271. @item ?
  5272. section is a member of the previously-current section's group, if any
  5273. @end table
  5274. The optional @var{type} argument may contain one of the following constants:
  5275. @table @code
  5276. @item @@progbits
  5277. section contains data
  5278. @item @@nobits
  5279. section does not contain data (i.e., section only occupies space)
  5280. @item @@note
  5281. section contains data which is used by things other than the program
  5282. @item @@init_array
  5283. section contains an array of pointers to init functions
  5284. @item @@fini_array
  5285. section contains an array of pointers to finish functions
  5286. @item @@preinit_array
  5287. section contains an array of pointers to pre-init functions
  5288. @end table
  5289. Many targets only support the first three section types.
  5290. Note on targets where the @code{@@} character is the start of a comment (eg
  5291. ARM) then another character is used instead. For example the ARM port uses the
  5292. @code{%} character.
  5293. If @var{flags} contains the @code{M} symbol then the @var{type} argument must
  5294. be specified as well as an extra argument---@var{entsize}---like this:
  5295. @smallexample
  5296. .section @var{name} , "@var{flags}"M, @@@var{type}, @var{entsize}
  5297. @end smallexample
  5298. Sections with the @code{M} flag but not @code{S} flag must contain fixed size
  5299. constants, each @var{entsize} octets long. Sections with both @code{M} and
  5300. @code{S} must contain zero terminated strings where each character is
  5301. @var{entsize} bytes long. The linker may remove duplicates within sections with
  5302. the same name, same entity size and same flags. @var{entsize} must be an
  5303. absolute expression. For sections with both @code{M} and @code{S}, a string
  5304. which is a suffix of a larger string is considered a duplicate. Thus
  5305. @code{"def"} will be merged with @code{"abcdef"}; A reference to the first
  5306. @code{"def"} will be changed to a reference to @code{"abcdef"+3}.
  5307. If @var{flags} contains the @code{G} symbol then the @var{type} argument must
  5308. be present along with an additional field like this:
  5309. @smallexample
  5310. .section @var{name} , "@var{flags}"G, @@@var{type}, @var{GroupName}[, @var{linkage}]
  5311. @end smallexample
  5312. The @var{GroupName} field specifies the name of the section group to which this
  5313. particular section belongs. The optional linkage field can contain:
  5314. @table @code
  5315. @item comdat
  5316. indicates that only one copy of this section should be retained
  5317. @item .gnu.linkonce
  5318. an alias for comdat
  5319. @end table
  5320. Note: if both the @var{M} and @var{G} flags are present then the fields for
  5321. the Merge flag should come first, like this:
  5322. @smallexample
  5323. .section @var{name} , "@var{flags}"MG, @@@var{type}, @var{entsize}, @var{GroupName}[, @var{linkage}]
  5324. @end smallexample
  5325. If @var{flags} contains the @code{?} symbol then it may not also contain the
  5326. @code{G} symbol and the @var{GroupName} or @var{linkage} fields should not be
  5327. present. Instead, @code{?} says to consider the section that's current before
  5328. this directive. If that section used @code{G}, then the new section will use
  5329. @code{G} with those same @var{GroupName} and @var{linkage} fields implicitly.
  5330. If not, then the @code{?} symbol has no effect.
  5331. If no flags are specified, the default flags depend upon the section name. If
  5332. the section name is not recognized, the default will be for the section to have
  5333. none of the above flags: it will not be allocated in memory, nor writable, nor
  5334. executable. The section will contain data.
  5335. For ELF targets, the assembler supports another type of @code{.section}
  5336. directive for compatibility with the Solaris assembler:
  5337. @smallexample
  5338. .section "@var{name}"[, @var{flags}...]
  5339. @end smallexample
  5340. Note that the section name is quoted. There may be a sequence of comma
  5341. separated flags:
  5342. @table @code
  5343. @item #alloc
  5344. section is allocatable
  5345. @item #write
  5346. section is writable
  5347. @item #execinstr
  5348. section is executable
  5349. @item #exclude
  5350. section is excluded from executable and shared library.
  5351. @item #tls
  5352. section is used for thread local storage
  5353. @end table
  5354. This directive replaces the current section and subsection. See the
  5355. contents of the gas testsuite directory @code{gas/testsuite/gas/elf} for
  5356. some examples of how this directive and the other section stack directives
  5357. work.
  5358. @end ifset
  5359. @end ifset
  5360. @node Set
  5361. @section @code{.set @var{symbol}, @var{expression}}
  5362. @cindex @code{set} directive
  5363. @cindex symbol value, setting
  5364. Set the value of @var{symbol} to @var{expression}. This
  5365. changes @var{symbol}'s value and type to conform to
  5366. @var{expression}. If @var{symbol} was flagged as external, it remains
  5367. flagged (@pxref{Symbol Attributes}).
  5368. You may @code{.set} a symbol many times in the same assembly provided that the
  5369. values given to the symbol are constants. Values that are based on expressions
  5370. involving other symbols are allowed, but some targets may restrict this to only
  5371. being done once per assembly. This is because those targets do not set the
  5372. addresses of symbols at assembly time, but rather delay the assignment until a
  5373. final link is performed. This allows the linker a chance to change the code in
  5374. the files, changing the location of, and the relative distance between, various
  5375. different symbols.
  5376. If you @code{.set} a global symbol, the value stored in the object
  5377. file is the last value stored into it.
  5378. @ifset Z80
  5379. On Z80 @code{set} is a real instruction, use
  5380. @samp{@var{symbol} defl @var{expression}} instead.
  5381. @end ifset
  5382. @node Short
  5383. @section @code{.short @var{expressions}}
  5384. @cindex @code{short} directive
  5385. @ifset GENERIC
  5386. @code{.short} is normally the same as @samp{.word}.
  5387. @xref{Word,,@code{.word}}.
  5388. In some configurations, however, @code{.short} and @code{.word} generate
  5389. numbers of different lengths. @xref{Machine Dependencies}.
  5390. @end ifset
  5391. @ifclear GENERIC
  5392. @ifset W16
  5393. @code{.short} is the same as @samp{.word}. @xref{Word,,@code{.word}}.
  5394. @end ifset
  5395. @ifset W32
  5396. This expects zero or more @var{expressions}, and emits
  5397. a 16 bit number for each.
  5398. @end ifset
  5399. @end ifclear
  5400. @node Single
  5401. @section @code{.single @var{flonums}}
  5402. @cindex @code{single} directive
  5403. @cindex floating point numbers (single)
  5404. This directive assembles zero or more flonums, separated by commas. It
  5405. has the same effect as @code{.float}.
  5406. @ifset GENERIC
  5407. The exact kind of floating point numbers emitted depends on how
  5408. @command{@value{AS}} is configured. @xref{Machine Dependencies}.
  5409. @end ifset
  5410. @ifclear GENERIC
  5411. @ifset IEEEFLOAT
  5412. On the @value{TARGET} family, @code{.single} emits 32-bit floating point
  5413. numbers in @sc{ieee} format.
  5414. @end ifset
  5415. @end ifclear
  5416. @ifset COFF-ELF
  5417. @node Size
  5418. @section @code{.size}
  5419. This directive is used to set the size associated with a symbol.
  5420. @ifset COFF
  5421. @ifset ELF
  5422. @c only print the extra heading if both COFF and ELF are set
  5423. @subheading COFF Version
  5424. @end ifset
  5425. @cindex @code{size} directive (COFF version)
  5426. For COFF targets, the @code{.size} directive is only permitted inside
  5427. @code{.def}/@code{.endef} pairs. It is used like this:
  5428. @smallexample
  5429. .size @var{expression}
  5430. @end smallexample
  5431. @ifset BOUT
  5432. @samp{.size} is only meaningful when generating COFF format output; when
  5433. @command{@value{AS}} is generating @code{b.out}, it accepts this directive but
  5434. ignores it.
  5435. @end ifset
  5436. @end ifset
  5437. @ifset ELF
  5438. @ifset COFF
  5439. @c only print the extra heading if both COFF and ELF are set
  5440. @subheading ELF Version
  5441. @end ifset
  5442. @cindex @code{size} directive (ELF version)
  5443. For ELF targets, the @code{.size} directive is used like this:
  5444. @smallexample
  5445. .size @var{name} , @var{expression}
  5446. @end smallexample
  5447. This directive sets the size associated with a symbol @var{name}.
  5448. The size in bytes is computed from @var{expression} which can make use of label
  5449. arithmetic. This directive is typically used to set the size of function
  5450. symbols.
  5451. @end ifset
  5452. @end ifset
  5453. @ifclear no-space-dir
  5454. @node Skip
  5455. @section @code{.skip @var{size} , @var{fill}}
  5456. @cindex @code{skip} directive
  5457. @cindex filling memory
  5458. This directive emits @var{size} bytes, each of value @var{fill}. Both
  5459. @var{size} and @var{fill} are absolute expressions. If the comma and
  5460. @var{fill} are omitted, @var{fill} is assumed to be zero. This is the same as
  5461. @samp{.space}.
  5462. @end ifclear
  5463. @node Sleb128
  5464. @section @code{.sleb128 @var{expressions}}
  5465. @cindex @code{sleb128} directive
  5466. @var{sleb128} stands for ``signed little endian base 128.'' This is a
  5467. compact, variable length representation of numbers used by the DWARF
  5468. symbolic debugging format. @xref{Uleb128, ,@code{.uleb128}}.
  5469. @ifclear no-space-dir
  5470. @node Space
  5471. @section @code{.space @var{size} , @var{fill}}
  5472. @cindex @code{space} directive
  5473. @cindex filling memory
  5474. This directive emits @var{size} bytes, each of value @var{fill}. Both
  5475. @var{size} and @var{fill} are absolute expressions. If the comma
  5476. and @var{fill} are omitted, @var{fill} is assumed to be zero. This is the same
  5477. as @samp{.skip}.
  5478. @ifset HPPA
  5479. @quotation
  5480. @emph{Warning:} @code{.space} has a completely different meaning for HPPA
  5481. targets; use @code{.block} as a substitute. See @cite{HP9000 Series 800
  5482. Assembly Language Reference Manual} (HP 92432-90001) for the meaning of the
  5483. @code{.space} directive. @xref{HPPA Directives,,HPPA Assembler Directives},
  5484. for a summary.
  5485. @end quotation
  5486. @end ifset
  5487. @end ifclear
  5488. @ifset have-stabs
  5489. @node Stab
  5490. @section @code{.stabd, .stabn, .stabs}
  5491. @cindex symbolic debuggers, information for
  5492. @cindex @code{stab@var{x}} directives
  5493. There are three directives that begin @samp{.stab}.
  5494. All emit symbols (@pxref{Symbols}), for use by symbolic debuggers.
  5495. The symbols are not entered in the @command{@value{AS}} hash table: they
  5496. cannot be referenced elsewhere in the source file.
  5497. Up to five fields are required:
  5498. @table @var
  5499. @item string
  5500. This is the symbol's name. It may contain any character except
  5501. @samp{\000}, so is more general than ordinary symbol names. Some
  5502. debuggers used to code arbitrarily complex structures into symbol names
  5503. using this field.
  5504. @item type
  5505. An absolute expression. The symbol's type is set to the low 8 bits of
  5506. this expression. Any bit pattern is permitted, but @code{@value{LD}}
  5507. and debuggers choke on silly bit patterns.
  5508. @item other
  5509. An absolute expression. The symbol's ``other'' attribute is set to the
  5510. low 8 bits of this expression.
  5511. @item desc
  5512. An absolute expression. The symbol's descriptor is set to the low 16
  5513. bits of this expression.
  5514. @item value
  5515. An absolute expression which becomes the symbol's value.
  5516. @end table
  5517. If a warning is detected while reading a @code{.stabd}, @code{.stabn},
  5518. or @code{.stabs} statement, the symbol has probably already been created;
  5519. you get a half-formed symbol in your object file. This is
  5520. compatible with earlier assemblers!
  5521. @table @code
  5522. @cindex @code{stabd} directive
  5523. @item .stabd @var{type} , @var{other} , @var{desc}
  5524. The ``name'' of the symbol generated is not even an empty string.
  5525. It is a null pointer, for compatibility. Older assemblers used a
  5526. null pointer so they didn't waste space in object files with empty
  5527. strings.
  5528. The symbol's value is set to the location counter,
  5529. relocatably. When your program is linked, the value of this symbol
  5530. is the address of the location counter when the @code{.stabd} was
  5531. assembled.
  5532. @cindex @code{stabn} directive
  5533. @item .stabn @var{type} , @var{other} , @var{desc} , @var{value}
  5534. The name of the symbol is set to the empty string @code{""}.
  5535. @cindex @code{stabs} directive
  5536. @item .stabs @var{string} , @var{type} , @var{other} , @var{desc} , @var{value}
  5537. All five fields are specified.
  5538. @end table
  5539. @end ifset
  5540. @c end have-stabs
  5541. @node String
  5542. @section @code{.string} "@var{str}", @code{.string8} "@var{str}", @code{.string16}
  5543. "@var{str}", @code{.string32} "@var{str}", @code{.string64} "@var{str}"
  5544. @cindex string, copying to object file
  5545. @cindex string8, copying to object file
  5546. @cindex string16, copying to object file
  5547. @cindex string32, copying to object file
  5548. @cindex string64, copying to object file
  5549. @cindex @code{string} directive
  5550. @cindex @code{string8} directive
  5551. @cindex @code{string16} directive
  5552. @cindex @code{string32} directive
  5553. @cindex @code{string64} directive
  5554. Copy the characters in @var{str} to the object file. You may specify more than
  5555. one string to copy, separated by commas. Unless otherwise specified for a
  5556. particular machine, the assembler marks the end of each string with a 0 byte.
  5557. You can use any of the escape sequences described in @ref{Strings,,Strings}.
  5558. The variants @code{string16}, @code{string32} and @code{string64} differ from
  5559. the @code{string} pseudo opcode in that each 8-bit character from @var{str} is
  5560. copied and expanded to 16, 32 or 64 bits respectively. The expanded characters
  5561. are stored in target endianness byte order.
  5562. Example:
  5563. @smallexample
  5564. .string32 "BYE"
  5565. expands to:
  5566. .string "B\0\0\0Y\0\0\0E\0\0\0" /* On little endian targets. */
  5567. .string "\0\0\0B\0\0\0Y\0\0\0E" /* On big endian targets. */
  5568. @end smallexample
  5569. @node Struct
  5570. @section @code{.struct @var{expression}}
  5571. @cindex @code{struct} directive
  5572. Switch to the absolute section, and set the section offset to @var{expression},
  5573. which must be an absolute expression. You might use this as follows:
  5574. @smallexample
  5575. .struct 0
  5576. field1:
  5577. .struct field1 + 4
  5578. field2:
  5579. .struct field2 + 4
  5580. field3:
  5581. @end smallexample
  5582. This would define the symbol @code{field1} to have the value 0, the symbol
  5583. @code{field2} to have the value 4, and the symbol @code{field3} to have the
  5584. value 8. Assembly would be left in the absolute section, and you would need to
  5585. use a @code{.section} directive of some sort to change to some other section
  5586. before further assembly.
  5587. @ifset ELF
  5588. @node SubSection
  5589. @section @code{.subsection @var{name}}
  5590. @cindex @code{subsection} directive
  5591. @cindex Section Stack
  5592. This is one of the ELF section stack manipulation directives. The others are
  5593. @code{.section} (@pxref{Section}), @code{.pushsection} (@pxref{PushSection}),
  5594. @code{.popsection} (@pxref{PopSection}), and @code{.previous}
  5595. (@pxref{Previous}).
  5596. This directive replaces the current subsection with @code{name}. The current
  5597. section is not changed. The replaced subsection is put onto the section stack
  5598. in place of the then current top of stack subsection.
  5599. @end ifset
  5600. @ifset ELF
  5601. @node Symver
  5602. @section @code{.symver}
  5603. @cindex @code{symver} directive
  5604. @cindex symbol versioning
  5605. @cindex versions of symbols
  5606. Use the @code{.symver} directive to bind symbols to specific version nodes
  5607. within a source file. This is only supported on ELF platforms, and is
  5608. typically used when assembling files to be linked into a shared library.
  5609. There are cases where it may make sense to use this in objects to be bound
  5610. into an application itself so as to override a versioned symbol from a
  5611. shared library.
  5612. For ELF targets, the @code{.symver} directive can be used like this:
  5613. @smallexample
  5614. .symver @var{name}, @var{name2@@nodename}
  5615. @end smallexample
  5616. If the symbol @var{name} is defined within the file
  5617. being assembled, the @code{.symver} directive effectively creates a symbol
  5618. alias with the name @var{name2@@nodename}, and in fact the main reason that we
  5619. just don't try and create a regular alias is that the @var{@@} character isn't
  5620. permitted in symbol names. The @var{name2} part of the name is the actual name
  5621. of the symbol by which it will be externally referenced. The name @var{name}
  5622. itself is merely a name of convenience that is used so that it is possible to
  5623. have definitions for multiple versions of a function within a single source
  5624. file, and so that the compiler can unambiguously know which version of a
  5625. function is being mentioned. The @var{nodename} portion of the alias should be
  5626. the name of a node specified in the version script supplied to the linker when
  5627. building a shared library. If you are attempting to override a versioned
  5628. symbol from a shared library, then @var{nodename} should correspond to the
  5629. nodename of the symbol you are trying to override.
  5630. If the symbol @var{name} is not defined within the file being assembled, all
  5631. references to @var{name} will be changed to @var{name2@@nodename}. If no
  5632. reference to @var{name} is made, @var{name2@@nodename} will be removed from the
  5633. symbol table.
  5634. Another usage of the @code{.symver} directive is:
  5635. @smallexample
  5636. .symver @var{name}, @var{name2@@@@nodename}
  5637. @end smallexample
  5638. In this case, the symbol @var{name} must exist and be defined within
  5639. the file being assembled. It is similar to @var{name2@@nodename}. The
  5640. difference is @var{name2@@@@nodename} will also be used to resolve
  5641. references to @var{name2} by the linker.
  5642. The third usage of the @code{.symver} directive is:
  5643. @smallexample
  5644. .symver @var{name}, @var{name2@@@@@@nodename}
  5645. @end smallexample
  5646. When @var{name} is not defined within the
  5647. file being assembled, it is treated as @var{name2@@nodename}. When
  5648. @var{name} is defined within the file being assembled, the symbol
  5649. name, @var{name}, will be changed to @var{name2@@@@nodename}.
  5650. @end ifset
  5651. @ifset COFF
  5652. @node Tag
  5653. @section @code{.tag @var{structname}}
  5654. @cindex COFF structure debugging
  5655. @cindex structure debugging, COFF
  5656. @cindex @code{tag} directive
  5657. This directive is generated by compilers to include auxiliary debugging
  5658. information in the symbol table. It is only permitted inside
  5659. @code{.def}/@code{.endef} pairs. Tags are used to link structure
  5660. definitions in the symbol table with instances of those structures.
  5661. @ifset BOUT
  5662. @samp{.tag} is only used when generating COFF format output; when
  5663. @command{@value{AS}} is generating @code{b.out}, it accepts this directive but
  5664. ignores it.
  5665. @end ifset
  5666. @end ifset
  5667. @node Text
  5668. @section @code{.text @var{subsection}}
  5669. @cindex @code{text} directive
  5670. Tells @command{@value{AS}} to assemble the following statements onto the end of
  5671. the text subsection numbered @var{subsection}, which is an absolute
  5672. expression. If @var{subsection} is omitted, subsection number zero
  5673. is used.
  5674. @node Title
  5675. @section @code{.title "@var{heading}"}
  5676. @cindex @code{title} directive
  5677. @cindex listing control: title line
  5678. Use @var{heading} as the title (second line, immediately after the
  5679. source file name and pagenumber) when generating assembly listings.
  5680. This directive affects subsequent pages, as well as the current page if
  5681. it appears within ten lines of the top of a page.
  5682. @ifset COFF-ELF
  5683. @node Type
  5684. @section @code{.type}
  5685. This directive is used to set the type of a symbol.
  5686. @ifset COFF
  5687. @ifset ELF
  5688. @c only print the extra heading if both COFF and ELF are set
  5689. @subheading COFF Version
  5690. @end ifset
  5691. @cindex COFF symbol type
  5692. @cindex symbol type, COFF
  5693. @cindex @code{type} directive (COFF version)
  5694. For COFF targets, this directive is permitted only within
  5695. @code{.def}/@code{.endef} pairs. It is used like this:
  5696. @smallexample
  5697. .type @var{int}
  5698. @end smallexample
  5699. This records the integer @var{int} as the type attribute of a symbol table
  5700. entry.
  5701. @ifset BOUT
  5702. @samp{.type} is associated only with COFF format output; when
  5703. @command{@value{AS}} is configured for @code{b.out} output, it accepts this
  5704. directive but ignores it.
  5705. @end ifset
  5706. @end ifset
  5707. @ifset ELF
  5708. @ifset COFF
  5709. @c only print the extra heading if both COFF and ELF are set
  5710. @subheading ELF Version
  5711. @end ifset
  5712. @cindex ELF symbol type
  5713. @cindex symbol type, ELF
  5714. @cindex @code{type} directive (ELF version)
  5715. For ELF targets, the @code{.type} directive is used like this:
  5716. @smallexample
  5717. .type @var{name} , @var{type description}
  5718. @end smallexample
  5719. This sets the type of symbol @var{name} to be either a
  5720. function symbol or an object symbol. There are five different syntaxes
  5721. supported for the @var{type description} field, in order to provide
  5722. compatibility with various other assemblers.
  5723. Because some of the characters used in these syntaxes (such as @samp{@@} and
  5724. @samp{#}) are comment characters for some architectures, some of the syntaxes
  5725. below do not work on all architectures. The first variant will be accepted by
  5726. the GNU assembler on all architectures so that variant should be used for
  5727. maximum portability, if you do not need to assemble your code with other
  5728. assemblers.
  5729. The syntaxes supported are:
  5730. @smallexample
  5731. .type <name> STT_<TYPE_IN_UPPER_CASE>
  5732. .type <name>,#<type>
  5733. .type <name>,@@<type>
  5734. .type <name>,%<type>
  5735. .type <name>,"<type>"
  5736. @end smallexample
  5737. The types supported are:
  5738. @table @gcctabopt
  5739. @item STT_FUNC
  5740. @itemx function
  5741. Mark the symbol as being a function name.
  5742. @item STT_GNU_IFUNC
  5743. @itemx gnu_indirect_function
  5744. Mark the symbol as an indirect function when evaluated during reloc
  5745. processing. (This is only supported on assemblers targeting GNU systems).
  5746. @item STT_OBJECT
  5747. @itemx object
  5748. Mark the symbol as being a data object.
  5749. @item STT_TLS
  5750. @itemx tls_object
  5751. Mark the symbol as being a thead-local data object.
  5752. @item STT_COMMON
  5753. @itemx common
  5754. Mark the symbol as being a common data object.
  5755. @item STT_NOTYPE
  5756. @itemx notype
  5757. Does not mark the symbol in any way. It is supported just for completeness.
  5758. @item gnu_unique_object
  5759. Marks the symbol as being a globally unique data object. The dynamic linker
  5760. will make sure that in the entire process there is just one symbol with this
  5761. name and type in use. (This is only supported on assemblers targeting GNU
  5762. systems).
  5763. @end table
  5764. Note: Some targets support extra types in addition to those listed above.
  5765. @end ifset
  5766. @end ifset
  5767. @node Uleb128
  5768. @section @code{.uleb128 @var{expressions}}
  5769. @cindex @code{uleb128} directive
  5770. @var{uleb128} stands for ``unsigned little endian base 128.'' This is a
  5771. compact, variable length representation of numbers used by the DWARF
  5772. symbolic debugging format. @xref{Sleb128, ,@code{.sleb128}}.
  5773. @ifset COFF
  5774. @node Val
  5775. @section @code{.val @var{addr}}
  5776. @cindex @code{val} directive
  5777. @cindex COFF value attribute
  5778. @cindex value attribute, COFF
  5779. This directive, permitted only within @code{.def}/@code{.endef} pairs,
  5780. records the address @var{addr} as the value attribute of a symbol table
  5781. entry.
  5782. @ifset BOUT
  5783. @samp{.val} is used only for COFF output; when @command{@value{AS}} is
  5784. configured for @code{b.out}, it accepts this directive but ignores it.
  5785. @end ifset
  5786. @end ifset
  5787. @ifset ELF
  5788. @node Version
  5789. @section @code{.version "@var{string}"}
  5790. @cindex @code{version} directive
  5791. This directive creates a @code{.note} section and places into it an ELF
  5792. formatted note of type NT_VERSION. The note's name is set to @code{string}.
  5793. @end ifset
  5794. @ifset ELF
  5795. @node VTableEntry
  5796. @section @code{.vtable_entry @var{table}, @var{offset}}
  5797. @cindex @code{vtable_entry} directive
  5798. This directive finds or creates a symbol @code{table} and creates a
  5799. @code{VTABLE_ENTRY} relocation for it with an addend of @code{offset}.
  5800. @node VTableInherit
  5801. @section @code{.vtable_inherit @var{child}, @var{parent}}
  5802. @cindex @code{vtable_inherit} directive
  5803. This directive finds the symbol @code{child} and finds or creates the symbol
  5804. @code{parent} and then creates a @code{VTABLE_INHERIT} relocation for the
  5805. parent whose addend is the value of the child symbol. As a special case the
  5806. parent name of @code{0} is treated as referring to the @code{*ABS*} section.
  5807. @end ifset
  5808. @node Warning
  5809. @section @code{.warning "@var{string}"}
  5810. @cindex warning directive
  5811. Similar to the directive @code{.error}
  5812. (@pxref{Error,,@code{.error "@var{string}"}}), but just emits a warning.
  5813. @node Weak
  5814. @section @code{.weak @var{names}}
  5815. @cindex @code{weak} directive
  5816. This directive sets the weak attribute on the comma separated list of symbol
  5817. @code{names}. If the symbols do not already exist, they will be created.
  5818. On COFF targets other than PE, weak symbols are a GNU extension. This
  5819. directive sets the weak attribute on the comma separated list of symbol
  5820. @code{names}. If the symbols do not already exist, they will be created.
  5821. On the PE target, weak symbols are supported natively as weak aliases.
  5822. When a weak symbol is created that is not an alias, GAS creates an
  5823. alternate symbol to hold the default value.
  5824. @node Weakref
  5825. @section @code{.weakref @var{alias}, @var{target}}
  5826. @cindex @code{weakref} directive
  5827. This directive creates an alias to the target symbol that enables the symbol to
  5828. be referenced with weak-symbol semantics, but without actually making it weak.
  5829. If direct references or definitions of the symbol are present, then the symbol
  5830. will not be weak, but if all references to it are through weak references, the
  5831. symbol will be marked as weak in the symbol table.
  5832. The effect is equivalent to moving all references to the alias to a separate
  5833. assembly source file, renaming the alias to the symbol in it, declaring the
  5834. symbol as weak there, and running a reloadable link to merge the object files
  5835. resulting from the assembly of the new source file and the old source file that
  5836. had the references to the alias removed.
  5837. The alias itself never makes to the symbol table, and is entirely handled
  5838. within the assembler.
  5839. @node Word
  5840. @section @code{.word @var{expressions}}
  5841. @cindex @code{word} directive
  5842. This directive expects zero or more @var{expressions}, of any section,
  5843. separated by commas.
  5844. @ifclear GENERIC
  5845. @ifset W32
  5846. For each expression, @command{@value{AS}} emits a 32-bit number.
  5847. @end ifset
  5848. @ifset W16
  5849. For each expression, @command{@value{AS}} emits a 16-bit number.
  5850. @end ifset
  5851. @end ifclear
  5852. @ifset GENERIC
  5853. The size of the number emitted, and its byte order,
  5854. depend on what target computer the assembly is for.
  5855. @end ifset
  5856. @c on amd29k, i960, sparc the "special treatment to support compilers" doesn't
  5857. @c happen---32-bit addressability, period; no long/short jumps.
  5858. @ifset DIFF-TBL-KLUGE
  5859. @cindex difference tables altered
  5860. @cindex altered difference tables
  5861. @quotation
  5862. @emph{Warning: Special Treatment to support Compilers}
  5863. @end quotation
  5864. @ifset GENERIC
  5865. Machines with a 32-bit address space, but that do less than 32-bit
  5866. addressing, require the following special treatment. If the machine of
  5867. interest to you does 32-bit addressing (or doesn't require it;
  5868. @pxref{Machine Dependencies}), you can ignore this issue.
  5869. @end ifset
  5870. In order to assemble compiler output into something that works,
  5871. @command{@value{AS}} occasionally does strange things to @samp{.word} directives.
  5872. Directives of the form @samp{.word sym1-sym2} are often emitted by
  5873. compilers as part of jump tables. Therefore, when @command{@value{AS}} assembles a
  5874. directive of the form @samp{.word sym1-sym2}, and the difference between
  5875. @code{sym1} and @code{sym2} does not fit in 16 bits, @command{@value{AS}}
  5876. creates a @dfn{secondary jump table}, immediately before the next label.
  5877. This secondary jump table is preceded by a short-jump to the
  5878. first byte after the secondary table. This short-jump prevents the flow
  5879. of control from accidentally falling into the new table. Inside the
  5880. table is a long-jump to @code{sym2}. The original @samp{.word}
  5881. contains @code{sym1} minus the address of the long-jump to
  5882. @code{sym2}.
  5883. If there were several occurrences of @samp{.word sym1-sym2} before the
  5884. secondary jump table, all of them are adjusted. If there was a
  5885. @samp{.word sym3-sym4}, that also did not fit in sixteen bits, a
  5886. long-jump to @code{sym4} is included in the secondary jump table,
  5887. and the @code{.word} directives are adjusted to contain @code{sym3}
  5888. minus the address of the long-jump to @code{sym4}; and so on, for as many
  5889. entries in the original jump table as necessary.
  5890. @ifset INTERNALS
  5891. @emph{This feature may be disabled by compiling @command{@value{AS}} with the
  5892. @samp{-DWORKING_DOT_WORD} option.} This feature is likely to confuse
  5893. assembly language programmers.
  5894. @end ifset
  5895. @end ifset
  5896. @c end DIFF-TBL-KLUGE
  5897. @ifclear no-space-dir
  5898. @node Zero
  5899. @section @code{.zero @var{size}}
  5900. @cindex @code{zero} directive
  5901. @cindex filling memory with zero bytes
  5902. This directive emits @var{size} 0-valued bytes. @var{size} must be an absolute
  5903. expression. This directive is actually an alias for the @samp{.skip} directive
  5904. so in can take an optional second argument of the value to store in the bytes
  5905. instead of zero. Using @samp{.zero} in this way would be confusing however.
  5906. @end ifclear
  5907. @node Deprecated
  5908. @section Deprecated Directives
  5909. @cindex deprecated directives
  5910. @cindex obsolescent directives
  5911. One day these directives won't work.
  5912. They are included for compatibility with older assemblers.
  5913. @table @t
  5914. @item .abort
  5915. @item .line
  5916. @end table
  5917. @ifset ELF
  5918. @node Object Attributes
  5919. @chapter Object Attributes
  5920. @cindex object attributes
  5921. @command{@value{AS}} assembles source files written for a specific architecture
  5922. into object files for that architecture. But not all object files are alike.
  5923. Many architectures support incompatible variations. For instance, floating
  5924. point arguments might be passed in floating point registers if the object file
  5925. requires hardware floating point support---or floating point arguments might be
  5926. passed in integer registers if the object file supports processors with no
  5927. hardware floating point unit. Or, if two objects are built for different
  5928. generations of the same architecture, the combination may require the
  5929. newer generation at run-time.
  5930. This information is useful during and after linking. At link time,
  5931. @command{@value{LD}} can warn about incompatible object files. After link
  5932. time, tools like @command{gdb} can use it to process the linked file
  5933. correctly.
  5934. Compatibility information is recorded as a series of object attributes. Each
  5935. attribute has a @dfn{vendor}, @dfn{tag}, and @dfn{value}. The vendor is a
  5936. string, and indicates who sets the meaning of the tag. The tag is an integer,
  5937. and indicates what property the attribute describes. The value may be a string
  5938. or an integer, and indicates how the property affects this object. Missing
  5939. attributes are the same as attributes with a zero value or empty string value.
  5940. Object attributes were developed as part of the ABI for the ARM Architecture.
  5941. The file format is documented in @cite{ELF for the ARM Architecture}.
  5942. @menu
  5943. * GNU Object Attributes:: @sc{gnu} Object Attributes
  5944. * Defining New Object Attributes:: Defining New Object Attributes
  5945. @end menu
  5946. @node GNU Object Attributes
  5947. @section @sc{gnu} Object Attributes
  5948. The @code{.gnu_attribute} directive records an object attribute
  5949. with vendor @samp{gnu}.
  5950. Except for @samp{Tag_compatibility}, which has both an integer and a string for
  5951. its value, @sc{gnu} attributes have a string value if the tag number is odd and
  5952. an integer value if the tag number is even. The second bit (@code{@var{tag} &
  5953. 2} is set for architecture-independent attributes and clear for
  5954. architecture-dependent ones.
  5955. @subsection Common @sc{gnu} attributes
  5956. These attributes are valid on all architectures.
  5957. @table @r
  5958. @item Tag_compatibility (32)
  5959. The compatibility attribute takes an integer flag value and a vendor name. If
  5960. the flag value is 0, the file is compatible with other toolchains. If it is 1,
  5961. then the file is only compatible with the named toolchain. If it is greater
  5962. than 1, the file can only be processed by other toolchains under some private
  5963. arrangement indicated by the flag value and the vendor name.
  5964. @end table
  5965. @subsection MIPS Attributes
  5966. @table @r
  5967. @item Tag_GNU_MIPS_ABI_FP (4)
  5968. The floating-point ABI used by this object file. The value will be:
  5969. @itemize @bullet
  5970. @item
  5971. 0 for files not affected by the floating-point ABI.
  5972. @item
  5973. 1 for files using the hardware floating-point ABI with a standard
  5974. double-precision FPU.
  5975. @item
  5976. 2 for files using the hardware floating-point ABI with a single-precision FPU.
  5977. @item
  5978. 3 for files using the software floating-point ABI.
  5979. @item
  5980. 4 for files using the deprecated hardware floating-point ABI which used 64-bit
  5981. floating-point registers, 32-bit general-purpose registers and increased the
  5982. number of callee-saved floating-point registers.
  5983. @item
  5984. 5 for files using the hardware floating-point ABI with a double-precision FPU
  5985. with either 32-bit or 64-bit floating-point registers and 32-bit
  5986. general-purpose registers.
  5987. @item
  5988. 6 for files using the hardware floating-point ABI with 64-bit floating-point
  5989. registers and 32-bit general-purpose registers.
  5990. @item
  5991. 7 for files using the hardware floating-point ABI with 64-bit floating-point
  5992. registers, 32-bit general-purpose registers and a rule that forbids the
  5993. direct use of odd-numbered single-precision floating-point registers.
  5994. @end itemize
  5995. @end table
  5996. @subsection PowerPC Attributes
  5997. @table @r
  5998. @item Tag_GNU_Power_ABI_FP (4)
  5999. The floating-point ABI used by this object file. The value will be:
  6000. @itemize @bullet
  6001. @item
  6002. 0 for files not affected by the floating-point ABI.
  6003. @item
  6004. 1 for files using double-precision hardware floating-point ABI.
  6005. @item
  6006. 2 for files using the software floating-point ABI.
  6007. @item
  6008. 3 for files using single-precision hardware floating-point ABI.
  6009. @end itemize
  6010. @item Tag_GNU_Power_ABI_Vector (8)
  6011. The vector ABI used by this object file. The value will be:
  6012. @itemize @bullet
  6013. @item
  6014. 0 for files not affected by the vector ABI.
  6015. @item
  6016. 1 for files using general purpose registers to pass vectors.
  6017. @item
  6018. 2 for files using AltiVec registers to pass vectors.
  6019. @item
  6020. 3 for files using SPE registers to pass vectors.
  6021. @end itemize
  6022. @end table
  6023. @subsection IBM z Systems Attributes
  6024. @table @r
  6025. @item Tag_GNU_S390_ABI_Vector (8)
  6026. The vector ABI used by this object file. The value will be:
  6027. @itemize @bullet
  6028. @item
  6029. 0 for files not affected by the vector ABI.
  6030. @item
  6031. 1 for files using software vector ABI.
  6032. @item
  6033. 2 for files using hardware vector ABI.
  6034. @end itemize
  6035. @end table
  6036. @node Defining New Object Attributes
  6037. @section Defining New Object Attributes
  6038. If you want to define a new @sc{gnu} object attribute, here are the places you
  6039. will need to modify. New attributes should be discussed on the @samp{binutils}
  6040. mailing list.
  6041. @itemize @bullet
  6042. @item
  6043. This manual, which is the official register of attributes.
  6044. @item
  6045. The header for your architecture @file{include/elf}, to define the tag.
  6046. @item
  6047. The @file{bfd} support file for your architecture, to merge the attribute
  6048. and issue any appropriate link warnings.
  6049. @item
  6050. Test cases in @file{ld/testsuite} for merging and link warnings.
  6051. @item
  6052. @file{binutils/readelf.c} to display your attribute.
  6053. @item
  6054. GCC, if you want the compiler to mark the attribute automatically.
  6055. @end itemize
  6056. @end ifset
  6057. @ifset GENERIC
  6058. @node Machine Dependencies
  6059. @chapter Machine Dependent Features
  6060. @cindex machine dependencies
  6061. The machine instruction sets are (almost by definition) different on
  6062. each machine where @command{@value{AS}} runs. Floating point representations
  6063. vary as well, and @command{@value{AS}} often supports a few additional
  6064. directives or command-line options for compatibility with other
  6065. assemblers on a particular platform. Finally, some versions of
  6066. @command{@value{AS}} support special pseudo-instructions for branch
  6067. optimization.
  6068. This chapter discusses most of these differences, though it does not
  6069. include details on any machine's instruction set. For details on that
  6070. subject, see the hardware manufacturer's manual.
  6071. @menu
  6072. @ifset AARCH64
  6073. * AArch64-Dependent:: AArch64 Dependent Features
  6074. @end ifset
  6075. @ifset ALPHA
  6076. * Alpha-Dependent:: Alpha Dependent Features
  6077. @end ifset
  6078. @ifset ARC
  6079. * ARC-Dependent:: ARC Dependent Features
  6080. @end ifset
  6081. @ifset ARM
  6082. * ARM-Dependent:: ARM Dependent Features
  6083. @end ifset
  6084. @ifset AVR
  6085. * AVR-Dependent:: AVR Dependent Features
  6086. @end ifset
  6087. @ifset Blackfin
  6088. * Blackfin-Dependent:: Blackfin Dependent Features
  6089. @end ifset
  6090. @ifset CR16
  6091. * CR16-Dependent:: CR16 Dependent Features
  6092. @end ifset
  6093. @ifset CRIS
  6094. * CRIS-Dependent:: CRIS Dependent Features
  6095. @end ifset
  6096. @ifset D10V
  6097. * D10V-Dependent:: D10V Dependent Features
  6098. @end ifset
  6099. @ifset D30V
  6100. * D30V-Dependent:: D30V Dependent Features
  6101. @end ifset
  6102. @ifset EPIPHANY
  6103. * Epiphany-Dependent:: EPIPHANY Dependent Features
  6104. @end ifset
  6105. @ifset H8/300
  6106. * H8/300-Dependent:: Renesas H8/300 Dependent Features
  6107. @end ifset
  6108. @ifset HPPA
  6109. * HPPA-Dependent:: HPPA Dependent Features
  6110. @end ifset
  6111. @ifset I370
  6112. * ESA/390-Dependent:: IBM ESA/390 Dependent Features
  6113. @end ifset
  6114. @ifset I80386
  6115. * i386-Dependent:: Intel 80386 and AMD x86-64 Dependent Features
  6116. @end ifset
  6117. @ifset I860
  6118. * i860-Dependent:: Intel 80860 Dependent Features
  6119. @end ifset
  6120. @ifset I960
  6121. * i960-Dependent:: Intel 80960 Dependent Features
  6122. @end ifset
  6123. @ifset IA64
  6124. * IA-64-Dependent:: Intel IA-64 Dependent Features
  6125. @end ifset
  6126. @ifset IP2K
  6127. * IP2K-Dependent:: IP2K Dependent Features
  6128. @end ifset
  6129. @ifset LM32
  6130. * LM32-Dependent:: LM32 Dependent Features
  6131. @end ifset
  6132. @ifset M32C
  6133. * M32C-Dependent:: M32C Dependent Features
  6134. @end ifset
  6135. @ifset M32R
  6136. * M32R-Dependent:: M32R Dependent Features
  6137. @end ifset
  6138. @ifset M680X0
  6139. * M68K-Dependent:: M680x0 Dependent Features
  6140. @end ifset
  6141. @ifset M68HC11
  6142. * M68HC11-Dependent:: M68HC11 and 68HC12 Dependent Features
  6143. @end ifset
  6144. @ifset METAG
  6145. * Meta-Dependent :: Meta Dependent Features
  6146. @end ifset
  6147. @ifset MICROBLAZE
  6148. * MicroBlaze-Dependent:: MICROBLAZE Dependent Features
  6149. @end ifset
  6150. @ifset MIPS
  6151. * MIPS-Dependent:: MIPS Dependent Features
  6152. @end ifset
  6153. @ifset MMIX
  6154. * MMIX-Dependent:: MMIX Dependent Features
  6155. @end ifset
  6156. @ifset MSP430
  6157. * MSP430-Dependent:: MSP430 Dependent Features
  6158. @end ifset
  6159. @ifset NDS32
  6160. * NDS32-Dependent:: Andes NDS32 Dependent Features
  6161. @end ifset
  6162. @ifset NIOSII
  6163. * NiosII-Dependent:: Altera Nios II Dependent Features
  6164. @end ifset
  6165. @ifset NS32K
  6166. * NS32K-Dependent:: NS32K Dependent Features
  6167. @end ifset
  6168. @ifset PDP11
  6169. * PDP-11-Dependent:: PDP-11 Dependent Features
  6170. @end ifset
  6171. @ifset PJ
  6172. * PJ-Dependent:: picoJava Dependent Features
  6173. @end ifset
  6174. @ifset PPC
  6175. * PPC-Dependent:: PowerPC Dependent Features
  6176. @end ifset
  6177. @ifset RL78
  6178. * RL78-Dependent:: RL78 Dependent Features
  6179. @end ifset
  6180. @ifset RX
  6181. * RX-Dependent:: RX Dependent Features
  6182. @end ifset
  6183. @ifset S390
  6184. * S/390-Dependent:: IBM S/390 Dependent Features
  6185. @end ifset
  6186. @ifset SCORE
  6187. * SCORE-Dependent:: SCORE Dependent Features
  6188. @end ifset
  6189. @ifset SH
  6190. * SH-Dependent:: Renesas / SuperH SH Dependent Features
  6191. * SH64-Dependent:: SuperH SH64 Dependent Features
  6192. @end ifset
  6193. @ifset SPARC
  6194. * Sparc-Dependent:: SPARC Dependent Features
  6195. @end ifset
  6196. @ifset TIC54X
  6197. * TIC54X-Dependent:: TI TMS320C54x Dependent Features
  6198. @end ifset
  6199. @ifset TIC6X
  6200. * TIC6X-Dependent :: TI TMS320C6x Dependent Features
  6201. @end ifset
  6202. @ifset TILEGX
  6203. * TILE-Gx-Dependent :: Tilera TILE-Gx Dependent Features
  6204. @end ifset
  6205. @ifset TILEPRO
  6206. * TILEPro-Dependent :: Tilera TILEPro Dependent Features
  6207. @end ifset
  6208. @ifset V850
  6209. * V850-Dependent:: V850 Dependent Features
  6210. @end ifset
  6211. @ifset VAX
  6212. * Vax-Dependent:: VAX Dependent Features
  6213. @end ifset
  6214. @ifset VISIUM
  6215. * Visium-Dependent:: Visium Dependent Features
  6216. @end ifset
  6217. @ifset XGATE
  6218. * XGATE-Dependent:: XGATE Features
  6219. @end ifset
  6220. @ifset XSTORMY16
  6221. * XSTORMY16-Dependent:: XStormy16 Dependent Features
  6222. @end ifset
  6223. @ifset XTENSA
  6224. * Xtensa-Dependent:: Xtensa Dependent Features
  6225. @end ifset
  6226. @ifset Z80
  6227. * Z80-Dependent:: Z80 Dependent Features
  6228. @end ifset
  6229. @ifset Z8000
  6230. * Z8000-Dependent:: Z8000 Dependent Features
  6231. @end ifset
  6232. @end menu
  6233. @lowersections
  6234. @end ifset
  6235. @c The following major nodes are *sections* in the GENERIC version, *chapters*
  6236. @c in single-cpu versions. This is mainly achieved by @lowersections. There is a
  6237. @c peculiarity: to preserve cross-references, there must be a node called
  6238. @c "Machine Dependencies". Hence the conditional nodenames in each
  6239. @c major node below. Node defaulting in makeinfo requires adjacency of
  6240. @c node and sectioning commands; hence the repetition of @chapter BLAH
  6241. @c in both conditional blocks.
  6242. @ifset AARCH64
  6243. @include c-aarch64.texi
  6244. @end ifset
  6245. @ifset ALPHA
  6246. @include c-alpha.texi
  6247. @end ifset
  6248. @ifset ARC
  6249. @include c-arc.texi
  6250. @end ifset
  6251. @ifset ARM
  6252. @include c-arm.texi
  6253. @end ifset
  6254. @ifset AVR
  6255. @include c-avr.texi
  6256. @end ifset
  6257. @ifset Blackfin
  6258. @include c-bfin.texi
  6259. @end ifset
  6260. @ifset CR16
  6261. @include c-cr16.texi
  6262. @end ifset
  6263. @ifset CRIS
  6264. @include c-cris.texi
  6265. @end ifset
  6266. @ifset Renesas-all
  6267. @ifclear GENERIC
  6268. @node Machine Dependencies
  6269. @chapter Machine Dependent Features
  6270. The machine instruction sets are different on each Renesas chip family,
  6271. and there are also some syntax differences among the families. This
  6272. chapter describes the specific @command{@value{AS}} features for each
  6273. family.
  6274. @menu
  6275. * H8/300-Dependent:: Renesas H8/300 Dependent Features
  6276. * SH-Dependent:: Renesas SH Dependent Features
  6277. @end menu
  6278. @lowersections
  6279. @end ifclear
  6280. @end ifset
  6281. @ifset D10V
  6282. @include c-d10v.texi
  6283. @end ifset
  6284. @ifset D30V
  6285. @include c-d30v.texi
  6286. @end ifset
  6287. @ifset EPIPHANY
  6288. @include c-epiphany.texi
  6289. @end ifset
  6290. @ifset H8/300
  6291. @include c-h8300.texi
  6292. @end ifset
  6293. @ifset HPPA
  6294. @include c-hppa.texi
  6295. @end ifset
  6296. @ifset I370
  6297. @include c-i370.texi
  6298. @end ifset
  6299. @ifset I80386
  6300. @include c-i386.texi
  6301. @end ifset
  6302. @ifset I860
  6303. @include c-i860.texi
  6304. @end ifset
  6305. @ifset I960
  6306. @include c-i960.texi
  6307. @end ifset
  6308. @ifset IA64
  6309. @include c-ia64.texi
  6310. @end ifset
  6311. @ifset IP2K
  6312. @include c-ip2k.texi
  6313. @end ifset
  6314. @ifset LM32
  6315. @include c-lm32.texi
  6316. @end ifset
  6317. @ifset M32C
  6318. @include c-m32c.texi
  6319. @end ifset
  6320. @ifset M32R
  6321. @include c-m32r.texi
  6322. @end ifset
  6323. @ifset M680X0
  6324. @include c-m68k.texi
  6325. @end ifset
  6326. @ifset M68HC11
  6327. @include c-m68hc11.texi
  6328. @end ifset
  6329. @ifset METAG
  6330. @include c-metag.texi
  6331. @end ifset
  6332. @ifset MICROBLAZE
  6333. @include c-microblaze.texi
  6334. @end ifset
  6335. @ifset MIPS
  6336. @include c-mips.texi
  6337. @end ifset
  6338. @ifset MMIX
  6339. @include c-mmix.texi
  6340. @end ifset
  6341. @ifset MSP430
  6342. @include c-msp430.texi
  6343. @end ifset
  6344. @ifset NDS32
  6345. @include c-nds32.texi
  6346. @end ifset
  6347. @ifset NIOSII
  6348. @include c-nios2.texi
  6349. @end ifset
  6350. @ifset NS32K
  6351. @include c-ns32k.texi
  6352. @end ifset
  6353. @ifset PDP11
  6354. @include c-pdp11.texi
  6355. @end ifset
  6356. @ifset PJ
  6357. @include c-pj.texi
  6358. @end ifset
  6359. @ifset PPC
  6360. @include c-ppc.texi
  6361. @end ifset
  6362. @ifset RL78
  6363. @include c-rl78.texi
  6364. @end ifset
  6365. @ifset RX
  6366. @include c-rx.texi
  6367. @end ifset
  6368. @ifset S390
  6369. @include c-s390.texi
  6370. @end ifset
  6371. @ifset SCORE
  6372. @include c-score.texi
  6373. @end ifset
  6374. @ifset SH
  6375. @include c-sh.texi
  6376. @include c-sh64.texi
  6377. @end ifset
  6378. @ifset SPARC
  6379. @include c-sparc.texi
  6380. @end ifset
  6381. @ifset TIC54X
  6382. @include c-tic54x.texi
  6383. @end ifset
  6384. @ifset TIC6X
  6385. @include c-tic6x.texi
  6386. @end ifset
  6387. @ifset TILEGX
  6388. @include c-tilegx.texi
  6389. @end ifset
  6390. @ifset TILEPRO
  6391. @include c-tilepro.texi
  6392. @end ifset
  6393. @ifset V850
  6394. @include c-v850.texi
  6395. @end ifset
  6396. @ifset VAX
  6397. @include c-vax.texi
  6398. @end ifset
  6399. @ifset VISIUM
  6400. @include c-visium.texi
  6401. @end ifset
  6402. @ifset XGATE
  6403. @include c-xgate.texi
  6404. @end ifset
  6405. @ifset XSTORMY16
  6406. @include c-xstormy16.texi
  6407. @end ifset
  6408. @ifset XTENSA
  6409. @include c-xtensa.texi
  6410. @end ifset
  6411. @ifset Z80
  6412. @include c-z80.texi
  6413. @end ifset
  6414. @ifset Z8000
  6415. @include c-z8k.texi
  6416. @end ifset
  6417. @ifset GENERIC
  6418. @c reverse effect of @down at top of generic Machine-Dep chapter
  6419. @raisesections
  6420. @end ifset
  6421. @node Reporting Bugs
  6422. @chapter Reporting Bugs
  6423. @cindex bugs in assembler
  6424. @cindex reporting bugs in assembler
  6425. Your bug reports play an essential role in making @command{@value{AS}} reliable.
  6426. Reporting a bug may help you by bringing a solution to your problem, or it may
  6427. not. But in any case the principal function of a bug report is to help the
  6428. entire community by making the next version of @command{@value{AS}} work better.
  6429. Bug reports are your contribution to the maintenance of @command{@value{AS}}.
  6430. In order for a bug report to serve its purpose, you must include the
  6431. information that enables us to fix the bug.
  6432. @menu
  6433. * Bug Criteria:: Have you found a bug?
  6434. * Bug Reporting:: How to report bugs
  6435. @end menu
  6436. @node Bug Criteria
  6437. @section Have You Found a Bug?
  6438. @cindex bug criteria
  6439. If you are not sure whether you have found a bug, here are some guidelines:
  6440. @itemize @bullet
  6441. @cindex fatal signal
  6442. @cindex assembler crash
  6443. @cindex crash of assembler
  6444. @item
  6445. If the assembler gets a fatal signal, for any input whatever, that is a
  6446. @command{@value{AS}} bug. Reliable assemblers never crash.
  6447. @cindex error on valid input
  6448. @item
  6449. If @command{@value{AS}} produces an error message for valid input, that is a bug.
  6450. @cindex invalid input
  6451. @item
  6452. If @command{@value{AS}} does not produce an error message for invalid input, that
  6453. is a bug. However, you should note that your idea of ``invalid input'' might
  6454. be our idea of ``an extension'' or ``support for traditional practice''.
  6455. @item
  6456. If you are an experienced user of assemblers, your suggestions for improvement
  6457. of @command{@value{AS}} are welcome in any case.
  6458. @end itemize
  6459. @node Bug Reporting
  6460. @section How to Report Bugs
  6461. @cindex bug reports
  6462. @cindex assembler bugs, reporting
  6463. A number of companies and individuals offer support for @sc{gnu} products. If
  6464. you obtained @command{@value{AS}} from a support organization, we recommend you
  6465. contact that organization first.
  6466. You can find contact information for many support companies and
  6467. individuals in the file @file{etc/SERVICE} in the @sc{gnu} Emacs
  6468. distribution.
  6469. @ifset BUGURL
  6470. In any event, we also recommend that you send bug reports for @command{@value{AS}}
  6471. to @value{BUGURL}.
  6472. @end ifset
  6473. The fundamental principle of reporting bugs usefully is this:
  6474. @strong{report all the facts}. If you are not sure whether to state a
  6475. fact or leave it out, state it!
  6476. Often people omit facts because they think they know what causes the problem
  6477. and assume that some details do not matter. Thus, you might assume that the
  6478. name of a symbol you use in an example does not matter. Well, probably it does
  6479. not, but one cannot be sure. Perhaps the bug is a stray memory reference which
  6480. happens to fetch from the location where that name is stored in memory;
  6481. perhaps, if the name were different, the contents of that location would fool
  6482. the assembler into doing the right thing despite the bug. Play it safe and
  6483. give a specific, complete example. That is the easiest thing for you to do,
  6484. and the most helpful.
  6485. Keep in mind that the purpose of a bug report is to enable us to fix the bug if
  6486. it is new to us. Therefore, always write your bug reports on the assumption
  6487. that the bug has not been reported previously.
  6488. Sometimes people give a few sketchy facts and ask, ``Does this ring a
  6489. bell?'' This cannot help us fix a bug, so it is basically useless. We
  6490. respond by asking for enough details to enable us to investigate.
  6491. You might as well expedite matters by sending them to begin with.
  6492. To enable us to fix the bug, you should include all these things:
  6493. @itemize @bullet
  6494. @item
  6495. The version of @command{@value{AS}}. @command{@value{AS}} announces it if you start
  6496. it with the @samp{--version} argument.
  6497. Without this, we will not know whether there is any point in looking for
  6498. the bug in the current version of @command{@value{AS}}.
  6499. @item
  6500. Any patches you may have applied to the @command{@value{AS}} source.
  6501. @item
  6502. The type of machine you are using, and the operating system name and
  6503. version number.
  6504. @item
  6505. What compiler (and its version) was used to compile @command{@value{AS}}---e.g.
  6506. ``@code{gcc-2.7}''.
  6507. @item
  6508. The command arguments you gave the assembler to assemble your example and
  6509. observe the bug. To guarantee you will not omit something important, list them
  6510. all. A copy of the Makefile (or the output from make) is sufficient.
  6511. If we were to try to guess the arguments, we would probably guess wrong
  6512. and then we might not encounter the bug.
  6513. @item
  6514. A complete input file that will reproduce the bug. If the bug is observed when
  6515. the assembler is invoked via a compiler, send the assembler source, not the
  6516. high level language source. Most compilers will produce the assembler source
  6517. when run with the @samp{-S} option. If you are using @code{@value{GCC}}, use
  6518. the options @samp{-v --save-temps}; this will save the assembler source in a
  6519. file with an extension of @file{.s}, and also show you exactly how
  6520. @command{@value{AS}} is being run.
  6521. @item
  6522. A description of what behavior you observe that you believe is
  6523. incorrect. For example, ``It gets a fatal signal.''
  6524. Of course, if the bug is that @command{@value{AS}} gets a fatal signal, then we
  6525. will certainly notice it. But if the bug is incorrect output, we might not
  6526. notice unless it is glaringly wrong. You might as well not give us a chance to
  6527. make a mistake.
  6528. Even if the problem you experience is a fatal signal, you should still say so
  6529. explicitly. Suppose something strange is going on, such as, your copy of
  6530. @command{@value{AS}} is out of sync, or you have encountered a bug in the C
  6531. library on your system. (This has happened!) Your copy might crash and ours
  6532. would not. If you told us to expect a crash, then when ours fails to crash, we
  6533. would know that the bug was not happening for us. If you had not told us to
  6534. expect a crash, then we would not be able to draw any conclusion from our
  6535. observations.
  6536. @item
  6537. If you wish to suggest changes to the @command{@value{AS}} source, send us context
  6538. diffs, as generated by @code{diff} with the @samp{-u}, @samp{-c}, or @samp{-p}
  6539. option. Always send diffs from the old file to the new file. If you even
  6540. discuss something in the @command{@value{AS}} source, refer to it by context, not
  6541. by line number.
  6542. The line numbers in our development sources will not match those in your
  6543. sources. Your line numbers would convey no useful information to us.
  6544. @end itemize
  6545. Here are some things that are not necessary:
  6546. @itemize @bullet
  6547. @item
  6548. A description of the envelope of the bug.
  6549. Often people who encounter a bug spend a lot of time investigating
  6550. which changes to the input file will make the bug go away and which
  6551. changes will not affect it.
  6552. This is often time consuming and not very useful, because the way we
  6553. will find the bug is by running a single example under the debugger
  6554. with breakpoints, not by pure deduction from a series of examples.
  6555. We recommend that you save your time for something else.
  6556. Of course, if you can find a simpler example to report @emph{instead}
  6557. of the original one, that is a convenience for us. Errors in the
  6558. output will be easier to spot, running under the debugger will take
  6559. less time, and so on.
  6560. However, simplification is not vital; if you do not want to do this,
  6561. report the bug anyway and send us the entire test case you used.
  6562. @item
  6563. A patch for the bug.
  6564. A patch for the bug does help us if it is a good one. But do not omit
  6565. the necessary information, such as the test case, on the assumption that
  6566. a patch is all we need. We might see problems with your patch and decide
  6567. to fix the problem another way, or we might not understand it at all.
  6568. Sometimes with a program as complicated as @command{@value{AS}} it is very hard to
  6569. construct an example that will make the program follow a certain path through
  6570. the code. If you do not send us the example, we will not be able to construct
  6571. one, so we will not be able to verify that the bug is fixed.
  6572. And if we cannot understand what bug you are trying to fix, or why your
  6573. patch should be an improvement, we will not install it. A test case will
  6574. help us to understand.
  6575. @item
  6576. A guess about what the bug is or what it depends on.
  6577. Such guesses are usually wrong. Even we cannot guess right about such
  6578. things without first using the debugger to find the facts.
  6579. @end itemize
  6580. @node Acknowledgements
  6581. @chapter Acknowledgements
  6582. If you have contributed to GAS and your name isn't listed here,
  6583. it is not meant as a slight. We just don't know about it. Send mail to the
  6584. maintainer, and we'll correct the situation. Currently
  6585. @c (October 2012),
  6586. the maintainer is Nick Clifton (email address @code{nickc@@redhat.com}).
  6587. Dean Elsner wrote the original @sc{gnu} assembler for the VAX.@footnote{Any
  6588. more details?}
  6589. Jay Fenlason maintained GAS for a while, adding support for GDB-specific debug
  6590. information and the 68k series machines, most of the preprocessing pass, and
  6591. extensive changes in @file{messages.c}, @file{input-file.c}, @file{write.c}.
  6592. K. Richard Pixley maintained GAS for a while, adding various enhancements and
  6593. many bug fixes, including merging support for several processors, breaking GAS
  6594. up to handle multiple object file format back ends (including heavy rewrite,
  6595. testing, an integration of the coff and b.out back ends), adding configuration
  6596. including heavy testing and verification of cross assemblers and file splits
  6597. and renaming, converted GAS to strictly ANSI C including full prototypes, added
  6598. support for m680[34]0 and cpu32, did considerable work on i960 including a COFF
  6599. port (including considerable amounts of reverse engineering), a SPARC opcode
  6600. file rewrite, DECstation, rs6000, and hp300hpux host ports, updated ``know''
  6601. assertions and made them work, much other reorganization, cleanup, and lint.
  6602. Ken Raeburn wrote the high-level BFD interface code to replace most of the code
  6603. in format-specific I/O modules.
  6604. The original VMS support was contributed by David L. Kashtan. Eric Youngdale
  6605. has done much work with it since.
  6606. The Intel 80386 machine description was written by Eliot Dresselhaus.
  6607. Minh Tran-Le at IntelliCorp contributed some AIX 386 support.
  6608. The Motorola 88k machine description was contributed by Devon Bowen of Buffalo
  6609. University and Torbjorn Granlund of the Swedish Institute of Computer Science.
  6610. Keith Knowles at the Open Software Foundation wrote the original MIPS back end
  6611. (@file{tc-mips.c}, @file{tc-mips.h}), and contributed Rose format support
  6612. (which hasn't been merged in yet). Ralph Campbell worked with the MIPS code to
  6613. support a.out format.
  6614. Support for the Zilog Z8k and Renesas H8/300 processors (tc-z8k,
  6615. tc-h8300), and IEEE 695 object file format (obj-ieee), was written by
  6616. Steve Chamberlain of Cygnus Support. Steve also modified the COFF back end to
  6617. use BFD for some low-level operations, for use with the H8/300 and AMD 29k
  6618. targets.
  6619. John Gilmore built the AMD 29000 support, added @code{.include} support, and
  6620. simplified the configuration of which versions accept which directives. He
  6621. updated the 68k machine description so that Motorola's opcodes always produced
  6622. fixed-size instructions (e.g., @code{jsr}), while synthetic instructions
  6623. remained shrinkable (@code{jbsr}). John fixed many bugs, including true tested
  6624. cross-compilation support, and one bug in relaxation that took a week and
  6625. required the proverbial one-bit fix.
  6626. Ian Lance Taylor of Cygnus Support merged the Motorola and MIT syntax for the
  6627. 68k, completed support for some COFF targets (68k, i386 SVR3, and SCO Unix),
  6628. added support for MIPS ECOFF and ELF targets, wrote the initial RS/6000 and
  6629. PowerPC assembler, and made a few other minor patches.
  6630. Steve Chamberlain made GAS able to generate listings.
  6631. Hewlett-Packard contributed support for the HP9000/300.
  6632. Jeff Law wrote GAS and BFD support for the native HPPA object format (SOM)
  6633. along with a fairly extensive HPPA testsuite (for both SOM and ELF object
  6634. formats). This work was supported by both the Center for Software Science at
  6635. the University of Utah and Cygnus Support.
  6636. Support for ELF format files has been worked on by Mark Eichin of Cygnus
  6637. Support (original, incomplete implementation for SPARC), Pete Hoogenboom and
  6638. Jeff Law at the University of Utah (HPPA mainly), Michael Meissner of the Open
  6639. Software Foundation (i386 mainly), and Ken Raeburn of Cygnus Support (sparc,
  6640. and some initial 64-bit support).
  6641. Linas Vepstas added GAS support for the ESA/390 ``IBM 370'' architecture.
  6642. Richard Henderson rewrote the Alpha assembler. Klaus Kaempf wrote GAS and BFD
  6643. support for openVMS/Alpha.
  6644. Timothy Wall, Michael Hayes, and Greg Smart contributed to the various tic*
  6645. flavors.
  6646. David Heine, Sterling Augustine, Bob Wilson and John Ruttenberg from Tensilica,
  6647. Inc.@: added support for Xtensa processors.
  6648. Several engineers at Cygnus Support have also provided many small bug fixes and
  6649. configuration enhancements.
  6650. Jon Beniston added support for the Lattice Mico32 architecture.
  6651. Many others have contributed large or small bugfixes and enhancements. If
  6652. you have contributed significant work and are not mentioned on this list, and
  6653. want to be, let us know. Some of the history has been lost; we are not
  6654. intentionally leaving anyone out.
  6655. @node GNU Free Documentation License
  6656. @appendix GNU Free Documentation License
  6657. @include fdl.texi
  6658. @node AS Index
  6659. @unnumbered AS Index
  6660. @printindex cp
  6661. @bye
  6662. @c Local Variables:
  6663. @c fill-column: 79
  6664. @c End: