Top Banner
Asmc Macro Assembler Reference
689

Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Feb 18, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 2: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

ThisdocumentlistssomeofthedifferencesbetweenAsmc,JWasm,andMasm.

InThisSection

AsmcCommand-LineOptionDescribestheAsmccommand-lineoption.

AsmcErrorMessagesDescribesAsmcfatalandnonfatalerrormessagesandwarnings.

AsmcExtensionsProvideslinkstotopicsdiscussingMasmversusAsmc.

DirectivesReferenceProvideslinkstotopicsdiscussingtheuseofdirectivesinAsmc.

SymbolsReferenceProvideslinkstotopicsdiscussingtheuseofsymbolsinAsmc.

ChangeLog|Forum

Page 3: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 4: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcCommand-LineReference

Assemblesandlinksoneormoreassembly-languagesourcefiles.Thecommand-lineoptionsarecasesensitive.

ASMC[[options]]filename[[[[options]]filename]]

options

Theoptionslistedinthefollowingtable.

/[0|1|..|10][p]

SetCPU:0=8086(default),1=80186,2=80286,3=80386,4=80486,5=Pentium,6=PPro,7=P2,8=P3,9=P4,10=x86-64.[p]allowsprivilegedinstructions.

/assert Generate.assert(code).Sameas.assert:on./bin Generateplainbinaryfile.

/Cs Pushuserregistersbeforestack-frameiscreatedinaproc.

/coff GenerateCOFFformatobjectfile./Cp Preservescaseofalluseridentifiers./Cu Mapsallidentifierstouppercase(default).

/cui Linkswitchusedwith/pe--subsystem:console(default).

/Cx Preservescaseinpublicandexternsymbols.

/Dsymbol[[=value]]Definesatextmacrowiththegivenname.Ifvalueismissing,itisblank.Multipletokensseparatedbyspacesmustbeenclosedinquotationmarks.

/enumber Seterrorlimitnumber./elf Generate32-bitELFobjectfile./elf64 Generate64-bitELFobjectfile.

/EP Generatesapreprocessedsourcelisting(senttoSTDOUT).See/Sf.

/eq Don'tdisplayerrormessages./Fd[file] Writeimportdefinitionfile.

Page 5: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

/Fifile Forcefiletobeincluded./Fl[[filename]] Generatesanassembledcodelisting.See/Sf./Fofilename Namesanobjectfile./Fwfilename Seterrorsfilename.

/FPi Generatesemulatorfix-upsforfloating-pointarithmetic(mixedlanguageonly).

/FPi87 80x87instructions(default)./fpc Disallowfloating-pointinstructions./fpn SetFPU:0=8087,2=80287,3=80387.

/GcSpecifiesuseofFORTRAN-orPascal-stylefunctioncallingandnamingconventions.SameasOPTIONLANGUAGE:PASCAL.

/Gd SpecifiesuseofC-stylefunctioncallingandnamingconventions.SameasOPTIONLANGUAGE:C.

/gui Linkswitchusedwith/pe--subsystem:windows.

/Gv SpecifiesuseofVECTORCALL-stylefunctioncallingandnamingconventions.

/GzSpecifiesuseofSTDCALL-stylefunctioncallingandnamingconventions.SameasOPTIONLANGUAGE:STDCALL.

/homeparamsCopyRegisterParameterstoStack.Forcesparameterspassedinregisterstobewrittentotheirlocationsonthestackuponfunctionentry.

/Ipathname Setspathforincludefile./m[t|s|c|m|l|h|f] Setmemorymodel./mz GenerateDOSMZbinaryfile./ncname Setclassnameofcodesegment./ndname Setnameofdatasegment./nmname Setnameofmodule./ntname Setnameoftextsegment./nologo Suppressesmessagesforsuccessfulassembly.

/omf Generatesobjectmodulefileformat(OMF)typeofobjectmodule.

/pe GeneratePEbinaryfile,32/64-bit.

Page 6: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

/pf PreserveFlags(Epilogue/Invoke)./q Suppresscopyrightmessage./r Recursesubdirectorieswithuseofwildargs./Sa Turnsonlistingofallavailableinformation.

/safesehMarkstheobjectaseithercontainingnoexceptionhandlersorcontainingexceptionhandlersthatarealldeclaredwithSAFESEH.

/Sf Addsfirst-passlistingtolistingfile./Sg Turnsonlistingofassembly-generatedcode./Sn Turnsoffsymboltablewhenproducingalisting./Sp[n] Setsegmentalignment.

/swc SpecifiesuseofC-style.SWITCHconvention(default).

/swn Nojump-tablecreationin.SWITCH.

/swp SpecifiesuseofPascal-style.SWITCHconvention(autobreak).

/swr Allowsuseofregister[R|E]AXin.SWITCHcode.

/swt Allowsuseofjump-tablecreationin.SWITCHcode(default).

/Sx Turnsonfalseconditionalsinlisting./w Sameas/W0./Wlevel Setsthewarninglevel,wherelevel=0,1,2,or3./win64 Generate64-bitCOFFobject.

/ws[CodePage] StorequotedstringsasUnicode.SeeOPTIONWSTRING.

/WX Returnsanerrorcodeifwarningsaregenerated./X IgnoreINCLUDEenvironmentpath./Xc DisableAsmcextensions/zcw NodecorationforCsymbols./Zd Generatesline-numberinformationinobjectfile./Zf Makeallsymbolspublic./zf[0|1] SetFASTCALLtype:MS/OW./Zg GeneratecodetomatchMasm./Zi[0|1|2|3] Addsymbolicdebuginfo.

Page 7: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

/zlc NoOMFrecordsofdataincode./zld NoOMFrecordsoffarcall.

/zlf SuppressitemsinCOFF:Nofileentry./zlp SuppressitemsinCOFF:Nostaticprocs./zls SuppressitemsinCOFF:Nosectionauxentry./Zm EnableMASM5.10compatibility./Zne DisablenonMasmextensions./Zp[[alignment]] Packsstructuresonthespecifiedbyteboundary./Zs Performsyntaxcheckonly./zt<0|1|2> SetSTDCALLdecoration./Zv8 EnableMasmv8+PROCvisibility./zze Noexportsymboldecoration./zzs Storenameofstartaddress.

filename

Thenameofthefile.

EnvironmentVariables

INCLUDE Specifiessearchpathforincludefiles.

ASMC Specifiesdefaultcommand-lineoptions.

TEMP Specifiespathfortemporaryfiles.

SeeAlso

ASMCErrorMessages

Page 8: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 9: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcErrorMessages

TheerrormessagesgeneratedbyAsmccomponentsfallintothreecategories:

Fatalerrors(A1000-A1901):Theseindicateasevereproblemthatpreventstheutilityfromcompletingitsnormalprocess.Nonfatalerrors(A2000-A3021):Theutilitymaycompleteitsprocess.Ifitdoes,itsresultisnotlikelytobetheoneyouwant.Warnings(A4000-A8020):Thesemessagesindicateconditionsthatmaypreventyoufromgettingtheresultsyouwant.

Allerrormessagestakethefollowingform:

Utility:Filename(Line):[Error_type}(Code):Message_text

UtilityTheprogramthatsenttheerrormessage.

FilenameThefilethatcontainstheerror-generatingcondition.

LineTheapproximatelinewheretheerrorconditionexists.

Error_typeFatalError,Error,orWarning.

CodeTheunique5-or6-digiterrorcode.

Message_textAshortandgeneraldescriptionoftheerrorcondition.

SeeAlso

AsmcMacroAssemblerReference

Page 10: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

AsmcExtensions

ThemaingoalwithAsmcisanattempttoprovidemorereadabilitytotheassemblylanguagebasedonMasmsyntaxbutatthesametimekeepcompatibilitywithexistingsourcecode.InordertoachievethissomeofthemaincoreoftheassemblerhastoberewrittenandtheHLLsectionenhancedasdiscussedbelow.

InThisSection

ParsingoflabelsProvideslinkstotopicsdiscussingparsingoflabels.

ExpansionofmacrosProvideslinkstotopicsdiscussingexpansionofmacros.

TheinvokedirectiveProvideslinkstotopicsdiscussingtheinvokedirective.

TheHLLsectionProvideslinkstotopicsdiscussingtheHLLsection.

HandlingofstringsProvideslinkstotopicsdiscussinghandlingofstrings.

EnhancedvectorextensionProvideslinkstotopicsdiscussingEnhancedvectorextension.

SeeAlso

AsmcMacroAssemblerReference

Page 11: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 12: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

DirectivesReference

OPTIONoptionlist

Enablesanddisablesfeaturesoftheassembler.AddedoptionsbyASMCinclude:

OPTIONASMCOPTIONCSTACKOPTIONSWITCHOPTIONLOOPALIGNOPTIONCASEALIGNOPTIONWSTRING

ConditionalControlFlow

.IF

.WHILE

.REPEAT

.UNTILCXZ

.BREAK

.CONTINUE

.FOR

.SWITCH

.CASE

.ENDC

.GOTOSW

.DEFAULT

.ENDSW

.COMDEF

.CLASSDEF

.ENDS

.ASSERTFlagconditionsSignedcompareReturncode

SeeAlso

Page 13: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

SymbolsReference

Page 14: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 15: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

SymbolsReference

DateandTimeInformation

@Date

MacroFunctions

@CStr

SeeAlso

DirectivesReference

Page 16: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

0.Contents1.About2.CommandlineOptionsOptions-0,-1,-2,...,-10Option-binOption-coffOption-djgppOption-eOption-elfOption-elf64Option-eqOption-FdOption-FPiOption-FwOptions-Gc,-Gd,-Gr,-GzOption-mOption-mzOption-ncOptions-nd,-ntOption-nmOption-peOption-win64Option-zcOption-ZdOption-zfOption-ZgOption-ZiOptions-zlcand-zldOptions-zlf,-zlpandzlsOption-ZmOption-ZneOption-ztOption-Zv8Option-zzeOption-zzs

Page 17: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.SyntaxExtensions3.1DirectiveINCBIN3.2FASTCALLRegisterCallingConvention3.3IDsenclosedinBackQuotes3.4Floating-PointImmediatesinInstructions3.5DirectiveOPTIONFIELDALIGN3.6DirectiveOPTIONPROCALIGN3.7DirectiveOPTIONMZ3.8DirectiveOPTIONELF3.9DirectiveOPTIONWIN643.10DirectiveOPTIONFRAME3.11DirectiveOPTIONRENAMEKEYWORD3.12DirectiveOPTIONDLLIMPORT3.13DirectiveOPTIONCODEVIEW3.14DirectiveOPTIONSTACKBASE3.15DirectivesPUSHCONTEXT/POPCONTEXTALIGNMENT3.16Directives.X64and.X64p3.17AttributeLABELforfirstMacroParameter3.18MemberArgumentforIF[N]DEFand.ERR[N]DEF3.19InitializationofDataItemsofTypeMMWORD/XMMWORD3.20OptionalArraySizeforLABELDirective3.21OptionalNameArgumentforSimplifiedSegmentDirectives3.22SegmentAttributeCOMDAT3.23AttributeVARARGMLforlastMacroParameter3.24Miscellaneous3.24.1Numericconstant__JWASM__3.24.2OperatingSystemArgumentfor.MODEL3.24.3AcceptedParametersforIF[N]DEFDirective3.24.4VisibilityofProcedures3.24.5Non-RIP-RelativeAddressingin64-Bit4.InstructionSets5.CodeGenerationDifferences5.1ForwardReferencesinMacroExpressions6.OutputFormats6.1OMFOutputFormat6.2COFFOutputFormat6.3Win64OutputFormat6.4BinaryOutputFormat6.5PEOutputFormat

Page 18: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

7.MasmBugsfixedinJWasm8.OptionalFeatures9.KnownBugsandmissingFeatures10.LicenseAppendixA.ReservedWordsAppendixB.SourceSamplesAppendixC.ErrorsandWarningsAppendixD.DifferencesbetweenMasm6andMasm8AppendixE.Restrictionsofprecommpiled16-bitBinaryJWASMR.EXEAppendixF.AdditionalFeaturesofJWasm'sDebugVersion

Page 19: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

1.AboutThisdocumentliststhedifferencesbetweenJWasmandMasm,asfarastheuserinterfaceisconcerned.

WhenMasmismentioned,thenusuallyMasmv8.00ismeant,unlessstatedotherwise.Masmv8.00alsowasthefirstMasmversionsupporting64-bit(ML64.EXE).

TheMasmdocumentationitselfcanbefoundonnumerousplacesintheweb,inplaintext,HTML,PDFandWindowsHelpformat.However,it'susuallyjustthedocumentationthatcamewhithMasmv6.1-henceabitoutdatednowadays(thechangesfromMasmv6toMasmv8arelistedinAppendixD).

Page 20: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

2.CommandlineOptionsEntering'JWasm-?'or'JWasm-h'willmakeJWasmdisplaytheoptionsitunderstands.AlotofthemexistinbothMasmandJWasm,butsomearevalidforJWasmonly;OTOH,afewoptionsaremissinginJWasm.

Optionsareusuallyenteredviathecommandline.Additionally,whenstarting,JWasmwillsearchforenvironmentvariableJWASMandhandleitsimilartothewayMasmhandlesvariableML.Henceitisalsopossibletoenteroptionsviathismethod.

TheoptionsspecifictoJWasm-andalsotheoptionswhicharehandledsomewhatdifferentlybyJWasmcomparedtoMasm-willbehandledinthefollowingchapters.

Onemajordifferenceshouldbementionedhere:JWasmdoesneverlaunchalinkeronitsown(whichMasmdoesunlessoption-cisgiven).ThismakesafewMasmoptionsuselessforJWasm,andhencetheyarenotimplemented;seeChapterKnownBugsandmissingFeaturesfordetails.

Page 21: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Options-0,-1,-2,...,-10:SelectCpuOption[0|1|..|10]selectscpu/instructionset.Mostvaluescorrespondtocpudirectives:

0 .80861 .1862 .2863 .3864 .4865 .5866 .6867 .686and.MMX(P2)8 .686,.MMXandSSEinstructions(P3)9 .686,.MMX,SSEandSSE2instructions(P4)10 .x64(x86-64cpu)

Page 22: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-bin:SelectOutputFormatBinaryOption-binselectsoutputformatBINary.Theoutputmodule'sdefaultfileextensionwillbechangedfrom.OBJto.BIN.

Formoreinformation,seeBinaryOutputFormat.

ChapterOutputFormatslistsallavailableoutputformats.

Page 23: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-coff:SelectOutputFormatCOFFOption-coffselectsoutputformatCOFF.Themostcommonusefor-coffistoproducemodulesfor32-bitWindows.However,it'snotmandatorythattheoutputwillbe32-bitwith-coff;dependingonwhatcpuisselectedwhenthe.MODELdirectivewillbeparsed,theoutputmaybe32-or64-bit.

FormoreinformationaboutCOFF,seeCOFFOutputFormat.

ChapterOutputFormatslistsallavailableoutputformats.

Page 24: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-djgpp:SelectOutputFormatforDJGPP(optional)Option-djgppselectsDjgpp'svariantofCOFFasoutputformat.Sinceitisrarelyusednowadays,thisoptionisn'tactivatedintheprecompiledbinaries.SeeOptionalFeatureshowtoenableit.

ChapterOutputFormatslistsallavailableoutputformats.

Page 25: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-e:SeterrorlimitAllowstosetthenumberoferrorsafterwhichtheassemblyprocessisaborted.Thedefaultvalueis50.

Page 26: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-elf:Select32-bitOutputFormatELFOption-elfselectsoutputformatELF.JWasmwillproduceanobjectmodulein32-bitElfformat.

UseOPTIONELFtosetvaluesintheELFheader.

ChapterOutputFormatslistsallavailableoutputformats.

Page 27: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-elf64:Select64-bitOutputFormatELFOption-elf64selectsoutputformatELF64.JWasmwillproduceanobjectmodulein64-bitElfformat.Additionally,thisoptionwillsetcputox86-64andmodeltoFLAT.

UseOPTIONELFtosetvaluesintheELFheader.

ChapterOutputFormatslistsallavailableoutputformats.

Page 28: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-eq:SuppressErrorMessagesonScreenOption-eqwillsuppressdisplayingerrormessagesonthescreen.Theyarestillwrittenintoanerrorfile.

Page 29: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-Fd:WriteImportDefinitionsOption-FdmakesJWasmwriteimportdefinitionsinaformatunderstoodbyOpenWatcom'sWlinkandJWlink.Suchdefinitionswilltellthelinkerhowtoresolvetheexternalreference;noimportlibraryisneeded.ThisoptionisonlyusefulinconjunctionwithOPTIONDLLIMPORT(chapter3.12).Syntaxis:

-Fd[=file_name]

Iftheoptional<file_name>argumentisgiven,theimportdefinitionswillbewrittenintoafileofthisname.ThisistheonlywayforOpenWatcom'sWlinktopasstheinformation.

IfJWlinkisused,the<file_name>argumentmaybeomitted.ThenJWasmwillwritetheimportdefinitionsdirectlyintotheobjectmodule'slinkerdirectivesection(section".drectve").ThisworksforoutputformatsCOFFandELFonly.SeesampleWin32_7howtouseJWasmandJWlinktocreateaWindowsbinarywithoutimportlibs.

Page 30: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-FPi:ActivateFloating-PointEmulationOption-FPiactivates"inlineFPinstructionswithemulation".ThiswillmakeJWasmcreatefixupsforfloating-pointinstructionsifcodeis16bit.IfsupportedbythelinkerortheOS,theFPinstructionscanthenbereplacedbycallstoanFPemulatorifnocoprocessorexists.

Page 31: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-Fw:SetErrorFileNameOption-Fwwillsetthefilenameforwarninganderrormessages.Asdefault,thesemessagesarewrittentoafilewithanameequaltotheassemblysource,butwithextension.ERR.Syntaxis:

-Fwfile_name

Page 32: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Options-Gc,-Gd,-Gr,-Gz:SetDefaultCallingConventionThedefaultcallingconventionsetbytheseoptionsare:

-Gc Pascal-Gd C(decl)-Gr Fastcall-Gz Stdcall

Page 33: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-m:SelectMemoryModelOption-mgeneratesalinecontaininga.MODELdirectivetoselectamemorymodel.Syntaxis:

-m[t|s|m|c|l|h|f]

wherethevaluebehind'm'means:

t=tinys=smallm=mediumc=compactl=largeh=hugef=flat

Thisoptionisignoredifa64-bitoutputformat(-win64or-elf64)isactive.

Page 34: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-mz:SelectOutputFormatMZOption-mzselectsoutputformatMZ.ThiswillwriteabinaryinDOSMZformat.Themodule'sdefaultfileextensionwillbechangedfrom.OBJto.EXE.Allsymbolsinthemodulemustresolveinternally,noexternalsareallowed.Somevaluesinthe"MZ"headercanbeadjustedbydirectiveOPTIONMZ(seebelow).

Asinallbinaryformats,thelistingwillcontainabinarymap;seeBinaryOutputFormatformoredetails.

ChapterOutputFormatslistsallavailableoutputformats.

Page 35: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-nc:SetCodeClassNameOption-ncsetsthecodesegment'sclassnameifsimplifiedsegmentdirectivesareused(default:CODE).Syntaxis:

-nc=name

where<name>willbethecodesegment'sclassname.

Page 36: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Options-ndand-nt:SetDATAandCODESegmentNamesOptions-ndand-ntwillsetthenameofthedata/codesegmentsifsimplifiedsegmentdirectivesareused.Syntaxis:

-nt=name_of_code-nd=name_of_data

Thedefaultnamesare_TEXTforcodeand_DATAfordata.

Page 37: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-nm:SetModuleNameOption-nmsetsthemodulename.Syntaxis:

-nm=module_name

Thedefaultvaluefor<module_name>isthenameofthesourcefilewithoutextension.

Page 38: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-pe:CreateaPEBinaryOption-pewillmakeJWasmcreateabinaryinWindowsPEformat(32-and64-bit).Theoutputmodule'sdefaultfileextensionwillbechangedfrom.OBJto.EXE.

FormoredetailsaboutthePEformatseePEOutputFormat.

ChapterOutputFormatslistsallavailableoutputformats.

Page 39: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-win64:SelectOutputFormatWin64Option-win64makesJWasmproduceanobjectmoduleinPE32+format,the64-bitformatusedforWin64binaries.

Option-win64willalsosetcputox86-64,modeltoFLATanddefaultcallingconventiontoFASTCALL.ThisistomakeJWasmcompatiblewithMasm64(ML64.EXE).

WithOPTIONWIN64,parametersspecifictoWin64maybeset.

FormoreinformationaboutWin64,seeWin64OutputFormat.

ChapterOutputFormatslistsallavailableoutputformats.

Page 40: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-zc:SetNameDecorationforCThisoptionsetsthenamedecorationfortheC(akaCDECL)callingconvention.Therearetwovariants:

-zc[m|w]

-zcmisthedefault,Cnamesaredecoratedwithanunderscoreprefix.ThisisalsothewayMasmdoesit.Theothervariant,-zcw,omitstheprefixaltogether.Thisistheusual"decoration"inUnix/Linux.

Page 41: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-Zd:EmitLineNumberDebuggingInfoOption-ZdgenerateslinenumberdebuginformationforOMFandCOFFoutputformat.Forotherformats,thisoptionisignored.Linenumberinformationallowsadebuggertotracethebinaryonthesourcecodelevel.Debuggersthathavebeenverifiedtoworkwiththisoption:

MSCodeView OMF 16-bit,WindowsandDOSCDB,NTSD COFF 32-and64-bit,WindowsWinDbg COFF 32-and64-bit,WindowsMSVisualStudio2008 COFF 32-bit[1],WindowsMSVisualStudio2010 COFF 32-bit[1],WindowsOWWD/WDW OMF/COFF 16-and32-bit,WindowsandDOSPellesCIDE COFF 32-bit[1],WindowsBorlandTD/TDW/TD32 OMF 16-and32-bit,WindowsandDOS[1]:the64-bitversionofthissoftwareshouldalsobeabletodebug64-bitdebuggees.

Page 42: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-zf:SelectFASTCALLTypeOption-zfselectstheFASTCALLcallingconventiontypefor16-and32-bitcode.Syntaxis:

-zf[0|1]

Thedefaultvalue0isMSVCstyle,whilevalue1activatestheOpenWatcomfastcalltype.

Page 43: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-Zg:Masm-compatibleCodeGenerationOption-ZgmakesJWasmtryanexactcopyofMasm'scodegeneration,whichresultsinthefollowingchanges:

thedefaultprologueforprocedureswilluseadd[e]sp,-localsizeinsteadofsub[e]sp,localsize.thedefaultepilogueforprocedureswillalmostalwaysprefertogenerateopcodeLEAVEifpossible.expressions<reg>==0and<reg>!=0willgeneratecodeor<reg>,<reg>insteadofcmp<reg>,0.ifinvokemustextendanargument'ssizefromwordtodword,registereaxremainsunchanged.thesegmentvalueofFARexternalswillalwaysbeassumedunknown,nomatterwhethertheexternalisdefinedinsideoroutsideofasegmentblock.Thusthoselabelsareexcludedfrom"farcalloptimization".ifindirectaddressinguses2(32-or64-bit)registersandnoscalingfactorisusedandthesecondregisterisn'tESP/RSP,thentheregistersareswapped:thesecondbecomesbaseandthefirstbecomesindex(theregistersinanexpressionarecountedfromlefttoright).[sincev2.10,thisisstandardbehavior].

Page 44: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-Zi:EmitSymbolicDebuggingInfoOption-ZigeneratessymbolicdebugginginfoinCodeViewV4styleforOMFandCOFFoutputformat.Forotherformats,thisoptionisaccepted,butignored.Notethat-Ziwillalwaysenable-Zd(linenumberinformation).Debuggerswhichhavebeenverifiedtoworkwiththisoption:

MSCodeView 16-bit,WindowsandDOSMSCDBorNTSD 32-and64-bit,WindowsMSWinDbg 32-and64-bit,WindowsMSVisualStudio2008 32-bit[1],WindowsMSVisualStudio2010 32-bit[1],WindowsOpenWatcomWD/WDW 16-and32-bit,WindowsandDOSPellesCIDE 32-bit[1],Windows[1]:the64-bitversionofthissoftwareshouldalsobeabletodebug64-bitdebuggees.

Usuallyboththeassemblerandthelinkermustbetoldthatsymbolicdebugginginformationistobegenerated(withMSlink,thelinkeroptionis/DEBUG).

The-Zioptionacceptsanoptionalnumericargumenttocontrolthevolumeofinformationthatisemitted.Thevaluescurrentlyacceptedare:

0 Justglobalsymbolswillbewritten.

1Global&localsymbolswillbewritten.Nouser-definedtypesareincluded.Usuallythisreductiondoesnoharm,butmaydecreaselinkingtime-iflotsofmodulesaretobelinked,theeffectmaybequitesignificant.

2 Thisisthedefault.Global&localsymbolsanduser-definedtypesarewritten.3 Additionallyto2,symbolicconstants(equates)willbewritten.

AlsoseeOPTIONCODEVIEWforadditionalswitchestocontrolsymbolicdebuggingoutput.

Page 45: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Options-zlcand-zld:ControlContentofOMFOutputModuleOptions-zlcand-zlddoreducesizeoftheOMFoutputmodule.Theymightbeusefuliflotsof-small-modulesaretobeassembledandputintoastaticlibrary.Also,theOMFcomentrecordswrittenif-zlcor-zldisNOTsetmaynotbeacceptedbyalllinkers.

Option-zlc:suppresseswritingOMFcomentrecordsaboutdatainCodesegments.Theserecordsmayhelpadisassemblertoproducenicerlistings.

Option-zld:suppresseswritinganOMFcomentrecordforeachCodesegmenttellingthelinkerthatfarcallstotargetsinthesamesegmentsshouldbeoptimized.Thisismoreorlessafeaturefor16-bitcodeonly.

Page 46: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Options-zlf,-zlpand-zls:ControlContentofCOFFOutputModuleOptions-zlf,-zlpand-zlsdoreducesizeoftheCOFFoutputmodule.Theymightbeusefuliflotsof-small-modulesaretobeassembledandputintoastaticlibrary.

Option Meaning

-zlfsuppressesthe@fileentryintheCOFFsymboltable.Thisentryisusuallyusedfordebuggingpurposesonlyandhencea-prettysmall-amountofspacecanbesaved.

-zlp

suppressesstatic(=private)procedurestobeincludedintotheCOFFsymboltable-aslongastheyaren'treferencedabsolutely.Suchproceduresaren'tneededforthelinkingprocess.However,sincethelinkerhasnoknowledgeofthemthen,theywillalsodisappearfromthelinker-generatedmap-file.

-zlssuppressestheauxiliaryentriesforsectionsintheCOFFsymboltable.Theseentriesmaynotbeneededinallcasesandthusalittlespaceissaved.

Page 47: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-Zm:EnableMasmv5CompatibilityOption-Zm(orsettingOPTIONM510)willdo:

-setOPTIONOLDSTRUCTS-setOPTIONDOTNAME-setOPTIONSETIF2:TRUE-setOPTIONOFFSET:SEGMENT(ifnomodelisset)-setOPTIONNOSCOPED(ifnomodelwithlanguagespecifierisset)-allowtodefinedataitemsbehindcodelabels-allow"invalid"useofREP/REPE/REPNEinstructionprefixes-changeprecedenceof[]and()operatorfrom1to9.Henceexpression-5[bx]isparsedas(-5)[bx],whilewithout-Zmitisparsedas-(5[bx]),whichgeneratesanerror.

OtherMasmv5.1compatibilityoptionsaren'timplementedyet.

Page 48: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-Zne:DisableJWasmSyntaxExtensionsOption-Znewilldisablesyntaxextensionswhicharen'tsupportedbyMasm.Currentlytheseare:

-directiveINCBIN-callingconventionFASTCALL-IDsenclosedinbackquotes-floating-pointimmediateoperandsininstructions-directiveOPTIONFIELDALIGN-directiveOPTIONPROCALIGN-directiveOPTIONMZ-directiveOPTIONELF-directiveOPTIONWIN64-directiveOPTIONFRAME-directiveOPTIONRENAMEKEYWORD-directiveOPTIONDLLIMPORT-directiveOPTIONCODEVIEW-directiveOPTIONSTACKBASE-directivesPUSHCONTEXT/POPCONTEXTALIGNMENT-attributeLABELforfirstmacroparameter-memberargumentforIF[N]DEFand.ERR[N]DEFdirectives-integerinitializervaluesforitemsoftype[X]MMWORD-optionalnameargumentfor.DATA,.DATA?and.CONSTdirectives-forwardreferencesinargumentsforINVOKEdprocedures-overridesinsidesquarebracketsforbase/indexregisters-OptionalArraySizeforLABELDirective

Somedirectivesaren'ttouchedbythisoption,althoughMasmwon'tacceptthem:

.X64and.X64pINVOKEin64-bitmoderuntimeconditionaldirectives.IF,.REPEAT,.WHILEin64-bitmode

Page 49: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Ifthesedirectivesaretobedisabled,itmustbedonewithOPTIONNOKEYWORD.

Page 50: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-zt:SetNameDecorationforSTDCALLOption-ztwillfine-tunenamedecorationforSTDCALLsymbols.Syntaxis:

-zt[0|1|2]

wherevalue0willdisablenamedecoration,value1willjustaddanunderscoreprefixandvalue2-whichisthedefault-willemitfullSTDCALLnamedecorationasexpectedbymostlinkers.

Option-zt0willmakeobjectmodulescompatibletoALINK+Win32.lib.ItmayalsoeaseaddingassemblymodulestoBorland'sC++BuilderorDelphiprojects.

Page 51: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-Zv8:EnableMasmv8ProcedureVisibilityOption-Zv8changeshandlingofprocedurevisibilitytothewaydonebyMasmv8+.SeeVisibilityofProceduresfordetails.

Page 52: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-zze:DisableExportNameDecorationOption-zzesuppressesnamedecorationforprocedureswiththeEXPORTattribute(exportednameonly).

Page 53: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Option-zzs:AvoidWlinkCOFFIncompatibilityOption-zzsiskindofaworkaroundforaWlinkincompatibility.It'susefultobesetif1)thesourcemodulehasastartingaddress,2)outputformatisCOFFAND3)Wlinkistobeusedaslinker.

Page 54: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.SyntaxExtensionsThischapterdescribesthesyntaxextensionsofJWasmcomparedtoMasmv8.

Page 55: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.1DirectiveINCBINThisdirectiveallowstoincludethecontentsofafileintotheobjectmodule.Syntaxis

INCBINfilename[,startingoffset[,maxsize]]

<filename>shouldbeenclosedin<>ordoublequotes.

Page 56: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.2FASTCALLRegisterCallingConventionIn16-and32-bitmode,onemayuseeithertheMicrosoftortheWatcomregistercallingconvention.It'sselectedbyoption-zf.

TheMicrosoftFASTCALLconventionusesregistersAX,DXandBXin16-bitforthefirst3parameters,andregistersECXandEDXin32-bitforthefirst2parameterswhicharesmallenoughtofitintoaregister.

TheOpenWatcomfastcallconventionusesuptofourregisters(E/AX,E/DX,E/BX,E/CX).

In64-bitmode,FASTCALLmeansthestandardWindows64ABIifoutputformatisnotELF.For-elf64,thereisnoFASTCALLsupportimplementedyet.

TomakeFASTCALLthedefaultcallingconvention,thereare3ways:

Commandlineoptions-Gr(or-win64)Secondargumentofthe.MODELdirective:.MODELFLAT,FASTCALLDirectiveOPTIONLANGUAGE:FASTCALL

Page 57: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.3IDsenclosedinBackQuotesIDscanbeenclosedinbackquotes(`)andthustheycancontaincharactersnotallowedin"normal"IDs.However,thereisatleastonecasewhereIDsinbackquoteswon'tberecognized:iftheexpansionoperator(%)islocatedatposition0inaline.

Exampleusingbackquotes:

Module1:

`functionname.with.dots`PROCCPUBLICa1:dword

Module2:

`functionname.with.dots`PROTOC:dword

.code

INVOKE`functionname.with.dots`,1

SinceIDsinbackquotesarenot100%compatiblewith"normal"IDs,itmightbeconsideredtousetheALIASdirectiveinstead.Beawarethat,sincethealiashandlingisalinkertask,itisnecessarytodefinebothnames,thealiasnameandthetargetname,aspublic.

Page 58: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.4Floating-PointImmediatesinInstructionsFloating-pointimmediatevaluesareacceptedasinstructionoperands.Asdefault,thetypeisaREAL4,whichhasamagnitudeof32bits:

moveax,1.0

Withtypecoercion,it'salsopossibletodefinea64-bit"double",althoughit'sprobablyusefulin64-bitcodeonly:

movrax,real8ptr1.0

Additionally,operatorsLOW32andHIGH32acceptafloating-pointconstantasargument.Inthiscase,theconstantisassumedtohaveformatREAL8.Thusit'spossibletopassadoubleconstantdirectlyasaprocedureargumentin32-bitcode:

pushHIGH321.0

pushLOW321.0

callWorkWithReal8Value

Page 59: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.5DirectiveOPTIONFIELDALIGNOPTIONFIELDALIGNsetsthedefaultvalueforstructurealignment.Thedefaultvalueis1orthevaluesetbycmdlineswitch-Zp.Syntaxis:

OPTIONFIELDALIGN:[1|2|4|8|16|32]

Thecurrentdefaultvaluecanbesaved/restoredwithdirectivesPUSHCONTEXT/POPCONTEXTALIGNMENT,

Page 60: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.6DirectiveOPTIONPROCALIGNWithOPTIONPROCALIGNparameterit'spossibletoautomaticallyalignprocedures.Syntaxis:

OPTIONPROCALIGN:[1|2|4|8|16|32]

Thedefaultvalueis1.Thecurrentvaluecanbesaved/restoredwithdirectivesPUSHCONTEXT/POPCONTEXTALIGNMENT,

Example:

.386

.modelflat,stdcall

optionPROCALIGN:16

.code

proc1PROC

ret

proc1endp

proc2PROC

ret

proc2endp

end

Thelistingshowsthatstartaddressofproc2isalignedto16(=10h):

00000000proc1PROC

00000000ret

00000000C3*retn

00000001proc1endp

00000010proc2PROC

00000010ret

00000010C3*retn

00000011proc2endp

Note:toensurethattheproceduresarealignedinthefinalbinaryasitissupposedbytheOPTIONPROCALIGNvalue,thealignmentofthecurrentcode

Page 61: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

segmentmustbeatleastthevalueofOPTIONPROCALIGN.

Page 62: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.7DirectiveOPTIONMZDirectiveOPTIONMZallowstofine-tunethevalueswrittentotheMZheaderifoutputformatMZ(see-mzcmdlineoption)isselected.Forotheroutputformats,thisoptionhasnoeffect.Thesyntaxforthedirectiveis:

OPTIONMZ:[start_fixups][:header_align][:heap_min][:heap_max]

Theparametersare:

start_fixups offsetwithintheheaderwheresegmentfixupswillstart.Thesizeoftheheaderwillalwaysbeatleastthisvalue,eveniftherearenofixupsatall.Default-andminimum-valueis1Eh.

header_align alignmentoftheheader(includingsegmentfixups).Valuemustbeapowerof2,10histhedefaultandminimum.

heap_min theadditionalspace(inparagraphs)whichisneededbythebinarytorun.DefaultisthetotalofthesizesoftheuninitializedBSSandSTACKsegments.

heap_max space(inparagraphs)whichthebinarywouldliketohave.DefaultisFFFFh.

Page 63: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.8DirectiveOPTIONELFDirectiveOPTIONELFallowstofine-tunethevalueswrittentotheELFheaderifoutputformatELF(see-elfor-elf64)isselected.Forotheroutputformats,thisoptionhasnoeffect.Thesyntaxforthedirectiveis:

OPTIONELF:osabi

Theonlyargument<osabi>willbecopiedtotheELFheaderfieldEI_OSABI.It'sanumericconstant,andaccordingtotheelfspecssomevalidvaluesare:

0 ELFOSABI_NONE unspecified1 ELFOSABI_HPUX HP-UX2 ELFOSABI_NETBSD NetBSD3 ELFOSABI_LINUX Linux,default6 ELFOSABI_SOLARIS SunSolaris7 ELFOSABI_AIX IBMAIX9 ELFOSABI_FREEBSD FreeBSD12 ELFOSABI_OPENBSD OpenBSD

Page 64: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.9DirectiveOPTIONWIN64DirectiveOPTIONWIN64allowstosetparametersfortheWin64outputformatifthisformat(see-win64cmdlineoption)isselected.Forotheroutputformats,thisoptionhasnoeffect.Thesyntaxforthedirectiveis:

OPTIONWIN64:switches

acceptedvaluesforswitchesare:

StoreRegisterArguments[bit0]:-0:the"homelocations"(alsosometimescalled"shadowspace")ofthefirst4registerparametersareuninitialized.Thisisthedefaultsetting.-1:registercontentsofthePROC'sfirst4parameters(RCX,RDX,R8andR9)willbecopiedtothe"homelocations"withinaPROC'sprologue.

INVOKEStackSpaceReservation[bit1]:-0:foreachINVOKEthestackisadjustedtoreservespacefortheparametersrequiredforthecall.Afterthecall,thespaceisreleasedagain.Thisisthedefaultsetting.-1:themaximumstackspacerequiredbyallINVOKEsinsideaprocedureiscomputedbytheassemblerandreservedonceontheprocedure'sentry.It'sreleasedwhentheprocedureisexited.IfINVOKEsaretobeusedoutsideofprocedures,thestackspacehastobereservedmanually!Note:anassemblytimevariable,@ReservedStack,iscreatedinternallywhenthisoptionisset.Itwillreflectthevaluecomputedbytheassembler.Itshouldalsobementionedthatwhenthisoptionison,andaprocedurecontainsnoINVOKEsatall,thenneverthelesstheminimalamountof4*8bytesisreservedonthestack.Warning:YoushouldhaveunderstoodexactlywhatthisoptiondoesBEFOREyou'reusingit.UsingPUSH/POPinstructionpairsto"save"valuesacrossanINVOKEisVERBOTENifthisoptionison.

16-byteAlignmentforLocalStackVariables[bit2]:0:standard8-bytealignmentforlocalvariables.1:16-bytealignmentforlocalvariables.ThissettingisusefulifyouwanttoloadorstoreXMMregisterswithinstructionsthatexpectalignedmemory

Page 65: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

references(i.e.MOVAPS).Notethatvariableswithsize<16arenotaffected.

Page 66: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.10DirectiveOPTIONFRAMEThisoptionaffects64-bitonly.ItallowstomakeJWasmautomaticallygenerateprologuesandepiloguesforprocedureswiththeFRAMEattribute.ThusthecodecompliestotherulesofWin64SEH(StructuredExceptionHandling).Syntaxis

OPTIONFRAME:<AUTO|NOAUTO>

AUTOwillenablethisfeature,NOAUTO(whichisdefault)disablesit.

Theunwindinformationwhichisgeneratedis"complete",thatis,itcontainsthe".endprologue"pseudo-opalready.Toallowtosaveallnon-volatileregistersintheprologue,the"USES"phraseismorecapableinthismodeandwillacceptXMMregisterstobesavedandrestored.

Page 67: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.11DirectiveOPTIONRENAMEKEYWORDThisoptionallowstorenameakeyword,soitcanbeusedunderadifferentname.Syntax:

OPTIONRENAMEKEYWORD:<current_name>=new_name

current_nameisthecurrentnameofthekeywordandmustbeenclosedinanglebrackets.new_namemustbeavalididentifier.Ifakeywordistoberenamed,itshouldbedoneatthebeginningofthesource,andakeywordshouldn'tberenamedmultipletimes.Sincev2.11,akeywordmayberenamedtemporarilyandmultipletimes.

Page 68: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.12DirectiveOPTIONDLLIMPORTa)UsingOPTIONDLLIMPORT

ThisoptionmakestheassemblerassumethatallPROTOsthatfollowthisdirectiverepresentfunctionslocatedinadll.Syntax:

OPTIONDLLIMPORT:<dll_name>|NONE

<dll_name>mustbeenclosedinanglebrackets.ArgumentNONEwillswitchbacktothedefaultmode.

b)CodeGenerationEffects

TheeffectsofsettingthisoptionsaresubtleandusefulonlyforMSWindowsapplications:ifthefunctiondescribedbytheprototypeiscalledviaINVOKE,slightlymoreefficientcodethannormalisgenerated,becausethefunction'saddressintheIATisused.Example:

INVOKEGetModuleHandle,NULL

codegenerationwithOPTIONDLLIMPORT:

pushNULL

callDWORDPTR[_imp__GetModuleHandle@4]

codegenerationwithoutOPTIONDLLIMPORT:

pushNULL

call_GetModuleHandle@4

...

_GetModuleHandle@4:

jmpDWORDPTR[_imp__GetModuleHandle@4];stubaddedbythelinker

c)OPTIONDLLIMPORTinConjunctionwith-FdSwitch

Page 69: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Optionally,byusingcmdlineoption-Fd,JWasmwillwritetheimportinformationreceivedthroughOPTIONDLLIMPORTlinestoeitherafileordirectlyintotheobjectmodule(COFFandELFonly).Example:

.386

.modelflat,stdcall

optiondllimport:<kernel32>

GetModuleHandleAproto:dword

ExitProcessproto:dword

optiondllimport:none

.code

invokeGetModuleHandleA,0

invokeExitProcess,0

end

JWasm-coff-Fd=lnk.rspsample.asm

Aftertheassemblystep,filelnk.rspwillcontain:

import'_ExitProcess@4'kernel32.ExitProcessimport'_GetModuleHandleA@4'kernel32.GetModuleHandleA

BothOpenWatcom'sWlinkandJWlinkwillbeabletodirectlyusethisinformationandhence,asaresult,nofurtherWindowsimportlibrariesareneededinthelinkstep:

[email protected]

JWlinkmayevengoonestepfurther-it'sabletoreadimportdefinitionscontainedinaCOFForELFmodule'slinkerdirectivesection(named".drectve").Thereforeonecanomitthefilenameargumentfor-Fd.SampleWin32_7demonstratestheusage.

d)OPTIONDLLIMPORTinConjunctionwith-peSwitch

IfoutputformatPEisselected,usingOPTIONDLLIMPORTistheonlywaytoresolveexternalreferences;seePEOutputFormatformoreinformation.

Page 70: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.13DirectiveOPTIONCODEVIEWTheOPTIONCODEVIEWdirectiveallowstofine-tunethegenerationofsymbolicdebugginginformation.Ithasnoeffectatallifcommandlineoption-Ziisn'tset.Syntax:

OPTIONCODEVIEW:switches

Thereiscurrentlyonlyoneswitch:

[bit0]:If1,createsymbolswithindicesS_[L|G]THREAD32insteadofS_[L|G]DATA32fordataitemsthatarestoredinsegmentswithclass'TLS'.ThisallowsthedebuggertodisplaythecorrectvalueofstaticTLS(ThreadLocalStorage)variables.Example:

optioncodeview:1

_TLSsegmentdwordalias(".tls")public'TLS'

tvarDD-1;codeviewsymboltvarwillbeS_LTHREAD32

_TLSends

Page 71: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.13DirectiveOPTIONSTACKBASETheOPTIONSTACKBASEdirectiveallowstochangethewayhowstackvariables-definedbythePROCandLOCALdirectives-areaccessed.Syntaxis:

OPTIONSTACKBASE:register

registerwillbetheindexregisterthatisusedforaccessingthestackvariables.The"natural"registerforaccessingthesevariablesisthe[E|R]BPregister(the"framepointer").WithOPTIONSTACKBASEonemightsetanyindexregisterasframepointer.

OPTIONSTACKBASEwilladditionallydefineassembly-timevariable@StackBase.Theassemblerwilladdthevalueofthisvariabletotheeffectiveaddressofstackvariables.@StackBasecanbemodifiedjustlikeanyuserdefinedvariable-however,itisinitializedtozerobythePROCdirective.Thepurposefortheintroductionof@StackBaseistomakeitfeasibletousethe"volatile"stack-pointer(ESP/RSP)registerasbaseforaccessingstackvariables.

Finally,OPTIONSTACKBASEwilldefineanotherassembly-timevariable:@ProcStatus.Thisvariableisread-onlyandwillallowtoqueryinformationaboutthecurrentprocedure'sstatus.Theinformationthatisreturnedby@ProcStatusis:

Bit Meaningifbitis10 insideprologueofcurrentprocedure.1 insideepilogueofcurrentprocedure.2 "frame-pointeromission"isonforprocedure7 prologueofcurrentprocedureisn'tcreatedyet

Page 72: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.15DirectivesPUSHCONTEXT/POPCONTEXTALIGNMENTThePUSHCONTEXT/POPCONTEXTdirectivesunderstandnewqualifierALIGNMENT,whichsaves/restorescurrentvaluesofFIELDALIGNandPROCALIGNoptions.

Note:inJWasmv2.00-2.09,PUSHCONTEXT/POPCONTEXTALLdidincludethesealignmentvalues.SinceJWasmv2.10,thisisnolongertrue;thisbehaviorismoreMasm-compatible.

Page 73: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.16Directives.X64and.X64pThesedirectivesselecta64-bit(x86-64)cpu.Incontrastto.X64,.X64pwillallowtouseprivilegedinstructions.

The.X64directiveisn'tneededusually,becauseforoutputformatsWIN64(see-win64)andELF64(see-elf64),.X64isthedefault.

The.X64pdirectiveisusefulformixed-modelbinariesorsystemsoftware(seeexampleDOS64).

Whenthecpuissetto64-bit,theSEGMENTdirectiveacceptsanew'size'value:USE64.Ittellstheassemblerthatthissegment'soffsetis64-bitwideanduses64-bitinstructions.

TheSYSCALLcallingconventionisrenamedtoSYSCALL_when64-bitison,becausethereexistsaSYSCALLinstructionmnemonicinthismode.

Page 74: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.17AttributeLABELforfirstMacroParameterTheLABELattributeforthefirstmacroparameterallowsaccesstoalabelwhichisassignedtothemacro.Syntaxis:

<macro_name>MACRO<param_name>:LABEL[,<param_name>[,...]]

TheLABELattributeisacceptedforthefirstparameteronly.Amacrowithsuchaparametercanbeinvokedinthefollowingway:

<label><macro_name>[<argument>,...]

Example:

foomacrolbl:LABEL,first,second

lbldbfirst

dwsecond

endm

.data

data1foo1,1000

data2foo2,2000

Notethatacodelabel(thatis,alabelfollowedbyacolonordouble-colon)isparsedBEFOREthemacroisevaluated,hencesuchalabelwillhavebeendefinedalreadywhenthemacro"runs".

Page 75: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.18MemberArgumentforIF[N]DEFand.ERR[N]DEFDirectivesSincev2.07,JWasm'simplementationofIF[N]DEF-and.ERR[N]DEF-willadditionallyacceptastructmemberasargument.Thissyntaxrequiresafullyqualifiedname:

IFDEF<struct_name>.<member_name>

Page 76: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.19InitializationofDataItemswithTypeMMWORD/XMMWORDFordataitemsoftypesMMWORDorXMMWORD,JWasmwillacceptintegervaluesforinitialization:

vmm1MMWORD1122334455667788h

vxmm1XMMWORD112233445566778899AABBCCDDEEFFh

Masmwillacceptjustfloating-pointinitializersfordataitemsoftype[X]MMWORD.It'sevenworse,sincefloating-pointinitializersaresilentlyignoredfordataitemswithsizes!=4,8and10;sinceXMMWORDhassize16,it'simpossibletoinitializesuchanitemdirectly.JWasmcopiesthisMasmbehavior,buttoallowtoinitializeaXMMWORDwithafloating-pointvalue,onemayusetypecoercion:

vxmm1XMMWORDreal4ptr1.0;bytes4-15willbe0

vxmm2XMMWORDreal8ptr1.0;bytes8-15willbe0

VariantsthatworkinbothJWasmandMasm,andalsoallowtoinitializethefullXMMWORDare:

vxmm1LABELXMMWORD

real41.0,2.0,3.0,4.0

vxmm2LABELXMMWORD

real81.0,2.0

Page 77: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.20OptionalArraySizeforLABELDirectiveTheLABELdirectiveacceptsanoptionalarraysizeargument:

myarrayLABELword:10;myarrayisassumedtobeanarrayof10words

dw1,2,3,4,5,6,7,8,9,10

Pleasenotethatthearraysizeargumentdefinesthearray'snumberofelements,notthearray'ssizeinbytes.

Thisextensionallowstodefinelargeinitializedarrays,notrestrictedbylinesizelimits.TheSIZEOFandLENGTHOFoperatorswillreturnthesamevaluesasifthearrayhadbeendefinedviatheDUPoperator.

Thearraysizeargumentmaybeaforwardreference:

myarrayLABELword:size_myarray/sizeofword

dw1,2,3,4,5,6,7,8,9,10

size_myarrayequ$-myarray

Page 78: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.21OptionalNameArgumentforSimplifiedSegmentDirectivesMasmallowsanoptionalargumentforsimplifiedsegmentdirectives.CODE,.FARDATAand.FARDATA?.Thisistosetthenameofthesegmentthatistobeopened.JWasmwillalsoacceptthenameargumentforthosedirectives;additionally,it'sacceptedfor.DATA,.DATA?and.CONSTdirectives.

Page 79: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.22SegmentAttributeCOMDATWithsegmentattributeCOMDATonemaydefineCOMDATsections.ACOMDATsectionisasectionthatcanbedefinedbymorethanoneobjectfile.ACOMDATsectionmustcontainatleastonesymbol,theCOMDATsymbol.Thesyntaxtodefinethesectionis:

segnameSEGMENTCOMDAT(selection[,assoc_segment])...

TheselectionargumenttellsthelinkerwhattodoifmultipledefinitionsofaCOMDATsymbolarefound;theacceptedvaluesare:Value Description

1 noduplicates

Ifthesymbolisalreadydefined,thelinkerissuesa"multiplydefinedsymbol"error.

2 any AnysectionthatdefinesthesameCOMDATsymbolcanbelinked;therestareremoved.

3 samesizeThelinkerchoosesanarbitrarysectionamongthedefinitionsforthissymbol.Ifalldefinitionsarenotthesamesize,a"multiplydefinedsymbol"errorisissued.

4 exactmatch

Thelinkerchoosesanarbitrarysectionamongthedefinitionsforthissymbol.Ifalldefinitionsdonotmatchexactly,a"multiplydefinedsymbol"errorisissued.

5 associative ThesectionislinkedifacertainotherCOMDATsection(seetheassoc_segmentinthesyntaxdescription)islinked.

6 largestThelinkerchoosesthelargestdefinitionfromamongallofthedefinitionsforthissymbol.Ifmultipledefinitionshavethissize,thechoicebetweenthemisarbitrary.

CurrentlysupportforCOMDATisrestrictedtoCOFF.

JWasmwon'tdoanythingspecialwithCOMDATsections;infuturereleasesthismaychange:cmdlineoptionssimilartotheMicrosoftVCcompileroptions-Gfor-Gymaybeadded.

TocreateanobjectmodulethatplaceseachfunctioninitsownCOMDAT

Page 80: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

section(asitisdonebyMSVCifthe-Gyoptionisgiven),itisrecommendedtouseCOMDATinconjunctionwithALIAS:

_TEXT_proc1segmentflatcomdat(1)alias(".text")

proc1procc

...

proc1endp

_TEXT1_proc1ends

_TEXT_proc2segmentflatcomdat(1)alias(".text")

proc2proccprivate

...

proc2endp

_TEXT2_proc2ends

_TEXT_proc3segmentflatcomdat(1)alias(".text")

proc3procc

...

proc3endp

_TEXT_proc3ends

Page 81: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.23AttributeVARARGMLforlastMacroParameterVARARGMLhasmostlythesameeffectsasattributeVARARG;thedifferenceisthatVARARGMLwillmaketheassemblerconcatlinesifthelastcharacteronthelineisacomma.

Page 82: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.24Miscellaneous3.24.1Numericconstant__JWASM__3.24.2OperatingSystemArgumentfor.MODEL3.24.3AcceptedParametersforIF[N]DEFDirective3.24.4VisibilityofProcedures3.24.5Non-RIP-RelativeAddressingin64-Bit

Page 83: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.24.1Numericconstant__JWASM____JWASM__isapredefinedsymbol,itsvalueisthecurrentJWasmversion*100,thatis,forv1.9thevalueis190.Thepredefinedtextequate@Versionwon'tcontainJWasm'sversion,forcompatibilityreasonsithasvalue<800>(sincev2.06,previouslythevaluewas<615>).

Page 84: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.24.2OperatingSystemArgumentfor.MODELThe.MODELdirectivehasanoptional"operatingsystem"argument.MasmacceptsvalueOS_DOSonly,JWasmacceptsvaluesOS_DOSandOS_OS2.Thissettingwillaffectthegeneratedcodeofdirectives.STARTUPand.EXITfor16-bitmemorymodels.

Page 85: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.24.3AcceptedParametersforIF[N]DEFDirectiveMasm'sIF[N]DEFdirectiveacceptsuser-definedsymbolsandregisters,butfailsforinstructions,directivesandotherreservedwords.JWasm'sIF[N}DEFimplementationacceptsthosesymbolsaswell.OTOH,JWasmisabitmorepickyandwilldisplayawarningifmorethanoneitemisfoundbehindthedirective-Masmjusttakesthefirstandsilentlyskipstherest.

AlsoseeMemberArgumentforIF[N]DEFand.ERR[N]DEFDirectives.

Page 86: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.24.4VisibilityofProceduresWhenaPROTOorEXTERNDEFdirectiveforasymbolislocatedinamodulebeforeamatchingPROCdirective,thevisibilityofthisProcedure("public"vs"private",or"external"vs."static")ishandleddifferentlyinMasmv6or7andMasmv8ornewer:

SinceMasmv8,aPROTOorEXTERNDEFforasymbolwhichislaterdefinedasaPROCwillmaketheprocedurepublic,nomatterwhatapossiblevisibilityattributeofthePROCitself-orthedefaultonesetwithOPTIONPROC-istelling.

OTOH,withMasmv6/7,boththevisibilityattributeofthePROCdirectiveandthecurrentdefaultsettingofOPTIONPROCwillaffectthesymbol'svisibility.

Masm6Masm8JWasmJWasm+Zv8

-------------------------------------

On,E,Pxx

On,E,Pnxx

On,E,Ppxxxx

Op,E,Pxxxx

Op,E,Pnxxx

Op,E,Ppxxxx

On=OPTIONPROC:PRIVATE

Op=OPTIONPROC:PUBLIC

E=PROTOorEXTERNDEFbeforePROC

P=PROCwithoutvisibilityattribute

Pn=PROCwithPRIVATEvisibilityattribute

Pp=PROCwithPUBLICvisibilityattribute

x=procedurewillbepublic

Asdefault,JWasmmoreorlesscopiestheMasmv6/7behavior.ThedifferenceisthatanexplicitevisibilityattributebehindPROChasthehighestpriorityforJWasm.However,sincev2.04,there'sanadditionalcmdlineoption-Zv8whichwillmakeJWasmbehavelikeMasmv8+.

ItshouldbenotedthatwithoutaPROTO/EXTERNDEFbeforePROC,therearenodifferencesbetweenMasmv6,v8andJWasm,andthe-Zv8switchalsohasnoeffectthen.

Page 87: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

3.24.5Non-RIP-RelativeAddressingin64-BitIn64-bitaRIP-relativeaddressingmodewasintroduced.Thismodeisusedasdefaultfordirectaddressing,becauseitallowstoaccessallcodeordatalabelswitha32-bitdisplacement.However,forconstantaddresslocationsthismodeisnotappropriateandwon'tbeused:

moval,gs:[1000h]

moval,gs:[100000000h]

Ifaconstantaddressistobeaccessedwithoutsegmentprefixes-notethatin64-bit,onlysegmentregistersFSandGScanbeusedassegmentprefixes-onehastousetheFLATkeywordinJWasm:

moval,FLAT:[1000h];invalidforMasm

moval,FLAT:[100000000h];invalidforMasm

ThissyntaxdiffersfromMasm's,becauseMasmwon'tacceptFLAT.In64-bitMasm,thesyntaxforaccessingconstantaddressesisinstead:

moval,[1000h];invalidforJWasm

moval,[100000000h];invalidforJWasm

Thecodethatwillbegeneratedwon'tshowanydifferences:

0000000000000000:658A042510000000moval,byteptrgs:[00000010h]

0000000000000008:65A00000000001000000moval,byteptrgs:[0000000100000000h]

0000000000000012:8A042510000000moval,byteptrds:[00000010h]

0000000000000019:A00000000001000000moval,byteptrds:[0000000100000000h]

Page 88: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

4.InstructionSetsJWasmsupportsallinstructionssetssupportedbyMasmv8.Theseare

-theinstructionsimplementedby8086,80186,80286,80386,80486.-thePentiumandPentiumProinstructions.-theMMXandK3Dinstructionsetextensions.-theSSE,SSE2,SSE3andSSSE3instructionsetextensions.-theIntelVMXinstructionsetextension(sinceJWasmv2.09).-thex86-6464-bitinstructionset(implementedbyML64).

Additionallysupportedare

-SSE4.1andSSE4.2instructionsets(sinceJWasmv2.01).-AVXinstructionset(sinceJWasmv2.06).

WithMasm,SSE4.1andSSE4.2requireMasmv9;AVXrequiresMasmv10.

Page 89: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

5.CodeGenerationDifferencesJWasmmightgenerateslightlydifferentcodethanMasmonsomeoccasions.Commandlineoption-Zgshouldeliminatemostofthesedifferences.However,somedifferencesareduetofixedMasmbugs(seebelow),inwhichcaseoption-Zgwon'thaveanyeffect.

Forafewinstructions,theencodingdiffersbetweenMasmversions.

Example:

cmpal,dl

isencoded38D0inMasmv6,but3AC2inMasmv8.Insuchcases,JWasmwillprefertocopytheencodingofMasmv8.

Page 90: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

5.1ForwardReferencesinMacroExpressionsLikeMasm,JWasmusuallyevaluatesexpressionsinpreprocessordirectivesduringthefirstpassonly.However,duetodifferentjumpoptimizationstrategiesofMasmandJWasm,theresultsmaydiffer.Thisisveryunlikelytoimposeaproblem,butitismentionedhereforcompleteness.Anexample(foundinREADME.TXTofMasmv6.14):

Label1:

JMPLabel2

Label2:

REPEATLabel2-Label1

INCAX

ENDM

Masmwill-incorrectly-repeattheloop10times,althoughtheresultofexpressionLabel2-Label1is2only.OTOH,JWasmwillrepeattheloop2timesonly,becauseit'susingan"optimistic"strategyconcerningforwardreferences.

Page 91: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

6.OutputFormatsTheformatoftheassembler'soutputisselectedbycommandlineoptions.Theseare:

-omfIntel's"relocatableObjectModuleFormat",including32-bitMSextensions.It'sthedefault.

-coff (MS)COFFobjectmoduleformat,supportsflatmemorymodelsonly.It'susuallyusedfor32-bitWindowsmodules.

-elf 32-BitELF("ExecutableandLinkableFormat")objectmodules.-elf64 64-bitELFobjectmodules.-win64

64-bitformatforWin64objectmodules.COFFvariantwith64-bitextensions.

-djgpp COFFvariantusedbyDJGPP.Notactiveinprecompiledbinaries.-bin rawbinaryformat.-mz DOSMZbinaryformat.-pe 32-and64-bitPEbinaries.Theformatsselectedby-bin,-mzand-pearebinaryformats,hencetheoutputisnotsupposedtobefedtoalinker.

Page 92: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

6.1OMFOutputFormatTheOMFformatfullysupportsthesegmentedarchitectureofthex86cpu.Thespecificationhasbeenextendedaround1990tosupport32-bit,includingtheFLATmemorymodel.However,sinceit'sabitoldnow,there'snosupportofsomeofthenewrelocationsintroducedfor64-bit.

OMFwon'tsupporttheIMAGERELandSECTIONRELoperators.JWasmcurrentlywon'temitOMFLIDATArecords(unlikeMasm).ThismeansthatiftheassemblysourcecontainslotsofarraysdefinedwithDUP,theobjectmodulemightbecomesignificantlylargerthanasimiliarobjectmodulewrittenbyMasm.JWasmemitsafewCOMENTrecordsthatMasmwon't.TheseareremnantsofOpenWatcom'sWASM;theymaybesuppressedwithcommandlineoptions-zlcand-zld.Theyshouldn'tdoanyharm,though.

TheOMFobjectmoduleconsistsofrecordsofcertaintypes.JWasmwritesthoserecordsinthefollowingorder:

Type Description

THEADR 1Marksthestartofanobjectmodule,containsthenameofthesourcefile.

COMENT,classA1h 1MSextension;tellslinkertheCodeViewversionnumber.Emitted

if-Zioptionisactive.COMENT,classE9h n Borland-styleauto-dependencyrecord(s).Emittedif-Zdor-Zioptionsareactive.COMENT,class9Eh 1MSextension;directsthelinkertousea"standardized"segment

ordering.Emittedifthe.DOSSEGdirectiveisfoundinthesource.COMENT,class9Fh n Defaultlibrarysearchname(s).EmittedifINCLUDELIBdirectivesareused.

LNAMES n Definesnamesforsegmentsandgroups(optionallyalsoforexternals,communalsandpublics).SEGDEF n Definessegment(s).COMENT,classFEh n TellsWLinktodoFARCALLoptimizationforaspecificsegment.

Suppressedwith-zld.GRPDEF n Definesgroup(s).

Page 93: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

EXTDEF n Definesexternal(s).COMENT,classA8h n Definesweakexternal(s).EmittedifEXTERNdirectiveisusedwith"altname".COMDEF n Definescommunal(s).ALIAS n Definesalias(es).PUBDEF n Definespublic(s).COMENT,classA0h n Definesexport(s).EmittediftheEXPORTattributeisusedinaPROCdirective.COMENT,classA2h 1 LinkPassSeparator.Emittedifnoentrypointisdefinedinthisobjectmodule.LEDATA n Datarecord;definessegmentcontent(s).

FIXUPP n Containsinformationtomakethelinkerresolvereferencesbetweenobjectmodules.LINNUM n Linenumberinformation.Emittedif-Zdor-Zioptionisactive.COMENT,classFDh n Tellsdisassemblerthatacodesegmentcontainsdata.Suppressedwith-zlc.

MODEND 1Markstheendoftheobjectmodule;optionallydefinestheentrypoint.

LEDATA,FIXUPPandLINNUMrecordsusuallyareintermixed;aFIXUPPand/oraLINNUMrecordappearsimmediatelyaftertheLEDATArecordtowhichitrefers.Sincev2.11,multipleTHEADRrecordsarewrittenifcmdlineoptions-Zdor-Ziaresetandlinenumberinformationiswrittenformorethanonesourcefile;thisconformstoMASMbehavior.

Page 94: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

6.2COFFOutputFormatTheCOFFobjectmoduleformatissuitableforflat,non-segmentedmemorymodels.InmostcasestheCOFFformatisusedfor32-bitcode.However,it'spossibletocreatea64-bitCOFFmoduleifthecurrentcpuis.x64whenthe.MODELdirectiveisparsed(notethat-win64istheusualwaytocreatemodulesfor64-bitWindows).Tosomeextent16-bitcodeisalsosupportedwithCOFF,althoughOMFwillalwaysbethebetterchoicethen.

The-safesehcmdlineoptionandthe.SAFESEHdirectivearesupportedbyCOFFonly.NotsupportedbyCOFFare:

theGROUPdirectivethedirectivestocontrolsegmentorder:.ALPHA,.DOSSEG,.SEQcodethatwillgenerate"far"fixups(i.e.directFARcallsorjumps).

Afew,commonsegmentnamesaretranslatedintheoutputmodulewhenCOFFisselected:

name_TEXTistranslatedto.textname_DATAistranslatedto.datanameCONSTistranslatedto.rdataname_BSSistranslatedto.bss

Thisalsoaffectssimplifiedsegmentdirectives,since_TEXT,_DATA,CONSTand_BSSsegmentsareinternallygeneratedwhendirectives.CODE,.DATA,.CONSTor.DATA?aredetected.IfCOFFisselected,MasmwillignoresegmentcombinetypeSTACKandtreatstacksegmentsjustlikenormaldatasegments(theMSlinkerandcompatibleswillsetthestack'ssizewithcommandlineoptions).JWasmDOESNOTignorecombinetypeSTACKfortheCOFFoutputformat;additionally,unlessthesegmentcontainsinitializeddata,JWasmwillresetthesizeofstacksegmentsto0.DirectiveEXTERNname(altname):<type>willdefineaweakexternalwithcharacteristicsIMAGE_WEAK_EXTERN_SEARCH_LIBRARY(seeMSPEandCOFFspecification).DirectiveALIAS<aliasname>=<actualname>willdefineaweakexternalwithcharacteristicsIMAGE_WEAK_EXTERN_SEARCH_ALIAS(seeMSPEandCOFF

Page 95: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

specification).TherearesomecmdlineoptionstocontroltheextentofsymbolsthatarewrittentotheCOFFoutputmodule:-zlf,-zlpand-zls.

Page 96: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

6.3Win64OutputFormat6.3.1Win64Basics

Thisoutputformat,thatisselectedwiththe-win64commandlineoption,isavariantoftheCOFFoutputformat.It'scommonlyusedtocreateobjectmodulesfor64-bitWindows.ThedefaultcallingconventionistheWin64FASTCALLimplementation.

6.3.2DirectiveINVOKEinWin64

Unlikethe64-bitversionofMasm,whichdoesn'tsupportINVOKEanymore,JWasmstilldoes;however,pleasebeawareofsomepeculiarities:

intheory,usingINVOKErequirestheFRAMEattributeforPROC.ItwillworkwithoutFRAME,butWin64SEHwon'tbehappywithitthen.thedefaultimplementationin64-bitisverysimple:foreachINVOKEregisterRSPisreducedbythespacerequiredforthearguments,thenthecallisissuedandfinallyregisterRSPisrestored.ToenableamoreefficientcodegenerationseeOPTIONWIN64,INVOKEStackSpaceReservation-thisoptionisnotactiveasdefaultbecauseitvirtuallyrequiresacertainprogrammingstyle.thereisnoadditionalcheckthatthestackisalignedto16byte.ThePROC'sFRAMEattributeensuresthatthestackiscorrectlyalignedaftertheprologueisdone.However,it'stheprogrammersresponsibilitythatthestackisstillalignedwhenthecodegeneratedbyINVOKEstarts.parameternameslistedbehindthePROCdirectivewillalwaysrefertotheparameter'sshadowspaceonthestack.However,onaprocedure'sentrytheactualvaluesofthefirstfourparametersareholdinregisters,andthevalueoftheassociatedshadowspacesareundefined.SeeOPTIONWIN64,StoreRegisterArguments,howtomakeJWasmautomaticallysavetheregisterargumentsandthusinitializetheshadowspaceonaprocedure'sentry.

6.3.3Win64StructuredExceptionHandling(SEH)

SEHinWin64differssignificantlyfromtheimplementationinWin32.It'svery

Page 97: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

wellpossibletoignoreWin64SEHforassembly.However,ifanassemblyroutinewantstocomplytotheserules,athoroughunderstandingoftheWin64ABIisnecessary.Masm(the64-bitversion)suppliessome"primitives"forSEHsupport(.ALLOCSTACK,.PUSHREG,.SAVEREG,...),alongwithanewFRAMEattributeforthePROCdirective.ThesefeaturesarealsosupportedbyJWasm.SeesampleWin64_3howthe"primitives"aretobeusedforSEHsupport.

ThebigdisadvantageisthatusingtheFRAMEkeywordinMasm"disables"mostoftheotherhighlevelfeaturescombinedwithPROC(functionparameters,localsandregisterssavedwithUSES)becausenofunctionprologuesandepiloguesaregeneratedanymore.Additionally,theimplementationatleastinMasmv8seemstobeabitbuggy,atleastinMasmv8.BecauseofthisandtoeasetheusageofSEHinWin64thereisanewdirectiveimplementedinJWasm:

OPTIONFRAME:AUTO

Ifthisoptionisset,JWasmwillcreateWin64SEH-compatibleprologuesandepilogues.Iftheoptionisoff,JWasmwillbehaveMasm-compatible,thatis,FRAMEfoundinaPROCdirectivewilldisableautomaticprologue/epiloguegeneration.SeesampleWin64_3ehowthisoptionissupposedtobeused.

AsforthePROCsyntax:TheMasmdocumentationstatesthatFRAMEcanbeusedincombinationwithUSESandprocedureparametersandmustbelocatedbehindallparameters.However,thissyntaxisn'tacceptedbyanyMasmversion.TheonlysyntaxwhichMasmwillacceptwithoutbeingconfusedisFRAMEastheoneandonlyparameterforPROC.ThereforeJWasmdoesn'tfollowtheMasmdocumentationinthispoint:theoptionalFRAMEkeywordisexpected*before*theprocedureparameters.ThesyntaxinJWasmis:

procnamePROC[public]FRAME[:exc_handler][USES<reglist>][parameters]

TheSEH"primitives"willgeneratesomeadditionaldatainsegments.pdataand.xdata.Thisdataissomewhathidden,butJWasmwilldisplaythecorrespondingdatadefinitionsinthelistingifoption-Sgisset.

Finally,JWasm'sdefaultbehaviorofINVOKEisn'tfullySEH-compatible,becausethestackpointeristemporarilychangedtomakeroomforarguments.

Page 98: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

TomakeINVOKEcomplytoSEH,OPTIONWIN64INVOKEStackSpaceReservationhastobeused.

Page 99: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

6.4BinaryOutputFormatIfthebinaryoutputformathasbeenselected,thecontentsofthefilearejusttherawdatabytesemittedbytheassembler,noheader,relocationsorsymboltablesaregenerated.Allreferenceshavetoberesolvedinternally.

ThebinaryformatismostusefulforbootloadersorDOSCOMfiles,butmaybeusedtocreateanybinaryformat.SeesampleWin32_5,thatdemonstrateshowthebinaryformatisusedtocreateaWin32application.

Ifalistingfileisproduced,abinarymapwillbeadded,whichshowsthefileandmemorylayoutoftheimage:

.modeltiny

.data

000000000D0A48656C6C6F2C20str1db13,10,"Hello,world!",13,10,'$'

00000000.code

org100h

00000100start:

00000100B409movah,09h

00000102BA0000movdx,offsetstr1

00000105CD21int21h

00000107B8004Cmovax,4c00h

0000010ACD21int21h

endstart

BinaryMap:

SegmentPos(file)VASize(fil)Size(mem)

---------------------------------------------------------------

_TEXT0100CC

_DATAC10C1212

---------------------------------------------------------------

Page 100: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

1E1E

Notethatbyteswith"undefinedcontents"atthestartandtheendoftheoutputfileareskippedandwon'tbecomepartofthebinary.

Page 101: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

6.5PEOutputFormatThe(Windows)PEoutputformat(both32-and64-bit)isabinaryformat-there'snolinkstepsupposedtofollowtheassemblystep.Henceallreferencesmustberesolvedinternally,noexternalreferencesarepossible.SincetheWindowsABIisimplementedasasetofdllsthatexportfunctionnames,it'snecessarytoprovideamechanismtocallsuchexternalfunctions-inthePEformatthisisachievedwiththehelpofdirectiveOPTIONDLLIMPORT;itallowstoattachamodulenametofunctionprototypesusedbytheassemblysourceandconsequentlygivetheassemblerthemeanstoresolveallreferenceswithoutthehelpofalinker.

ThePEformatrequiresa.MODELFLATdirectiveinthesourcecode.ThisdirectivewilltriggerthecreationoftheinternalPE-headersection,thevalueofthecpuatthistimewilldeterminewhethera32-or64-bitPEbinaryistobewritten.

Asinallbinaryformats,thelistingwillcontainabinarymap;seeBinaryOutputFormatformoredetails.

If-peisset,afewsectionswillbecreatedinternally:

-.hdr$1:sectionwillcontaintheDOSMZ-stub.-.hdr$2:sectionwillcontainthePEheader-.hdr$3:sectionwillcontainthePEobjecttable

ThedefaultvaluesinthePEheaderareField 32-bitValue 64-bitValue(ifdifferent)

Signature "PE"Machine 14Ch 8664hTimestamp date&timeSizeOptionalHeader 0E0h 0F0hCharacteristics 10Fh 12FhMagic 10Bh 20BhLinkerVersion 5.1

Page 102: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ImageBase 400000hSectionAlignment 1000hFileAlignment 200hOSVersion 4.0ImageVersion 0.0SubsystemVersion 4.0Win32Version 0Checksum 0Subsystem 2(=Console)DllCharacteristics 0SizeOfStack 100000h,1000hSizeOfHeap 100000h,1000hLoaderFlags 0

TochangethedefaultvaluesinthePEheadertherearetwooptions.First,apredefinedassembly-timevariable@pe_file_flagswillmapthevalueoffieldCharacteristics-changingthevalueof@pe_file_flagswillalsochangethevalueintheheaderfield.TheotherfieldsinthePEheaderareonlyaccessiblebysettingtheappropriatevaluesinsection.hdr$2.Fieldsnotlistedinthetableabovearesetinternallybytheassemblertoensuredataintegrityandcannotbemodifiedfromwithintheassemblysource.

IfthePEbinaryistouseresources,a.rsrcsectionhastobecreatedwhichistocontainthem.Definingtheresourcesmanuallyworksandisdoable,butitmightbecometediousifalotofresourceitemsaretobedefined.Thereforetoolres2incissupplied,whichallowstoconvertacompiledresourcefile(.RES)toanassemblyincludefile.

Ifadlliscreatedwith-pe,onehastomarkallproceduresthataretobeexportedwiththeEXPORTattribute.Iftheexportednamesaretobeundecorated,usethe-zzecmdlineoption.

SampleWin64_8showshowa64-bitWindowsbinaryiscreatedwith-pe.Italsoshowshowtodefineresourcesin.rsrcmanuallyandhowtomodifydefaultvaluesofPEheaderfields.

Page 103: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

7.MasmbugsfixedinJWasm

# DescriptionFixedMasmVersion

1theinfamous"invoke"bug:ifanargumentforinvokehastobeexpanded(fromBYTEorWORDtoDWORD,forexample),badcodewasgenerated.

9

2 PROTOscontainedtwiceinthesourcecausedanEXTDEFentrytobegeneratedintheobjectmodule. -

3 "TYPExmm0"willreturn10inMasmv6andv7-thecorrectvalueis16. 8

4 anestedstructuremightcauseaGPFinMasmiftheembeddedSTRUCT'sstartingoffsethastobeadjustedduetoalignment. -

5 defininghugearraysinMasmisveryslowandmightevencauseadeadlockifCOFFhasbeenselectedasoutputformat. -

6 forMasmv6andv7,ifanarray>64kBisdefinedandoutputformatOMFisselected,thearray'ssizewillbemod0x10000only. 8

7 Masmdoesn'tflaginvalidnumbersinstruct/arrayinitializerstrings. -

8ifanALIASisdefinedsomewhereinthesourceandthesymboltableislisted,a'GeneralFailure'erroroccursinMasmifoutputformatisOMF.

-

9Type"coerces"forDWORDdataitemsdefinedina32bitsegmentareignoredbyMasm,i.e.,"ddfar16ptr<symbol>"willgenerateanear32fixupinsteadofafar16one.

-

10iftheALIGNdirectivehastoadd5bytesin32bitcodesegments,Masmincludesan"addeax,0"opcode,whichisn'tano-opbecauseflagsaremodified.

-

11 silenttruncationofimmediateconstants:Masmv6andv7willacceptline"mov[word_variable],12345h"withouterror. 8

12preprocessedoutputwithoption-EPmayerroneouslycontaintextmacrosandmacrofunctioncallsifthemacrosarelocatedintheinitializationstringofastructuredvariable.

-

Masmgenerateswrongcodeifaconditionaljumpiscoupledwitha

Page 104: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

13 typecoercionwhichmodifiesoffsetmagnitude.Examples:"jznear32ptr..."in16bitcodeor"jznear16ptr..."in32bitcode).

-

14 iftheargumentsgiventoMasmendwithanoptionwhichexpectsaparameter(i.e."ml-c-Fo"),a'GeneralFailure'mayoccur. -

15 floating-pointdataitemsinMasmcanbefollowedbyanysuffix(example:REAL41.0foo,2.0bar).JWasmwon'tacceptthis. -

16

Ifalocalisdefinedinsideamacro,Masmwillcreateauniquenameforit.Thenameisconstructedbyusing'??'asprefix,followedbyahexadecimalnumberwith4digits.Thereisnocheckforoverflow,however,soifthetotaloflocalsinallmacrosexceeds65536,strangeerrorswilloccur.

-

17Ifaweakexternalisdefinedfor-coffwiththeALIASdirective,aninvalidfixup-andalsoastrangeentryinthemodule'ssymboltable-iscreated.

-

18Ifasectioncontainsmorethan0xffffrelocationsinCOFF,thenumberofrelocationsthatisstoredintheobjectmoduleisjustthevalueofthelower16-bithalfoftherelocationcount.

8

19

Ifasymbolicconstant(=equate)ismadepublicinOMFformat,Masmwillstorethesymbol'svalueina16-bitrecordifitisintherange-32768...65535.Ifthesymbolisreferencedinanothermoduleasa32-bitnumber,itisalwayszero-extended,neversign-extended;hencevalues-1...-32768willbecome65535...32768.

-

20

ifdatalabelsbecomepublicbythe-Zfoption(andnotbythePUBLICdirective),theirnamesarenotdecorated.Also,ifformatisCOFF,theywon'tbecometruepublics,they'rejustincludedinthesymboltablewithclass"static",

-

It'sslightlydangeroustofixoldMasmbugs,sincesomecodemightworkonlyifthebugsexists.Sono,JWasmwon'tachieve100%Masmcompatibility.

Page 105: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

8.OptionalFeaturesThereexistsomefeaturesthatarenotactivatedintheprecompiledbinaries.Toenabletheseoptions,theJWasmsourcemustberecompiledwithoneormoreswitchessetinthecommandline:

Page 106: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

SupportforDjgpp'svariantofCOFF

Thisoptionisenabledwithswitch-DDJGPP_SUPPORT.ThegeneratedJWasmbinarywillacceptanadditionaloutputformat(-djgpp)tobesetinthecommandline,thatmakestheassemblergenerateCOFFmodulescompatiblewithDJGPP.

Page 107: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

SupportforAssemblySourcegeneratedbyIntelC++compiler

Thisoptionisenabledwithswitch-DDOTNAMEX.Itwillmaketheassembleracceptnamesthatcontaindotsifthenamestartswithadotoranunderscore.NotethatthisbehaviorisnotcompatiblewithstandardMasmsyntax.

Page 108: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

9.KnownBugsandmissingFeaturesa)Bugswhichareknownbutnotfixedyet:

Therearecurrentlynoknownbugs.

Page 109: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

b)Featureswhicharen'timplementedyet:

-directivesPAGE,TITLE,SUBTITLE,SUBTTL.thedirectivesareignoredandawarning(level4)isdisplayed.-thefollowingparametersoftheOPTIONdirective:

-OLDMACROS-EXPR16-READONLY

-optionalparameterNONUNIQUEforstructuresisignored.-commandlineoption-AT(Enabletinymodel).-commandlineoptions-Sp,-Ssand-St(setpagelength,subtitleandtitle).-commandlineoption-H(setmaxexternalnamelength).-commandlineoption-Ta(Assemblenon-.ASMfile).-commandlineoption-ZdforELFoutputformat.-commandlineoption-ZiforELFoutputformat.

Ifthere'severaproblemwithoneofthemissingfeatures,it'sverylikelythatit'srelatedtoOPTIONOLDMACROS.ThisoptionmakesMasm6emulatetwoMasm5.1peculiarities:

-macroargumentsmaybeseparatedbyspaces-ampersands(&)insidethemacromustmatchthecurrentlevelofmacronesting.

Page 110: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

c)Missingfeatureswhichmostlikelywon'tbeimplemented:

-syntax"mm(n)"and"xmm(n)"(supportedbyMasmv6andv7only)-commandlineoption-Bl,-F,-Fe,-Fmand-link:sinceJWasmdoesn'tlaunchalinker,thoseoptionsareuseless.-commandlineoptions-Frand-FR(generatebrowserinfo).-commandlineoption-Sc(generatetimingsinlisting).-commandlineoption-errorReport(ReportinternalassemblererrorstoMicrosoft).

Page 111: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

10.LicenseThismanualwaswrittenbyAndreasGrech(akaJapheth).

Itmayberedistributedaslongasitisfreeofcharge.

Page 112: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AppendixA.JWasmReservedWordsReservedWordsarecase-insensitive.BesidestheitemslistedbelowallinstructionmnemonicsarealsoReservedWords.

Page 113: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Registers16-and32-bitModes

8-bitregisters AL CL DL BL AH CH DH BH16-bitregisters AX CX DX BX SP BP SI DI32-bitregisters EAX ECX EDX EBX ESP EBP ESI EDISegmentregisters ES CS SS DS FS GS

Floating-pointregisters ST ST(1) ST(2) ST(3) ST(4) ST(5) ST(6) ST(7)

MMXregisters MM0 MM1 MM2 MM3 MM4 MM5 MM6 MM7SSEregisters XMM0XMM1XMM2XMM3XMM4XMM5XMM6XMM7AVXregisters YMM0YMM1YMM2YMM3YMM4YMM5YMM6YMM7Controlregisters CR0 CR2 CR3 CR4

Debugregisters DR0 DR1 DR2 DR3 DR6 DR7

Testregisters[1] TR3 TR4 TR5 TR6 TR7[1]:invalidin64-bitmode.

Page 114: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AdditionalRegistersin64-bitMode

8-bitregisters SPL BPL SIL DIL

R8B R9B R10B R11B R12B R13B R14B R15B16-bitregisters R8W R9W R10W R11W R12W R13W R14W R15W

32-bitregisters R8D R9D R10D R11D R12D R13D R14D R15D

64-bitregisters RAX RCX RDX RBX RSP RBP RSI RDI

R8 R9 R10 R11 R12 R13 R14 R15SSEregisters XMM8XMM9XMM10 XMM11 XMM12 XMM13 XMM14 XMM15

AVXregisters YMM8YMM9YMM10 YMM11 YMM12 YMM13 YMM14 YMM15

Controlregisters CR8

Page 115: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Types

BYTESBYTEWORDSWORDDWORDSDWORDREAL4FWORDQWORDSQWORDREAL8TBYTEREAL10OWORDYMMWORDNEARFARNEAR16NEAR32FAR16FAR32MMWORDXMMWORD

Page 116: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

UnaryOperators

.TYPEHIGHHIGH32HIGHWORDIMAGEREL[1]

LENGTHLENGTHOFLOWLOW32LOWWORDLROFFSETMASKOFFSETOPATTRSECTIONREL[1]

SEGSHORTSIZESIZEOFTHISTYPEWIDTH[1]:notforOMFoutputformat.

Page 117: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

BinaryOperators

EQNEGEGTLELTMODPTRDUPSHL[1]

SHR[1]

AND[1]

OR[1]

XOR[1]

[1]:thesekeywordsarealsoinstructions.

Page 118: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Directives

.8086

.186

.286

.286C

.286P

.386

.386C

.386P

.486

.486P

.586

.586P

.686

.686P

.K3D

.MMX

.XMM

.X64

.X64P

.8087

.287

.387

.NO87

.CREF

.LIST

.LISTALL

.LISTIF,.LFCOND

.NOCREF,.XCREF

.NOLIST,.XLIST

.NOLISTIF,.SFCOND

Page 119: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

.TFCONDPAGESUBTITLE,SUBTTLTITLE.LISTMACRO,.XALL.LISTMACROALL,.LALL.NOLISTMACRO,.SALL.ALPHA.DOSSEG,DOSSEG.SEQ.CODE.STACK.DATA.DATA?.FARDATA.FARDATA?.CONST.IF.REPEAT.WHILE.BREAK.CONTINUE.ELSE.ELSEIF.ENDIF.ENDW.UNTIL.UNTILCXZ.EXIT.STARTUP.MODEL.RADIX.SAFESEH

Page 120: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

.ERR

.ERR1

.ERR2

.ERRE

.ERRNZ

.ERRDIF

.ERRDIFI

.ERRIDN

.ERRIDNI

.ERRB

.ERRNB

.ERRDEF

.ERRNDEFCOMMENTIFIFEIF1IF2IFDIFIFDIFIIFIDNIFIDNIIFBIFNBIFDEFIFNDEFELSEELSEIFELSEIFEELSEIF1ELSEIF2ELSEIFDIFELSEIFDIFI

Page 121: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ELSEIFIDNELSEIFIDNIELSEIFBELSEIFNBELSEIFDEFELSEIFNDEFENDIFFOR,IRPFORC,IRPCREPEAT,REPTWHILEMACROEXITMENDMGOTOPURGEINCLUDETEXTEQUCATSTRSUBSTRINSTRSIZESTRDBDWDDDFDQDTSTRUCT,STRUCUNIONTYPEDEFRECORDCOMM

Page 122: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

EXTERN,EXTRNEXTERNDEFPUBLICPROTOPROCENDPLOCALLABELINVOKEORGALIGNEVENSEGMENTENDSGROUPASSUMEALIASECHO,%OUTENDEQUINCBININCLUDELIBNAMEOPTIONPOPCONTEXTPUSHCONTEXT

Page 123: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AdditionalDirectivesin64-bitMode

.ALLOCSTACK

.ENDPROLOG

.PUSHFRAME

.PUSHREG

.SAVEREG

.SAVEXMM128

.SETFRAME

Page 124: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

OtherReservedWords

ADDRFLATVARARGFRAME[1]

CSYSCALL[2]

STDCALLPASCALFORTRANBASICFASTCALL[1]:in64-bitmodeonly.[2]:in64-bit,callingconventionSYSCALLisrenamedtoSYSCALL_,sinceinthismodethereexistsaSYSCALLinstruction.

Page 125: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AppendixB.SourceSamplesWin64_3-SEHSupportinWin64Win64_3e-SEHSupportinWin64(JWasmspecific)DOS64-SwitchtoLongModeandBackWin32_5-CreateaWin32Binarywith-binWin32_7-UsageofOPTIONDLLIMPORTand-FdSwitchWin64_8-CreateaWin64Binarywith-pe

Page 126: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Win64_3-SEHSupportinWin64

;---ThissampleshowshowtouseSEHprimitives.Itdoesn'tusehll

;---directives.ThusthissourcecanbeassembledbybothJWasm

;---andMasm64.

;---

;---toassembleenter:

;---JWasm-win64Win64_3.asm

;---or:

;---ml64-cWin64_3.asm

;---

;---tolinkthebinaryenter:

;---LinkWin64_3.obj

optioncasemap:none

includelibkernel32.lib

includelibuser32.lib

HINSTANCEtypedefQWORD

HWNDtypedefQWORD

HMENUtypedefQWORD

HICONtypedefQWORD

HBRUSHtypedefQWORD

HCURSORtypedefQWORD

WPARAMtypedefQWORD

LPARAMtypedefQWORD

LPSTRtypedefQWORD

LPVOIDtypedefQWORD

UINTtypedefDWORD

NULLequ0

WS_OVERLAPPEDWINDOWequ0CF0000h

CW_USEDEFAULTequ80000000h

SW_SHOWDEFAULTequ10

SW_SHOWNORMALequ1

IDC_ARROWequ32512

IDI_APPLICATIONequ32512

WM_DESTROYequ2

CS_VREDRAWequ1

CS_HREDRAWequ2

COLOR_WINDOWequ5

Page 127: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

proto_WNDPROCtypedefproto:HWND,:QWORD,:WPARAM,:LPARAM

WNDPROCtypedefptrproto_WNDPROC

WNDCLASSEXAstruct8

cbSizeDWORD?

styleDWORD?

lpfnWndProcWNDPROC?

cbClsExtraDWORD?

cbWndExtraDWORD?

hInstanceHINSTANCE?

hIconHICON?

hCursorHCURSOR?

hbrBackgroundHBRUSH?

lpszMenuNameLPSTR?

lpszClassNameLPSTR?

hIconSmHICON?

WNDCLASSEXAends

POINTstruct

xSDWORD?

ySDWORD?

POINTends

MSGstruct8

hwndHWND?

messageDWORD?

wParamWPARAM?

lParamLPARAM?

timeDWORD?

ptPOINT<>

MSGends

GetModuleHandleAproto:LPSTR

GetCommandLineAproto

ExitProcessproto:UINT

LoadIconAproto:HINSTANCE,:LPSTR

LoadCursorAproto:HINSTANCE,:LPSTR

RegisterClassExAproto:ptrWNDCLASSEXA

CreateWindowExAproto:DWORD,:LPSTR,:LPSTR,:DWORD,:SDWORD,:SDWORD,:SDWORD,:SDWORD,:HWND,:HMENU,:HINSTANCE,:LPVOID

ShowWindowproto:HWND,:SDWORD

UpdateWindowproto:HWND

GetMessageAproto:ptrMSG,:HWND,:SDWORD,:SDWORD

TranslateMessageproto:ptrMSG

DispatchMessageAproto:ptrMSG

PostQuitMessageproto:SDWORD

DefWindowProcAproto:HWND,:UINT,:WPARAM,:LPARAM

Page 128: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

;WinMainproto:HINSTANCE,:HINSTANCE,:LPSTR,:UINT

.data

ClassNamedb"SimpleWinClass",0

AppNamedb"OurFirstWindow",0

.data?

hInstanceHINSTANCE?

CommandLineLPSTR?

.code

WinMainCRTStartupprocFRAME

pushrbp

.pushregrbp

movrbp,rsp

.setframerbp,0

.endprolog

subrsp,32

movecx,NULL

callGetModuleHandleA

movhInstance,rax

callGetCommandLineA

movCommandLine,rax

movrcx,hInstance

movrdx,NULL

movr8,CommandLine

movr9d,SW_SHOWDEFAULT

callWinMain

movecx,eax

callExitProcess

align4

WinMainCRTStartupendp

WinMainprocFRAME

pushrbp

.pushregrbp

movrbp,rsp

.setframerbp,0

.endprolog

subrsp,sizeofWNDCLASSEXA+sizeofMSG+sizeofHWND+12*8

hInstequ<[rbp+10h]>

Page 129: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

hPrevInstequ<[rbp+18h]>

CmdLineequ<[rbp+20h]>

CmdShowequ<[rbp+28h]>

wcequ<[rbp-sizeofWNDCLASSEXA].WNDCLASSEXA>

msgequ<[rbp-sizeofWNDCLASSEXA-sizeofMSG].MSG>

hwndequ<[rbp-sizeofWNDCLASSEXA-sizeofMSG-sizeofHWND]>

movhInst,rcx;storeparam1inshadowspace

movwc.cbSize,SIZEOFWNDCLASSEXA

movwc.style,CS_HREDRAWorCS_VREDRAW

;movrax,OFFSETWndProc;usingLEAispreferable

learax,[WndProc]

movwc.lpfnWndProc,rax

movwc.cbClsExtra,NULL

movwc.cbWndExtra,NULL

movwc.hInstance,rcx

movwc.hbrBackground,COLOR_WINDOW+1

movwc.lpszMenuName,NULL

;movrax,OFFSETClassName;usingLEAispreferable

learax,[ClassName]

movwc.lpszClassName,rax

movecx,NULL

movedx,IDI_APPLICATION

callLoadIconA

movwc.hIcon,rax

movwc.hIconSm,rax

movecx,NULL

movedx,IDC_ARROW

callLoadCursorA

movwc.hCursor,rax

learcx,wc

callRegisterClassExA

movecx,NULL

leardx,[ClassName]

lear8,[AppName]

movr9d,WS_OVERLAPPEDWINDOW

movdwordptr[rsp+4*8],CW_USEDEFAULT

movdwordptr[rsp+5*8],CW_USEDEFAULT

movdwordptr[rsp+6*8],CW_USEDEFAULT

movdwordptr[rsp+7*8],CW_USEDEFAULT

movqwordptr[rsp+8*8],NULL

movqwordptr[rsp+9*8],NULL

movrax,hInst

mov[rsp+10*8],rax

movqwordptr[rsp+11*8],NULL

Page 130: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

callCreateWindowExA

movhwnd,rax

movrcx,hwnd

movedx,SW_SHOWNORMAL

callShowWindow

movrcx,hwnd

callUpdateWindow

;---messageloop

@@:

learcx,msg

movrdx,NULL

movr8,0

movr9,0

callGetMessageA

andrax,rax

jz@F

learcx,msg

callTranslateMessage

learcx,msg

callDispatchMessageA

jmp@B

@@:

movrax,msg.wParam

addrsp,sizeofWNDCLASSEXA+sizeofMSG+sizeofHWND+12*8

poprbp

ret

align4

WinMainendp

WndProcprocFRAME

subrsp,4*8

.allocstack4*8

.endprolog

cmpedx,WM_DESTROY

jnz@F

movecx,NULL

callPostQuitMessage

xorrax,rax

jmpexit

@@:

callDefWindowProcA

exit:

addrsp,4*8

ret

align4

Page 131: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

WndProcendp

end

Page 132: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Win64_3e-SEHSupportinWin64(JWasmspecific)

;---SEHsupportinWin64.UnlikeWin64_3,

;---thisversionuseshlldirectives,soitcannotbeassembled

;---withMasm64.Also,OPTIONFRAME:AUTOisused.

;---

;---tocreatethebinaryenter:

;---JWasm-win64Win64_3e.asm

;---LinkWin64_3e.obj

optioncasemap:none

optionframe:auto;generateSEH-compatibleprologuesandepilogues

includelibkernel32.lib

includelibuser32.lib

HINSTANCEtypedefQWORD

HWNDtypedefQWORD

HMENUtypedefQWORD

HICONtypedefQWORD

HBRUSHtypedefQWORD

HCURSORtypedefQWORD

WPARAMtypedefQWORD

LPARAMtypedefQWORD

LPSTRtypedefQWORD

LPVOIDtypedefQWORD

UINTtypedefDWORD

NULLequ0

WS_OVERLAPPEDWINDOWequ0CF0000h

CW_USEDEFAULTequ80000000h

SW_SHOWDEFAULTequ10

SW_SHOWNORMALequ1

IDC_ARROWequ32512

IDI_APPLICATIONequ32512

WM_DESTROYequ2

CS_VREDRAWequ1

CS_HREDRAWequ2

COLOR_WINDOWequ5

Page 133: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

proto_WNDPROCtypedefproto:HWND,:QWORD,:WPARAM,:LPARAM

WNDPROCtypedefptrproto_WNDPROC

WNDCLASSEXAstruct8

cbSizeDWORD?

styleDWORD?

lpfnWndProcWNDPROC?

cbClsExtraDWORD?

cbWndExtraDWORD?

hInstanceHINSTANCE?

hIconHICON?

hCursorHCURSOR?

hbrBackgroundHBRUSH?

lpszMenuNameLPSTR?

lpszClassNameLPSTR?

hIconSmHICON?

WNDCLASSEXAends

POINTstruct

xSDWORD?

ySDWORD?

POINTends

MSGstruct8

hwndHWND?

messageDWORD?

wParamWPARAM?

lParamLPARAM?

timeDWORD?

ptPOINT<>

MSGends

GetModuleHandleAproto:LPSTR

GetCommandLineAproto

ExitProcessproto:UINT

LoadIconAproto:HINSTANCE,:LPSTR

LoadCursorAproto:HINSTANCE,:LPSTR

RegisterClassExAproto:ptrWNDCLASSEXA

CreateWindowExAproto:DWORD,:LPSTR,:LPSTR,:DWORD,:SDWORD,:SDWORD,:SDWORD,:SDWORD,:HWND,:HMENU,:HINSTANCE,:LPVOID

ShowWindowproto:HWND,:SDWORD

UpdateWindowproto:HWND

GetMessageAproto:ptrMSG,:HWND,:SDWORD,:SDWORD

TranslateMessageproto:ptrMSG

DispatchMessageAproto:ptrMSG

PostQuitMessageproto:SDWORD

DefWindowProcAproto:HWND,:UINT,:WPARAM,:LPARAM

Page 134: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

WinMainproto:HINSTANCE,:HINSTANCE,:LPSTR,:UINT

.data

ClassNamedb"SimpleWinClass",0

AppNamedb"OurFirstWindow",0

.data?

hInstanceHINSTANCE?

CommandLineLPSTR?

.code

WinMainCRTStartupprocFRAME

invokeGetModuleHandleA,NULL

movhInstance,rax

invokeGetCommandLineA

movCommandLine,rax

invokeWinMain,hInstance,NULL,CommandLine,SW_SHOWDEFAULT

invokeExitProcess,eax

WinMainCRTStartupendp

WinMainprocFRAMEhInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:UINT

localwc:WNDCLASSEXA

localmsg:MSG

localhwnd:HWND

movhInst,rcx

movwc.cbSize,SIZEOFWNDCLASSEXA

movwc.style,CS_HREDRAWorCS_VREDRAW

learax,[WndProc]

movwc.lpfnWndProc,rax

movwc.cbClsExtra,NULL

movwc.cbWndExtra,NULL

movwc.hInstance,rcx

movwc.hbrBackground,COLOR_WINDOW+1

movwc.lpszMenuName,NULL

learax,[ClassName]

movwc.lpszClassName,rax

invokeLoadIconA,NULL,IDI_APPLICATION

movwc.hIcon,rax

movwc.hIconSm,rax

invokeLoadCursorA,NULL,IDC_ARROW

Page 135: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

movwc.hCursor,rax

invokeRegisterClassExA,addrwc

invokeCreateWindowExA,NULL,ADDRClassName,ADDRAppName,\

WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,\

CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,NULL,NULL,\

hInst,NULL

movhwnd,rax

invokeShowWindow,hwnd,SW_SHOWNORMAL

invokeUpdateWindow,hwnd

.while(1)

invokeGetMessageA,ADDRmsg,NULL,0,0

.break.if(!rax)

invokeTranslateMessage,ADDRmsg

invokeDispatchMessageA,ADDRmsg

.endw

movrax,msg.wParam

ret

WinMainendp

WndProcprocFRAMEhWnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM

.if(edx==WM_DESTROY)

invokePostQuitMessage,NULL

xorrax,rax

.else

invokeDefWindowProcA,rcx,edx,r8,r9

.endif

ret

WndProcendp

endWinMainCRTStartup

Page 136: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

DOS64-SwitchtoLongModeandBack

;---DOSprogramwhichswitchestolong-modeandback.

;---Note:requiresatleastJWasmv2.

;---Also:needsa64bitcpuinreal-modetorun.

;---Partsofthesourcearebasedonsamplessuppliedby

;---sinsiandTomaszGrysztarintheFASMforum.

;---Tocreatethebinaryenter:

;---JWasm-mzDOS64.asm

.x64p

;---16bitstart/exitcode

_TEXT16segmentuse16parapublic'CODE'

assumeds:_TEXT16

assumees:_TEXT16

GDTRlabelfword;GlobalDescriptorsTableRegister

dw4*8-1;limitofGDT(sizeminusone)

ddoffsetGDT;linearaddressofGDT

IDTRlabelfword;InterruptDescriptorTableRegister

dw256*16-1;limitofIDT(sizeminusone)

dd0;linearaddressofIDT

nullidtlabelfword

dw3FFh

dd0

align8

GDTdq0;nulldescriptor

dw0FFFFh,0,9A00h,0AFh;64-bitcodedescriptor

dw0FFFFh,0,9A00h,000h;compatibilitymodecodedescriptor

dw0FFFFh,0,9200h,000h;compatibilitymodedatadescriptor

wPICMaskdw0;variabletosave/restorePICmasks

start16:

pushcs

popds

Page 137: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

movax,cs

movzxeax,ax

shleax,4

adddwordptr[GDTR+2],eax;convertoffsettolinearaddress

movwordptr[GDT+2*8+2],ax

movwordptr[GDT+3*8+2],ax

shreax,16

movbyteptr[GDT+2*8+4],al

movbyteptr[GDT+3*8+4],al

movax,ss

movdx,es

subax,dx

movbx,sp

shrbx,4

addbx,ax

movah,4Ah

int21h;freeunusedmemory

pushcs

popes

movax,ss

movdx,cs

subax,dx

shlax,4

addax,sp

pushds

popss

movsp,ax;makeaTINYmodel,CS=SS=DS=ES

smswax

testal,1

jz@F

movdx,offseterr1

movah,9

int21h

movah,4Ch

int21h

err1db"ModeisV86.NeedREALmodetoswitchtoLONGmode!",13,10,'$'

@@:

xoredx,edx

moveax,80000001h;testiflong-modeissupported

cpuid

testedx,20000000h

jnz@F

movdx,offseterr2

movah,9

int21h

Page 138: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

movah,4Ch

int21h

err2db"No64bitcpudetected.",13,10,'$'

@@:

movbx,1000h

movah,48h

int21h

jnc@F

movdx,offseterr3

movah,9

int21h

movah,4Ch

int21h

err3db"Outofmemory",13,10,'$'

@@:

addax,100h-1;aligntopageboundary

moval,0

moves,ax

;---setuppagedirectoriesandtables

subdi,di

movcx,4096

subeax,eax

repstosd;clear4pages

subdi,di

movax,es

movzxeax,ax

shleax,4

movcr3,eax;loadpage-maplevel-4base

leaedx,[eax+5000h]

movdwordptr[IDTR+2],edx

oreax,111b

addeax,1000h

moves:[di+0000h],eax;firstPDPtable

addeax,1000h

moves:[di+1000h],eax;firstpagedirectory

addeax,1000h

moves:[di+2000h],eax;firstpagetable

movdi,3000h;addressoffirstpagetable

moveax,0+111b

movcx,256;numberofpagestomap(1MB)

@@:

stosd

Page 139: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

adddi,4

addeax,1000h

loop@B

;---setupebx/rbxwithlinearaddressof_TEXT

movbx,_TEXT

movzxebx,bx

shlebx,4

add[llg],ebx

;---createIDT

movdi,5000h

movcx,32

movedx,offsetexception

addedx,ebx

make_exc_gates:

moveax,edx

stosw

movax,8

stosw

movax,8E00h

stosd

xoreax,eax

stosd

stosd

addedx,4

loopmake_exc_gates

movcx,256-32

make_int_gates:

moveax,offsetinterrupt

addeax,ebx

stosw

movax,8

stosw

movax,8E00h

stosd

xoreax,eax

stosd

stosd

loopmake_int_gates

movdi,5000h

moveax,ebx

addeax,offsetclock

moves:[di+80h*16+0],ax;setIRQ0handler

Page 140: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

shreax,16

moves:[di+80h*16+6],ax

moveax,ebx

addeax,offsetkeyboard

moves:[di+81h*16+0],ax;setIRQ1handler

shreax,16

moves:[di+81h*16+6],ax

;---clearNTflag

pushf

popax

andah,0BFh

pushax

popf

;---reprogramPIC:changeIRQ0-7toINT80h-87h,IRQ8-15toINT88h-8Fh

cli

inal,0A1h

movah,al

inal,21h

mov[wPICMask],ax

moval,10001b;beginPIC1initialization

out20h,al

moval,10001b;beginPIC2initialization

out0A0h,al

moval,80h;IRQ0-7:interrupts80h-87h

out21h,al

moval,88h;IRQ8-15:interrupts88h-8Fh

out0A1h,al

moval,100b;slaveconnectedtoIRQ2

out21h,al

moval,2

out0A1h,al

moval,1;Intelenvironment,manualEOI

out21h,al

out0A1h,al

inal,21h

moval,11111100b;enableonlyclockandkeyboardIRQ

out21h,al

inal,0A1h

moval,11111111b

out0A1h,al

moveax,cr4

Page 141: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

oreax,1shl5

movcr4,eax;enablephysical-addressextensions(PAE)

movecx,0C0000080h;EFERMSR

rdmsr

oreax,1shl8;enablelongmode

wrmsr

lgdt[GDTR]

lidt[IDTR]

movcx,ss

movzxecx,cx;getbaseofSS

shlecx,4

movzxesp,sp

addecx,esp;ECX=linearaddressofcurrentSS:ESP

moveax,cr0

oreax,80000001h

movcr0,eax;enablepaging+pmode

db66h,0EAh;jmp0008:oooooooo

llgddoffsetlong_start

dw8

;---switchbacktoreal-modeandexit

backtoreal:

cli

moveax,cr0

andeax,7FFFFFFFh;disablepaging

movcr0,eax

movecx,0C0000080h;EFERMSR

rdmsr

andah,not1h;disablelongmode(EFER.LME=0)

wrmsr

movax,24;setSS,DSandESto64kdata

movss,ax

movds,ax

moves,ax

moveax,cr0;switchtorealmode

andal,0FEh

movcr0,eax

Page 142: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

db0eah;clearinstructioncache,CS=real-modeseg

dw$+4

dw_TEXT16

movax,STACK;SS=real-modeseg

movss,ax

movsp,4096

pushcs;DS=real-mode_TEXT16seg

popds

lidt[nullidt];IDTR=real-modecompatiblevalues

moveax,cr4

andal,not20h;disablephysical-addressextensions(PAE)

movcr4,eax

;---reprogramPIC:changeIRQ0-7toINT08h-0Fh,IRQ8-15toINT70h-77h

moval,10001b;beginPIC1initialization

out20h,al

moval,10001b;beginPIC2initialization

out0A0h,al

moval,08h;IRQ0-7:backtoints8h-Fh

out21h,al

moval,70h;IRQ8-15:backtoints70h-77h

out0A1h,al

moval,100b;slaveconnectedtoIRQ2

out21h,al

moval,2

out0A1h,al

moval,1;Intelenvironment,manualEOI

out21h,al

out0A1h,al

inal,21h

movax,[wPICMask];restorePICmasks

out21h,al

moval,ah

out0A1h,al

sti

movax,4c00h

int21h

_TEXT16ends

Page 143: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

;---here'sthe64bitcodesegment.

;---since64bitcodeisalwaysflatbuttheDOSmzformatissegmented,

;---therearerestrictions,becausetheassemblerdoesn'tknowthe

;---linearaddresswherethe64bitsegmentwillbeloaded:

;---+directaddressingwithconstantsisn'tpossible(mov[0B8000h],rax)

;---sincetherip-relativeaddresswillbecalculatedwrong.

;---+64bitoffsets(movrax,offset<var>)mustbeadjustedbythelinear

;---addresswherethe64bitsegmentwasloaded(isinrbx).

;---

;---rbxmustpreservelinearaddressof_TEXT

_TEXTsegmentparause64public'CODE'

assumeds:FLAT,es:FLAT

long_start:

xoreax,eax

movss,eax

movesp,ecx

sti;nowinterruptscanbeused

callWriteStrX

db"Hello64bit",10,0

nextcmd:

movr8b,0;r8bwillbefilledbythekeyboardirqroutine

nocmd:

cmpr8b,0

jznocmd

cmpr8b,1;ESC?

jzesc_pressed

cmpr8b,13h;'r'?

jzr_pressed

callWriteStrX

db"unknownkey",0

moval,r8b

callWriteB

callWriteStrX

db10,0

jmpnextcmd

;---'r'key:displaysomeregistercontents

r_pressed:

callWriteStrX

db10,"cr0=",0

movrax,cr0

Page 144: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

callWriteQW

callWriteStrX

db10,"cr2=",0

movrax,cr2

callWriteQW

callWriteStrX

db10,"cr3=",0

movrax,cr3

callWriteQW

callWriteStrX

db10,"cr4=",0

movrax,cr4

callWriteQW

callWriteStrX

db10,"cr8=",0

movrax,cr8

callWriteQW

callWriteStrX

db10,0

jmpnextcmd

;---ESC:backtoreal-mode

esc_pressed:

jmp[bv]

bvlabelfword

ddoffsetbacktoreal

dw16

;---screenoutputhelpers

;---scrollscreenuponeline

;---rsi=linearaddressstartoflastline

;---rbp=linearaddressofBIOSarea(0x400)

scroll_screen:

cld

movedi,esi

movzxeax,wordptr[rbp+4Ah]

pushrax

learsi,[rsi+2*rax]

movcl,[rbp+84h]

mulcl

movecx,eax

repmovsw

poprcx

movax,0720h

repstosw

Page 145: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ret

WriteChr:

pushrbp

pushrdi

pushrsi

pushrbx

pushrcx

pushrdx

pushrax

movedi,0B8000h

movebp,400h

cmpbyteptr[rbp+63h],0B4h

jnz@F

xordi,di

@@:

movzxebx,wordptr[rbp+4Eh]

addedi,ebx

movzxebx,byteptr[rbp+62h]

movesi,edi

movzxecx,byteptr[rbx*2+rbp+50h+1];ROW

movzxeax,wordptr[rbp+4Ah]

mulecx

movzxedx,byteptr[rbx*2+rbp+50h];COL

addeax,edx

movdh,cl

leaedi,[rdi+rax*2]

moval,[rsp]

cmpal,10

jznewline

mov[rdi],al

movbyteptr[rdi+1],07

incdl

cmpdl,byteptr[rbp+4Ah]

jb@F

newline:

movdl,00

incdh

cmpdh,byteptr[rbp+84h]

jbe@F

decdh

callscroll_screen

@@:

mov[rbx*2+rbp+50h],dx

poprax

poprdx

poprcx

Page 146: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

poprbx

poprsi

poprdi

poprbp

ret

WriteStr:;writestringinrdx

pushrsi

movrsi,rdx

cld

@@:

lodsb

andal,al

jz@F

callWriteChr

jmp@B

@@:

poprsi

ret

WriteStrX:;writestringatrip

pushrsi

movrsi,[rsp+8]

cld

@@:

lodsb

andal,al

jz@F

callWriteChr

jmp@B

@@:

mov[rsp+8],rsi

poprsi

ret

WriteQW:;writeQWordinrax

pushrax

shrrax,32

callWriteDW

poprax

WriteDW:

pushrax

shrrax,16

callWriteW

poprax

WriteW:

pushrax

Page 147: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

shrrax,8

callWriteB

poprax

WriteB:;writeByteinal

pushrax

shrrax,4

callWriteNb

poprax

WriteNb:

andal,0Fh

addal,'0'

cmpal,'9'

jbe@F

addal,7

@@:

jmpWriteChr

;---exceptionhandler

exception:

excno=0

repeat32

pushexcno

jmp@F

excno=excno+1

endm

@@:

callWriteStrX

db10,"Exception",0

poprax

callWriteB

callWriteStrX

db"errcode=",0

movrax,[rsp+0]

callWriteQW

callWriteStrX

db"rip=",0

movrax,[rsp+8]

callWriteQW

callWriteStrX

db10,0

@@:

jmp$

;---clockandkeyboardinterrupts

clock:

Page 148: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

pushrbp

movebp,400h

incdwordptr[rbp+6Ch]

poprbp

interrupt:;handlerforallotherinterrupts

pushrax

moval,20h

out20h,al

poprax

iretq

keyboard:

pushrax

inal,60h

testal,80h

jnz@F

movr8b,al

@@:

inal,61h;givefinishinginformation

out61h,al;tokeyboard...

moval,20h

out20h,al;...andinterruptcontroller

poprax

iretq

_TEXTends

;---4kstack,usedinbothmodes

STACKsegmentuse16parastack'STACK'

db4096dup(?)

STACKends

endstart16

Page 149: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Win32_5-CreateaWin32Binarywith-bin

;---Win32"helloworld"consoleapplication.

;---UsesJWasm'sbinoutputformat,sonolinkerneeded.

;---assemble:JWasm-bin-FoWin32_5.exeWin32_5.ASM

.386

optioncasemap:none

.nolist

includewinnt.inc;includePEimagedefinitions

.list

STD_OUTPUT_HANDLEequ-11

IMAGEBASEequ400000h

PEHDRsegmentdwordFLAT

;---definetheDOS"MZ"header

orgIMAGEBASE

IMAGE_DOS_HEADER<"ZM",80h,1,0,4,0,-1,0,200h,0,0,0,0,0,<0>,0,0,<0>,IMAGERELPEHdr>

db0Eh;pushcs

db1Fh;popds

db0BAh,0Eh,0;movdx,text

db0B4h,09h;movah,9

db0CDh,21h;int21h

db0B8h,01h,4Ch;movax,4c01h

db0CDh,21h;int21h

db"ThisprogramcannotberuninDOSmode",13,10,'$'

orgIMAGEBASE+80h

;---definetheWin32"PE"header

PEHdrlabelbyte

db"PE",0,0

Page 150: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

IMAGE_FILE_HEADER<IMAGE_FILE_MACHINE_I386,num_sections,0,0,0,sizeofIMAGE_OPTIONAL_HEADER32,

IMAGE_FILE_RELOCS_STRIPPEDorIMAGE_FILE_EXECUTABLE_IMAGEorIMAGE_FILE_32BIT_MACHINEorIMAGE_FILE_LOCAL_SYMS_STRIPPED>

IMAGE_OPTIONAL_HEADER32{10Bh,;magic

6,0,;linkermajor,minor

1000h,1000h,0,;sizeofcode,initializeddata,uninitializeddata

IMAGERELmainCRTStartup,;entrypoint

IMAGERELstart_text,IMAGERELstart_rdata,;baseofcode,data

IMAGEBASE,;imagebase

1000h,200h,;sectionalignment,filealignment

4,0,;OSmajor,minor

0,0,;Imagemajor,minor

4,0,;Subsysmajor,minor

0,;win32version

3000h,;sizeofimage

1000h,;sizeofheader

0,;checksum

IMAGE_SUBSYSTEM_WINDOWS_CUI,

0,;dllcharacteristics

100000h,1000h,;stackres,com

100000h,1000h,;heapres,com

0,;loaderflags

16,;numberofdirectories

<<0,0>,;exports

<IMAGERELstart_idata,SECTIONRELendof_idata>,;imports

<0,0>,<0,0>,;resource,exception

<>,<>,<>,<>,;security,baserelocs,debug,architecture

<>,<>,<>,<>,;globalptr,tls,load_config,bound_import

<>,<>,<>,<>>};iat,delay_import,comdescriptor,reserved

;---definethesectiontable

sectiontablelabelbyte

IMAGE_SECTION_HEADER<".text",<sizeof_text>,IMAGERELstart_text,sizeof_text,

200h,0,0,0,0,060000020h>

IMAGE_SECTION_HEADER<".rdata",<SECTIONRELendof_idata+sizeof_const>,IMAGERELstart_rdata,SECTIONRELendof_idata+sizeof_const,

400h,0,0,0,0,040000040h>

num_sectionsequ($-sectiontable)/sizeofIMAGE_SECTION_HEADER

orgIMAGEBASE+200h;forcesphysicalsizeofheaderto200handsetsVAto400200h

PEHDRends

;---theALIGNxsegmentsareneededbecause

;---sectionalignmentandfilealignmentaredifferent

ALIGN1segmentdwordpublicFLAT'DATA'

Page 151: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

org0E00h;changepctoRVA1000h

ALIGN1ends

_TEXTsegmentdwordpublicFLAT'CODE'

_TEXTends

ALIGN2segmentdwordpublicFLAT'DATA'

org0E00h;changepctoRVA2000h

ALIGN2ends

_IDATAsegmentdwordpublicFLAT'DATA'

start_rdatalabelbyte

start_idatalabelbyte

;---importdescriptorsgohere

_IDATAends

_IDATA$1segmentdwordpublicFLAT'DATA'

IMAGE_IMPORT_DESCRIPTOR<<0>,0,0,0,0>

;---ILTentriesgohere

_IDATA$1ends

_IDATA$2segmentdwordpublicFLAT'DATA'

dd0;---endoflastILT

;---IATentriesgohere

_IDATA$2ends

_IDATA$3segmentdwordpublicFLAT'DATA'

dd0;---endoflastIAT

;---importnamestringsgohere

_IDATA$3ends

_IDATA$4segmentdwordpublicFLAT'DATA'

endof_idataequ$

_IDATA$4ends

CONSTsegmentdwordpublicFLAT'DATA'

start_constlabelbyte

CONSTends

DefineImpDllmacroname

_IDATAsegment

IMAGE_IMPORT_DESCRIPTOR<<IMAGERELname&ILT>,0,0,IMAGERELname,IMAGERELname&IAT>

_IDATAends

_IDATA$1segment

ifdefImportDefined

dd0;terminatepreviousILT

endif

name&ILTlabeldword

_IDATA$1ends

_IDATA$2segment

ifdefImportDefined

Page 152: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

dd0;terminatepreviousIAT

endif

name&IATlabeldword

_IDATA$2ends

_IDATA$3segment

namedb@CatStr(!",name,!"),0

align4

_IDATA$3ends

ImportDefinedequ1

endm

DefineImportmacroname

_IDATA$1segment

ddIMAGERELn&name

_IDATA$1ends

_IDATA$2segment

lp&nametypedefptrpr&name

namelp&nameIMAGERELn&name

_IDATA$2ends

_IDATA$3segment

n&namedw0

db@CatStr(!",name,!"),0

align4

_IDATA$3ends

endm

prWriteConsoleAtypedefprotostdcall:dword,:dword,:dword,:dword,:dword

prGetStdHandletypedefprotostdcall:dword

prExitProcesstypedefprotostdcall:dword

DefineImpDllkernel32

DefineImportExitProcess

DefineImportWriteConsoleA

DefineImportGetStdHandle

if0;iffurtherdllsaretobeimported

prMessageBoxAtypedefprotostdcall:dword,:dword,:dword,:dword

DefineImpDlluser32

DefineImportMessageBoxA

endif

CONSTsegment

stringdb13,10,"hello,world.",13,10

sizeof_constequ$-start_const

Page 153: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

CONSTends

_TEXTsegment

assumeds:FLAT,es:FLAT

start_textlabelnear

;---startofprogram

mainproc

localdwWritten:dword

localhConsole:dword

invokeGetStdHandle,STD_OUTPUT_HANDLE

movhConsole,eax

invokeWriteConsoleA,hConsole,addrstring,sizeofstring,addrdwWritten,0

xoreax,eax

ret

mainendp

;---entry

mainCRTStartupprocc

invokemain

invokeExitProcess,eax

mainCRTStartupendp

sizeof_textequ$-start_text

org200h;alignsizeof_TEXTtonext512byteboundary

_TEXTends

end

Page 154: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Win32_7-UsageofOPTIONDLLIMPORTand-FdSwitch

;---Win32_7-ShowshowtouseOPTIONDLLIMPORTandswitch-Fd.

;---Noimportlibrariesareneededinthelinkstep.

;---

;---assemble:JWasm-coff-FdWin32_7.ASM

;---link:JWlinkformatwindowspefWin32_7.OBJ

.386

.modelFLAT,stdcall

optioncasemap:none

STD_OUTPUT_HANDLEequ-11

optiondllimport:<kernel32>

WriteConsoleAproto:dword,:dword,:dword,:dword,:dword

GetStdHandleproto:dword

ExitProcessproto:dword

optiondllimport:<user32>

MessageBoxAproto:dword,:dword,:dword,:dword

optiondllimport:<none>

.const

msgdb13,10,"hello,world.",13,10

db0

.code

mainproc

localwritten:dword

invokeGetStdHandle,STD_OUTPUT_HANDLE

movebx,eax

invokeWriteConsoleA,ebx,addrmsg,sizeofmsg,

addrwritten,0

invokeMessageBoxA,0,addrmsg,0,0

ret

Page 155: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

mainendp

;---entry

start:

invokemain

invokeExitProcess,0

endstart

Page 156: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Win64_8-CreateaWin64Binarywith-pe

;---createa64-bitbinarywith-pecmdlineoption

;---

;---JWasm-peWin64_8.asm

.x64;-perequirestosetcpu,model&language

.modelflat,fastcall

optioncasemap:none

optionframe:auto;generateSEH-compatibleprologuesandepilogues

optionwin64:3;initshadowspace,reservestackatPROClevel

;---resourceIDs

IDR_MENU1equ100

IDR_BITMAP1equ101

IDM_EXITequ1000

NULLequ0

LPSTRtypedefptr

LPVOIDtypedefptr

UINTtypedefdword

BOOLtypedefdword

;---winbasedefinitions

HINSTANCEtypedefptr

;---winuserdefinitions

HWNDtypedefptr

HMENUtypedefptr

HICONtypedefptr

HBRUSHtypedefptr

HCURSORtypedefptr

HDCtypedefptr

HBITMAPtypedefptr

WPARAMtypedefptr

LPARAMtypedefqword

WS_OVERLAPPEDWINDOWequ0CF0000h

CW_USEDEFAULTequ80000000h

Page 157: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

SW_SHOWDEFAULTequ10

SW_SHOWNORMALequ1

IDC_ARROWequ32512

IDI_APPLICATIONequ32512

CS_VREDRAWequ1

CS_HREDRAWequ2

COLOR_WINDOWequ5

WM_DESTROYequ2

WM_PAINTequ000Fh

WM_COMMANDequ0111h

proto_WNDPROCtypedefproto:HWND,:qword,:WPARAM,:LPARAM

WNDPROCtypedefptrproto_WNDPROC

WNDCLASSEXAstruct8

cbSizedword?

styledword?

lpfnWndProcWNDPROC?

cbClsExtradword?

cbWndExtradword?

hInstanceHINSTANCE?

hIconHICON?

hCursorHCURSOR?

hbrBackgroundHBRUSH?

lpszMenuNameLPSTR?

lpszClassNameLPSTR?

hIconSmHICON?

WNDCLASSEXAends

POINTstruct

xsdword?

ysdword?

POINTends

MSGstruct8

hwndHWND?

messagedword?

wParamWPARAM?

lParamLPARAM?

timedword?

ptPOINT<>

MSGends

RECTstruct

leftsdword?

topsdword?

Page 158: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

rightsdword?

bottomsdword?

RECTends

PAINTSTRUCTstruct8

hdcHDC?

fEraseBOOL?

rcPaintRECT<>

fRestoreBOOL?

fIncUpdateBOOL?

rgbReservedbyte32dup(?)

PAINTSTRUCTends

;---wingdidefinitions

DIB_RGB_COLORSequ0

SRCCOPYequ00CC0020h

HGDIOBJtypedefptr

BITMAPINFOHEADERstruct

biSizedword?

biWidthsdword?

biHeightsdword?

biPlanesword?

biBitCountword?

biCompressiondword?

biSizeImagedword?

biXPelsPerMetersdword?

biYPelsPerMetersdword?

biClrUseddword?

biClrImportantdword?

BITMAPINFOHEADERends

optiondllimport:<kernel32>

GetModuleHandleAproto:LPSTR

GetCommandLineAproto

ExitProcessproto:UINT

optiondllimport:<user32>

BeginPaintproto:HWND,:ptrPAINTSTRUCT

CreateWindowExAproto:dword,:LPSTR,:LPSTR,:dword,:sdword,:sdword

DefWindowProcAproto:HWND,:UINT,:WPARAM,:LPARAM

DestroyWindowproto:HWND

DispatchMessageAproto:ptrMSG

EndPaintproto:HWND,:ptrPAINTSTRUCT

GetClientRectproto:HWND,:ptrRECT

Page 159: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

GetMessageAproto:ptrMSG,:HWND,:sdword,:sdword

LoadBitmapAproto:HINSTANCE,:LPSTR

LoadCursorAproto:HINSTANCE,:LPSTR

LoadIconAproto:HINSTANCE,:LPSTR

PostQuitMessageproto:sdword

RegisterClassExAproto:ptrWNDCLASSEXA

ShowWindowproto:HWND,:sdword

TranslateMessageproto:ptrMSG

UpdateWindowproto:HWND

optionDLLIMPORT:<gdi32>

BitBltproto:HDC,:dword,:dword,:dword,:dword,:HDC,:

CreateCompatibleDCproto:HDC

DeleteDCproto:HDC

GetDIBitsproto:HDC,:HBITMAP,:dword,:dword,:ptr,:ptrBITMAPINFO,:

SelectObjectproto:HDC,:HGDIOBJ

optiondllimport:none

WinMainproto:HINSTANCE,:HINSTANCE,:LPSTR,:UINT

.data

ClassNamedb"SimpleWinClass",0

AppNamedb"Bitmaprendering",0

.data?

hInstanceHINSTANCE?

hBitmapHBITMAP?

CommandLineLPSTR?

.code

WinMainCRTStartupprocFRAME

invokeGetModuleHandleA,NULL

movhInstance,rax

invokeGetCommandLineA

movCommandLine,rax

invokeWinMain,hInstance,NULL,CommandLine,SW_SHOWDEFAULT

invokeExitProcess,eax

WinMainCRTStartupendp

WinMainprocFRAMEhInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:UINT

localwc:WNDCLASSEXA

Page 160: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

localmsg:MSG

localhwnd:HWND

invokeLoadBitmapA,hInst,IDR_BITMAP1

movhBitmap,rax

movwc.cbSize,sizeofWNDCLASSEXA

movwc.style,CS_HREDRAWorCS_VREDRAW

learax,[WndProc]

movwc.lpfnWndProc,rax

movwc.cbClsExtra,NULL

movwc.cbWndExtra,NULL

movrcx,hInst

movwc.hInstance,rcx

movwc.hbrBackground,COLOR_WINDOW+1

movwc.lpszMenuName,IDR_MENU1

learax,[ClassName]

movwc.lpszClassName,rax

invokeLoadIconA,NULL,IDI_APPLICATION

movwc.hIcon,rax

movwc.hIconSm,rax

invokeLoadCursorA,NULL,IDC_ARROW

movwc.hCursor,rax

invokeRegisterClassExA,addrwc

invokeCreateWindowExA,NULL,ADDRClassName,ADDRAppName,

WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,

CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,NULL,NULL,

hInst,NULL

movhwnd,rax

invokeShowWindow,hwnd,SW_SHOWNORMAL

invokeUpdateWindow,hwnd

.while(1)

invokeGetMessageA,ADDRmsg,NULL,0,0

.break.if(!eax)

invokeTranslateMessage,ADDRmsg

invokeDispatchMessageA,ADDRmsg

.endw

movrax,msg.wParam

ret

WinMainendp

WndProcprocFRAMEhWnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM

localhdc2:HDC

localps:PAINTSTRUCT

localrect:RECT

localbmi:BITMAPINFOHEADER

Page 161: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

.ifedx==WM_DESTROY

invokePostQuitMessage,NULL

xorrax,rax

.elseifedx==WM_COMMAND

.ifwParam==IDM_EXIT

invokeDestroyWindow,hWnd

.endif

xoreax,eax

.elseifedx==WM_PAINT

invokeBeginPaint,hWnd,addrps

invokeCreateCompatibleDC,ps.hdc

movhdc2,rax

invokeSelectObject,hdc2,hBitmap

movbmi.biSize,sizeofBITMAPINFOHEADER

movbmi.biBitCount,0

invokeGetDIBits,hdc2,hBitmap,0,0,0,addrbmi,DIB_RGB_COLORS

invokeGetClientRect,hWnd,addrrect

movr8d,rect.right

subr8d,bmi.biWidth

jnc@F

xorr8d,r8d

@@:

shrr8d,1

movr9d,rect.bottom

subr9d,bmi.biHeight

jnc@F

xorr9d,r9d

@@:

shrr9d,1

invokeBitBlt,ps.hdc,r8d,r9d,bmi.biWidth,bmi.biHeight,hdc2,0,0,SRCCOPY

invokeDeleteDC,hdc2

invokeEndPaint,hWnd,addrps

xoreax,eax

.else

invokeDefWindowProcA,rcx,edx,r8,r9

.endif

ret

WndProcendp

if1;for-pe

RT_BITMAPequ2

RT_MENUequ4

;---menuresourceflags

Page 162: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

MF_POPUPequ10h

MF_ENDequ80h

IMAGE_RESOURCE_DIRECTORYstruct

Characteristicsdword?

TimeDateStampdword?

MajorVersionword?

MinorVersionword?

NumberOfNamedEntriesword?

NumberOfIdEntriesword?

IMAGE_RESOURCE_DIRECTORYends

IMAGE_RESOURCE_DIRECTORY_ENTRYstruct

union

r0recordNameIsString:1,NameOffset:31

Name_dword?

Idword?

ends

union

OffsetToDatadword?

r1record DataIsDirectory:1,OffsetToDirectory:31

ends

IMAGE_RESOURCE_DIRECTORY_ENTRYends

IMAGE_RESOURCE_DATA_ENTRYstruct

OffsetToDatadword?

Size_dword?

CodePagedword?

Reserveddword?

IMAGE_RESOURCE_DATA_ENTRYends

optiondotname

.rsrcsegmentdwordFLATpublicread'RSRC'

;---definemenuIDR_MENU1andbitmapIDR_BITMAP1

;---rootlevel:enumtheresourcetypes

IMAGE_RESOURCE_DIRECTORY<0,0,0,0,0,2>

IMAGE_RESOURCE_DIRECTORY_ENTRY<<RT_BITMAP>,<SECTIONRELbms+80000000h>>

IMAGE_RESOURCE_DIRECTORY_ENTRY<<RT_MENU>,<SECTIONRELmenus+80000000h>>

;---secondlevel:enumtheIDsofresourcetypeX

bmsIMAGE_RESOURCE_DIRECTORY<0,0,0,0,0,1>

IMAGE_RESOURCE_DIRECTORY_ENTRY<<IDR_BITMAP1>,<SECTIONRELbm1+80000000h>>

menusIMAGE_RESOURCE_DIRECTORY<0,0,0,0,0,1>

IMAGE_RESOURCE_DIRECTORY_ENTRY<<IDR_MENU1>,<SECTIONRELmenu1+80000000h>>

Page 163: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

;---thirdlevel:enumthelanguagesofIDX

bm1IMAGE_RESOURCE_DIRECTORY<0,0,0,0,0,1>

IMAGE_RESOURCE_DIRECTORY_ENTRY<<409h>,<SECTIONRELbm1_l1>>

menu1IMAGE_RESOURCE_DIRECTORY<0,0,0,0,0,1>

IMAGE_RESOURCE_DIRECTORY_ENTRY<<409h>,<SECTIONRELm1_l1>>

;---lastlevel:definetheresourcedata

;---dataformenuIDR_MENU1,language409h

m1_l1IMAGE_RESOURCE_DATA_ENTRY<IMAGERELm1_l1_data,size_m1_l1,0,0>

m1_l1_datadw0,0 ;menuheader

dwMF_POPUPorMF_END,'&','F','i','l','e',0

dwMF_END,IDM_EXIT,'E','&','x','i','t',0

size_m1_l1equ$-m1_l1_data

align4

;---dataforbitmapIDR_BITMAP1

bm1_l1IMAGE_RESOURCE_DATA_ENTRY<IMAGERELbm1_l1_data,size_bm1_l1,0,0>

bm1_l1_datalabelword

incbin<Win32_8.bmp>,14 ;skipbitmapfileheader

size_bm1_l1equ$-(bm1_l1_data)

.rsrcends

;---set/subsystem:windows

;---thePEheaderisstoredinsection.hdr$2

optiondotname

.hdr$2segmentdwordFLATpublic'HDR'

org5Ch;positiontoIMAGE_NT_HEADER64.OptionalHeader.Subsystem

dw2;2=subsystemwindows

.hdr$2ends

endif

endWinMainCRTStartup

Page 164: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AppendixC.ErrorsandWarningsThewarninganderrornumbersemittedbyJWasmdifferfromMasm's.However,thetextsofthemessagesareprettymuchidentical.AsinMasm,thefirstdigitshowstheseverityoftheissue:range1xxxreportsafatalerror(assemblyprocessisstopped),range2xxxindicatesanerror(assemblyprocesscontinues,butnoobjectmodulewillbecreated)and4xxxarewarnings.

x029Multiplebaseregistersnotallowed

In16-bitcode,onecannotusebothBXandBPinindirectaddressing;in32/64-bitcode,ESP/RSPcanonlyappearonceinindirectaddressing.

x030

InstructionorregisternotacceptedincurrentCPUmode

x031InvalidaddressingmodewithcurrentCPUsetting

x032CannotuseTRn-TRnwithcurrentCPUsetting

TheTRxspecialregisterswererestrictedto80386and80486cpus.

x033Mustbeindexorbaseregister

x034Multipleindexregistersnotallowed

x035

x036 Scalefactormustbe1,2,4or8

x037Cannotbeusedasindexregister:<register>

Indexregistersarerestricted.In16-bitmode,onlySIandDIcanbeindexregisters.In32-bitmode,allgeneral-purposeregistersexceptESPcanbeindexregisters.

Baseandindex

Page 165: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

x038 registerdifferinsize

x039 Expectingcomma

x040ORGneedsaconstantorlocaloffset

x041 POPCSisnotallowed

x042OnlyMOVcanusespecialregister

ThespecialregistersCRx,DRxandTRxcanonlybemovedto/fromgeneralpurposeregisters.

x043CannotuseSHORTwithCALL

DistanceofCALLoperandsmustbeNEARorFAR.

x044OnlySHORTjumpdistanceisallowed

Somejumpinstructionsacceptshortdistancesonly(JCXZ,JECXZ,LOOPx).

x045 Syntaxerror

x046Prefixmustbefollowedbyaninstruction

x047 Syntaxerror:Unexpectedcolon

x048

Operandsmustbethesamesize:<sizeop1>-<sizeop2>

x049 Invalidinstructionoperands

x050JumpdistancenotpossibleincurrentCPUmode

Jccinstructionswon'taccepttypecoercionsthatincreasethejumpdistance(i.e."jzNEARPTRlabel")ifcurrentcpuis<80386.

x051 ImmediatedataoutofrangeCannotuseshortornearmodifiers

Page 166: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

x052withthisinstruction

x053 Jumpoutofrangeby<num>byte(s) Ashortdistancemustbeintherange-128to+127.

x054Displacementoutofrange:<displacement>

x055 Initializervaluetoolarge

x056Symbolalreadydefined:<symbol>

x057Offsetmagnitudetoolargeforspecifiedsize

x058Magnitudeofoffsetexceeds16bit

x059Operand2toobig

x060Operand1toosmallx061 Linetoolong Sizeofaline(afterconcatenation)isrestrictedto600.

x062 Toomanytokensinaline Thenumberoftokensinalineisrestrictedto150.

x063

x064Operandisexpected

x065Constantexpected

Aconstant(numeric)valueisexpectedinthecurrentcontext.Notethatalabel-moreexactly:theoffsetpartofalabel'saddress-isnotaconstantvalue,sincethefinalvalueiscalculatedbythelinker(ortheOSloader)only.

x066ConstantoperandisexpectedTheexpressionevaluatoracceptsaconstantonlyinthecurrentcontext.

.ELSEclause An.IFblockmaycontain0or1.ELSEclausesandit

Page 167: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

x067 alreadyoccuredinthis.IFblock

mustbethelastclausebefore.ENDIF.

x068Multipleoverrides

x069Segment,grouporsegmentregisterexpected

Theoperandbeforethecolonoperator(:)mustbeasegment,grouporsegmentregister.

x070 Identifiertoolong

Identifernamesarerestrictedto247.ThisisahardlimitforOMFoutputformat.Forotherformats,thelimitmaybeextendedbyadjustingandrecompilingthesourcecode.

x071Invalidoperandsizeforinstruction

x072Notsupported:<directive>

Messageisdisplayedifoneofthefollwingoptionsisspecified:OPTIONREADONLY,OPTIONEXPR16,OPTIONOLDMACROS.Thosearecurrentlynotsupported.

x073 Sizenotspecified,assuming:<type>

thisisawarning.<type>maybeBYTE,WORDorDWORD.Themessagemayoccurifanimmediatevalueiswrittentoanuntypedmemoryreference:

mov[ebx],1

JWasmmakesaguessanddisplaysthewarning,whileMasmwilldisplayanerrorinsuchcases.

x074 Floating-pointinitializerignored

x075

OnlySHORTandNEARjumpdistanceisallowed

Conditionaljump(Jcc)instructiondestinationcannotbefar.

x076

InitializermagnitudetoolargeforspecifiedsizeSegmentattribute

Page 168: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

x077 isdefinedalready:<attribute>

x078Segmentdefinitionchanged:%s,%s

x079Classnametoolong Segmentclassnamesarerestrictedto255insize.

x080Blocknestingerror:%s

x081 Segmentattributeisunknown:%s

x082Mustbeinsegmentblock

Instructionsanddirectivesthatgeneratecodeordatamustbeinsideasegmentblock.

x083Segmentnotdefined:<segment>

x084Colonisexpected

x085 Invalidqualifiedtype:%s

x086Qualifiedtypeisexpectedx087

x088 Librarynameismissing

x089

Cannotaccesslabelthroughsegmentregisters:<label>

x090Linetoolongafterexpansion:<line>

x091 Languagetypemustbespecified

x092

PROC,MACROormacroloopdirectivemust

Page 169: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

precedeLOCAL

x093Cannotnestprocedures

x094VARARGrequiresCcallingconvention

x095

Multiple.MODELdirectives,.MODELignored

x096Modelisnotdeclared

Withoutamodel,simplifiedsegmentdirectives(.CODE,.DATA,.CONST,.DATA?,.STACK,.FARDATAand.FARDATA?)anddirectives.STARTUP,.EXITcannotbeused.

x097Backquotemissing:`<identifier>

x098COMMENTdelimiterexpected

x099ENDdirectiverequiredatendoffile

x100Nestingleveltoodeep

x101Macronestingleveltoodeep

x102Symbolnotdefined:<symbol>

x103

x104Nofilenamespecified.

x105OutofMemory

Thisisafatalerror.Withthe8086-versionofjwasm,JWASMR,you'llseethiserrorifyoutrytoassemblesomethingthatcontainsafewthousandsymbols.The32-or64-bitversionsofjwasmshouldalwayshave

Page 170: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

enoughmemoryonmodernmachines.

x106Cannotopenfile:"<file>"[<errorcode>]

ErrorcodeENOENTmeans"filenotfound".Othererrorcodesaredisplayedasnumbers

x107Cannotclosefile:<file>[<errorcode>]

x108Filewriteerror:<file>[<errorcode>]

Usuallyhappensifoutputmediaisread-onlyorfull.

x109Invalidcommand-lineoption:<option>

x110Internalerrorin<sourcefile>(<line>)

Thiserrorshouldn'tbeseeninthereleaseversion.It'sdisplayediftheinternalassert()functioniscalled,whichusuallyisdonewhena"virtuallyimpossible"errorconditionhasoccurred.

x111 Expectingclosingsquarebracket

x112 Expectingfilename

x113 Toomanyerrors Usecommandlineoption-etosetthemax.numberoferrorsthataredisplayed

x114 forcederror<message> Generic"forcederror"message

x115forcederror:Valuenotequalto0:<value><text>

Erroremittedbythe.ERRNZdirective.

x116forcederror:Valueequalto0:<value><text>

Erroremittedbythe.ERREdirective.

x117forcederror:symboldefined:<symbol>

Erroremittedbythe.ERRDEFdirective.

forcederror:symbolnot

Page 171: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

x118 defined:<symbol>

Erroremittedbythe.ERRNDEFdirective.

x119forcederror:stringblank:<string>

Erroremittedbythe.ERRBdirective.

x120forcederror:stringnotblank:<string>

Erroremittedbythe.ERRNBdirective.

x121

forcederror:stringsnotequal:<string>:<string>

Erroremittedbythe.ERRDIFand.ERRDIFIdirectives.

x122

forcederror:stringsequal:<string>:<string>

Erroremittedbythe.ERRIDNand.ERRIDNIdirectives.

x123 <file>(<line>):IncludedbyAdditionalerrorinformationiferroroccuredinanincludefile.

x124<file>(<line>)[<macro>]:Macrocalledfrom

Additionalerrorinformationiferroroccuredinsideamacro.

x125

<file>(<line>):iteration<iteration>:Macrocalledfrom

Additionalerrorinformationiferroroccuredinsidealoopmacro(FOR,FORC,REPEAT,...).

x126 <file>(<line>):MainlinecodeAdditionalerrorinformationiferroroccuredinsideanincludefileoramacro.

x127 Extendingjump

x128Directiveignored:%s

x129 numbermustbeapowerof2

x130Incompatiblewithsegmentalignment:%s

Page 172: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

x131 Segmentexpected:%s

x132IncompatibleCPUmodefor32-bitsegment

x133Farcallisconvertedtonearcall.

x134CPUoption%sisnotvalidforselectedCPU.

x135Segment'%s'isinanothergroupalready

x136 Symboltypeconflict:%s

x137Conflictingparameterdefinition:%s

x138

PROCandPROTOcallingconventionconflict

x139Non-benign%sredefinition:%s

x140 ToomanybitsinRECORD:%s

x141

Statementnotallowedinsidestructuredefinition

x142Unmatchedblocknesting:%s

x143 Symbolredefinition:%sx144 Textitemrequired

Page 173: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

x145INVOKEargumenttypemismatch:argument%u

x146ToofewargumentstoINVOKE:%s

x147VARARGparametermustbelast

x148 LABELparametermustbefirst

x149Toomanyargumentsinmacrocall:%s

Thisisawarning.Macroisinvokedwithmoreargumentsthanexpected.

x150Missingoperatorinexpression

x151Unexpectedliteralfoundinexpression:%s

Literalsenclosedin<>or{}areitemsprocessedbythepreprocessorortoinitialize"structured"dataitems.Ifthey'reusedotherwise,thiserrorwilloccur.

x152Initializermustbeastringorsingleitem:%s

x153Toomanyinitialvaluesforstructure:%s

x154Toomanyinitialvaluesforarray:%s

x155 Stringortextliteraltoolong

x156PROLOGUEmustbemacrofunction

Theuser-definedprologuemacromustbeamacrofunction,thatis,theremustbeanEXITMsomewhereinsidethatreturnsaliteral.

x157EPILOGUEmustbemacroprocedure:%s

Theuser-definedepiloguemacromustbeamacroprocedure,thatis,theremustNOTbeanEXITMsomewhereinsidethatreturnsaliteral.

Page 174: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

x158Reservedwordexpected

x159INVOKErequiresprototypeforprocedure

x160Invalidtypefordatadeclaration:%s

x161OperandmustbeRECORDtypeorfield

x162Unmatchedmacronesting

x163 Empty(null)string

x164Nosegmentinformationtocreatefixup:%s

x165RegistervalueoverwrittenbyINVOKE

x166Missingquotationmarkinstring

x167Dividebyzeroinexpressionx168GeneralFailure

x169

Cannothaveimplicitfarjumporcalltonearlabel

x170 Invaliduseofregister

x171Distanceinvalidforcurrentsegment

Page 175: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

x172 Initializermagnitudetoolarge:%s

x173Cannotaddtworelocatablelabels

x174Cannotdefineaspublicorexternal:<symbol_name>

Textmacros,macros,stackvariables,structurefieldsorsegment/groupscannotbepublicorexternal.

x175 Positivevalueexpected

x176FARnotallowedinFLATmodelCOMMvariables

x177ToomanyargumentstoINVOKE

x178Directivemustappearinsideamacro

x179 Invalidtypeexpression

x180

CannotdeclarescopedcodelabelasPUBLIC:<label>

x181 Invalidradixtag

x182Instructionoperandmusthavesize

Theinstructionallowsoperandswithmorethanjustonesize,andthewantedsizecannotbeguessedfromthecurrentoperands.

x183UseofregisterassumedtoERROR

x184

Instructionsandinitializeddatanotsupportedin<seg_type>

<seg_type>maybeBSSorAT.Suchsegmentsdon'thavedata.

Page 176: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

segments

x185 Literalexpectedafter'='

x186No4kPage-alignedsegmentsinMS386OMF

A4Kpage-alignedsegmentisn'tcompatiblewithMSOMFformat,it'saPharLabextension.Thiswarningwon'tappearinthestandardversion.

x187x188Operandmustbe

relocatable

x189Constantorrelocatablelabelexpected

x190

[ELSE]IF2/.ERR2notallowed,single-passassembler

x191ExpressiontoocomplexforUNTILCXZ

x192Operandsmustbeinsamesegment

x193Invaliduseofexternalsymbol:<symbol_name>

x194

For-coffleadingunderscorerequiredforstartlabel:<start_label>

x195Invalidcommand-linevalue,defaultisused:%s

x196

Unknownfixuptype:%uat<segment>.<offset>

Page 177: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

x197Unsupportedfixuptypefor<format>:<type>

x198

Invalidfixuptypefor<format><type>atlocation<segment>.<offset>

x199Syntaxerrorincontrol-flowdirective

x200Invalid.modelparameterforflatmodel

x201

Outputformatdoesn'tsupportexternals:<symbol>

InformatsBINandMZallreferencesmustbelocaltothemodule.

x202 Invalidstartlabelfor-bin

x203Nostartlabeldefined

Warning,formatMZonly:MZ-binariesusuallyhaveastartlabel.Insomecases(i.e.overlays)amissingstartlabelmaybeok.

x204NostackdefinedWarning,formatMZonly:MZ-binariesusuallyhaveastack.Insomecases(i.e.overlays)amissingstackmaybeok.

x205Invalidalignment-valuemustbe2^n(n=4..15)

x206Indexvaluepastendofstring:<value>

TheindexargumentofSUBSTRorINSTRisbeyondthestringargumentlength

x207Countvaluetoolarge

x208Countmustbepositiveorzero

Page 178: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

x209 Syntaxerror:<item>

Theparserfoundanitemthathasnomeaninginthecurrentcontext

x210x211

x212Mustusefloating-pointinitializer

x213ORGdirectivenotallowedinunions

x214Structalignmentmustbe1,2,4,8,16or32

x215 StructurecannotbeinstancedAstructurethathassize0orthatcontainsanORGdirectivecannotbeinstanced.

x216Missinganglebracketorbraceinliteral

x217Nondigitinnumber:<number>

x218 16bitfixupfor32bitlabel:%s

x219 ToomanymacroplaceholdersThenumberofparametersandlocalsforamacromustnotexceed256

x220Missingmacroargument:%s,parameter%u

x221Doesn'tworkwith32-bitsegments:<directive>

Directives.STARTUPand.EXITworkfor16-bitonly.

x222 Segmentexceeds64klimit:%s InMZformat,16-bitsegmentsarerestrictedto64k.

x223NotsupportedwithOMFformat:%s

Notsupported Thedirectiveorfeatureisn'tsupportedbyallformats.

Page 179: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

x224withcurrentoutputformat:%s

Forexample,segment-relateddirectivesorattributeswon'tmakemuchsenseforflatformatslikeCOFForELF.

x225Unknowndefaultprologueargument:%s

x226 LOADDSignoredinflatmodel

x227Missingrightparenthesisinexpression

x228Invalidoperandfor<operator>:<operand>

x229Structureimproperlyinitialized:%s

x230 Expected:%s

x231 Invaliddatainitializer

x232 ExpecteddatalabelSomeoperators(LENGTH,SIZE)workwithdatalabelsonly.

x233 Expressionmustbeacodeaddress

x234-nOptionneedsavalidnameparameter

x235Constantvaluetoolarge:<value>thevalueoftheconstantdoesn'tfitin64or-ifitisanumbertobeassignedtoasymbolicconstant-32bits.

x236Textmacrowasusedbeforedefinition

thisisawarningonly.However,usingtextmacrosbeforetheyhavebeendefinedwillforceJWasmtodoafullsecondpass,whichincreasesassemblytime.

x237OffsetsizeincompatiblewithcurrentsegmentInstructionform

Page 180: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

x238 requires80386

x239

Group/Segmentoffsetsizeconflict:<groupoffset>-<segmentoffset>

Segmentswithinagroupmustallhavethesameoffsetsize.

x240Assemblypassesreached:<passes>

Althoughthisisawarningonlyitusuallyindicatesasevereproblem.Theassemblerisveryprobablyunabletocalculate"final"valuesofalllabelsandhastobeterminatedbypressingCtrl-C.

x241

Filenameparametermustbeenclosedin<>orquotes

TheINCBINdirectiverequiresdelimitersforitsfilename.

x242

StartaddressonENDdirectiveignoredwith.STARTUP

x243

Invalidsymboltypeinexpression:<symbol>

Theexpressionevaluatorhasencounteredasymbolthatismeaninglessinexpressions,forexamplea(text)macro.

x244Missingrightparenthesis

x245Directivemustbeincontrolblock

.ELSE,.ELSEIFand.ENDIFarevalidinside.IF-blocks,.BREAK,.CONTINUEmayoccurinside.WHILE-or.REPEAT-blocks,.ENDWneedsapreceding.WHILEand.UNTILneedsapreceding.REPEAT.

x246 Expected:memorymodelthe.MODELdirectiveneedsatleastoneparameter,thememorymodel.

x247 Typeiswrongsizeforregister

x248IF[n]DEFexpectsaplainsymbolasargument

thisisawarning.Masmacceptsanyexpressionasargumentfordirectives[ELSE]IF[N]DEF,buttheresultprobablyisn'talwayswhathasbeenexpected.

Page 181: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

x249Jumpdestinationmustspecifyalabel

x250 Ignored:<attribute>

Anattributeorparameterofadirectivewasfound,butnothandled.SeeKnownBugsandmissingFeaturesfordetailsaboutwhatfeaturesaren'timplementedyet.

x251Missingargumentforcmdlineoption

x252Invalidcoprocessorregister

x253

RegistersAH-DHmaynotbeusedwithSPL-DILorR8-R15

64-bitonly.

x254.ENDPROLOGfoundbeforeEHdirectives

64-bitonly.

x255

MissingFRAMEinPROC,nounwindcodewillbegenerated

64-bitonly.

x256Badalignmentforoffsetinunwindcode

64-bitonly.

x257Nonzerovalueexpected

x258Sizeofprologtoobig,mustbe<256bytes

64-bitonly.

x259Missing.ENDPROLOG:%s

64-bitonly.

x260.SAFESEHargumentmustbeaPROC

Page 182: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

x261Directiveignoredwithout-%sswitch

x262

ELFGNUextensions(8/16-bitrelocations)used

Thisisawarningonly.Theextensionsarenot"official",buttheGNUlinkerLDwillunderstandthem.

x263 Syntaxerrorinexpression

x264Macrolabelnotdefined:%s

ThetargetofaGOTOmustbewithintheverysamemacro.

x265

Procedureargumentorlocalnotreferenced:%s

Thiswarningisdisplayedonlyifatleast-W3isspecified.

x266

Groupdefinitiontoolarge,truncated:<group_name>

ThesizeoftheOMFrecordthatistodefineagroupwouldexceed4kB.However,toseethiserroryou'llhavetodefineagroupthatistocomprisemorethan1000segments,

x267COMMvariableexceeds64K:<variable>

in16-bit,thesizeofaCOMMvariableisrestrictedto64kB.

x268Mustbepublicorexternal:%s

Namesthataretobeknownbythelinkermustbepublicorexternal.

x269parameter/localnameisreservedword:%s

Thisisawarning.Thenamesofmacroparametersorlocalshavehighestpriorityandhencethereservedwordwillbecomeinaccessiblewithinthemacro.

x270realorBCDnumbernotallowed

x271 structurefieldexpected

x272Constantvaluetoolarge:<value>thevalueoftheconstantdoesn'tfitin64or-ifitisanumbertobeassignedtoasymbolicconstant-32bits.

x273ELSEclausealreadyoccuredin AnIFblockmaycontain0or1ELSEclausesanditmustbethelastclausebeforeENDIF.

Page 183: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

thisIFblock

x274 Illegaluseofsegmentregister

x275Groupexceeds64K:<group>

MZformatonly:agroupthatcontains16-bitsegmentscannotbelargerthan64kB,becausethegroupmustfitintoaphysicalsegment.

x276 EXPORTmustbeFAR:<symbol>A16-bitprocedurethatistobeexportedmustbedeclaredwiththeFARdistanceattribute.

Page 184: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AppendixD.DifferencesbetweenMasm6andMasm8ThisisnotstrictlyJWasm-related,butsincealotofdocumentationthatcanbefoundaboutMasmstillreferstoMasmv6orMasmv6.1only,it'susefultolistthedifferences.

defaultoutputformathasbeenchangedfromOMFtoCOFFinMasm8.expressionevaluatorcalculationsaredonein64-bitinsteadof32-bit.Thisisnotalwaysreflectedinthelistingfile,wherethevaluesmaybetruncatedto32-bit.somesegmentattributeshavebeenaddedinMasm8tocovertheCOFFsectionattributebits.Theseare:

INFODISCARDNOCACHENOPAGESHAREDEXECUTEREADWRITEALIASALIGN

the-safesehcommandlineoptionandthe.SAFESEHdirectivehavebeenaddedinMasm8.Masm8understandsafewnewdatatypes:

OWORD-128-bitintegerMMWORD-64-bitdatatypeforMMXXMMWORD-128-bitdatatypeforSSE

severalunaryoperatorsarenewforMasm8:LOW32-returnsthelower32-bitofanexpressionHIGH32-returnstheupper32-bitofanexpressionIMAGEREL-returnstheimagerelativeoffsetofanexpression(akaRVA).COFFformatonly.SECTIONREL-returnsthesectionrelativeoffsetofanexpression.

Page 185: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

COFFformatonly.Pleasenote:LOW32andHIGH32operatorswon'tacceptplainnumberswithvaluesthatexceed32-bits.Masm8understandsinstructionsetsuptoSSE3.ThelastversionofMasm6,version6.15,supportsSSE2only.Masm8alsounderstandsIntel'sVMXandAMD'sSVMextensions(x86virtualization).Masm8needsatleastWindows2000,itwon'trunonWindows9x(withouthacks).Masm8needsaMSVCruntimedll-MSVCR80.DLL-torun,whileMasm6wasastand-alonebinary.Finally,Masm8fixessomebugsandintroducesafewnewones.OneofthenewbugsisthatMasm8hasproblemswithwildcardsinfilenames;entering

ml.exe-c*.asm

toassembleallassemblyfilesinadirectorywon'tworkasexpected.

Page 186: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AppendixE.Restrictionsofprecompiled16-bitBinaryJWASMR.EXEJWASMRlackssomefeaturesoftheotherprecompiledbinaries:

nosupportforlongfilenames.nosupportforOpenWatcom'sfastcallregisterconvention.supportsOMF,BINandMZoutputformatsonly.nosupportfor64-bit,SSSE3,SSE4andAVX.nosupportforOPTIONvariantsthatarespecificforCOFF,ELFor64-bit.nosupportforOPTIONCODEVIEWdirective.nosupportfordirectiveLABEL'sarraysizesyntaxextension.

SincetheJWasmsourceisavailable,onemayenablethisorthatfeatureifreallyneeded,though.

Page 187: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AppendixF.AdditionalFeaturesofJWasm'sDebugVersionNote:therearenoprecompileddebugversionsofJWasmavailable.Suchversionshavetobecreatedfromthesourcecode.Seethecommentsinthemakefileshowtodothat.

Thedebugversionoffersthefollowingadditionalcommandlineoptions:-af Displayallfilesusedinassemblyprocess-ce Causeanexception-dm Displayallmessages-dr Displayreservedwords-drh Displayreservedwordshashtable-ds Displayglobalsymbols-dsh Displayglobalsymbolshashtable-dt Displaydebugtrace-ls Displaypreprocessedlinestorage-nbp Disableback-patching-nfp Dofullsubsequentpasses(disables"fastpass")-pm=<n> Stopassemblyafternpasses-sp Skippreprocessorstep

Page 188: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

OPTIONCSTACK

OPTIONCSTACK:[ON|OFF]

TheCSTACKoptioncontrolthestack-framecreationbyinvoke.ThedefaultsettingisOFF.

Example

OPTIONCSTACK:ON

cstackPROCUSESesiediebxarg

sub esp,arg

ret

cstackENDP

OPTIONCSTACK:OFF

astackPROCUSESesiediebxarg

sub esp,arg

ret

astackENDP

Generatedcode

cstackPROCUSESesiediebxarg

push esi

push edi

push ebx

push ebp

mov ebp,esp

sub esp,arg

leave

pop ebx

pop edi

pop esi

retn 4

cstackENDP

Page 189: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

OPTIONCSTACK:OFF

astackPROCUSESesiediebxarg

push ebp

mov ebp,esp

push esi

push edi

push ebx

sub esp,arg

pop ebx

pop edi

pop esi

leave

retn4

astackENDP

SeeAlso

DirectivesReference

Page 190: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

OPTIONSWITCH

OPTIONSWITCH:[C|PASCAL|TABLE|NOTABLE|NOREGS|REGAX|NOTEST]

Theswitchcomesintwomaintypes:astructuredswitch(Pascal)oranunstructuredswitch(C).Thedefaulttypeisunstructured.

TheTABLEandNOTABLEoptionscontrolthejump-tablecreationintheswitch.ThedefaultsettingisNOTABLE.

TheNOREGSandREGAXoptionscontroltheusageofregistersinjump-tablecreationintheswitch.ThedefaultsettingisNOREGS.

TheNOTESToptionisshortlivedandskipstherange-testinthejumpcode.Theoptionisturnedoffafterusage.

SeeAlso

DirectivesReference

Page 191: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

OPTIONWSTRING

OPTIONWSTRING:[ON|OFF]

Thistogglesascii/unicodestringcreationof"quotedstrings".

Unicodestringsmaybeusedinthe@CStr()macro,infunctioncalls,ordeclearedusing:

DW"string",0

ThedefaultvalueisOFF.Thecommand-lineswitch/wsturnsthisoptionON.

SeeAlso

DirectivesReference

Page 192: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 193: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcFatalErrorMessages

A1000cannotopenfile:filenameA1001I/Oerrorclosingfile:filenameA1002I/Oerrorwritingfile:filenameA1005assemblerlimit:macroparameternametablefullA1006invalidcommand-lineoption:optionA1007nestingleveltoodeepA1008unmatchedmacronestingA1009linetoolongA1010unmatchedblocknesting:A1011directivemustbeincontrolblockA1012errorcountexceeds100;stoppingassemblyA1017missingsourcefilenameA1901InternalAssemblerError

SeeAlso

AsmcErrorMessages

Page 194: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 195: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorMessages

MLcompatibleerrors

MLNonfatalErrorA2004MLNonfatalErrorA2005MLNonfatalErrorA2006MLNonfatalErrorA2007MLNonfatalErrorA2008MLNonfatalErrorA2009MLNonfatalErrorA2010MLNonfatalErrorA2011MLNonfatalErrorA2012MLNonfatalErrorA2013MLNonfatalErrorA2014MLNonfatalErrorA2015MLNonfatalErrorA2016MLNonfatalErrorA2018MLNonfatalErrorA2019MLNonfatalErrorA2022MLNonfatalErrorA2023MLNonfatalErrorA2024MLNonfatalErrorA2025MLNonfatalErrorA2026MLNonfatalErrorA2028MLNonfatalErrorA2029MLNonfatalErrorA2030MLNonfatalErrorA2031MLNonfatalErrorA2032MLNonfatalErrorA2033MLNonfatalErrorA2034MLNonfatalErrorA2036MLNonfatalErrorA2037MLNonfatalErrorA2039MLNonfatalErrorA2041MLNonfatalErrorA2043MLNonfatalErrorA2045

Page 196: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

MLNonfatalErrorA2046MLNonfatalErrorA2047MLNonfatalErrorA2048MLNonfatalErrorA2050MLNonfatalErrorA2051MLNonfatalErrorA2052MLNonfatalErrorA2053MLNonfatalErrorA2054MLNonfatalErrorA2055MLNonfatalErrorA2056MLNonfatalErrorA2057MLNonfatalErrorA2058MLNonfatalErrorA2059MLNonfatalErrorA2060MLNonfatalErrorA2061MLNonfatalErrorA2062MLNonfatalErrorA2063MLNonfatalErrorA2064MLNonfatalErrorA2065MLNonfatalErrorA2066MLNonfatalErrorA2068MLNonfatalErrorA2070MLNonfatalErrorA2071MLNonfatalErrorA2072MLNonfatalErrorA2074MLNonfatalErrorA2075MLNonfatalErrorA2076MLNonfatalErrorA2077MLNonfatalErrorA2079MLNonfatalErrorA2080MLNonfatalErrorA2081MLNonfatalErrorA2082MLNonfatalErrorA2083MLNonfatalErrorA2084MLNonfatalErrorA2085MLNonfatalErrorA2086MLNonfatalErrorA2087MLNonfatalErrorA2088MLNonfatalErrorA2089

Page 197: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

MLNonfatalErrorA2090MLNonfatalErrorA2091MLNonfatalErrorA2092MLNonfatalErrorA2093MLNonfatalErrorA2094MLNonfatalErrorA2095MLNonfatalErrorA2096MLNonfatalErrorA2097MLNonfatalErrorA2098MLNonfatalErrorA2100MLNonfatalErrorA2101MLNonfatalErrorA2103MLNonfatalErrorA2104MLNonfatalErrorA2105MLNonfatalErrorA2107MLNonfatalErrorA2108MLNonfatalErrorA2110MLNonfatalErrorA2111MLNonfatalErrorA2112MLNonfatalErrorA2113MLNonfatalErrorA2114MLNonfatalErrorA2119MLNonfatalErrorA2120MLNonfatalErrorA2121MLNonfatalErrorA2123MLNonfatalErrorA2125MLNonfatalErrorA2129MLNonfatalErrorA2131MLNonfatalErrorA2132MLNonfatalErrorA2133MLNonfatalErrorA2136MLNonfatalErrorA2141MLNonfatalErrorA2142MLNonfatalErrorA2143MLNonfatalErrorA2144MLNonfatalErrorA2145MLNonfatalErrorA2147MLNonfatalErrorA2148MLNonfatalErrorA2151

Page 198: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

MLNonfatalErrorA2154MLNonfatalErrorA2156MLNonfatalErrorA2157MLNonfatalErrorA2159MLNonfatalErrorA2166MLNonfatalErrorA2167MLNonfatalErrorA2169MLNonfatalErrorA2170MLNonfatalErrorA2172MLNonfatalErrorA2175MLNonfatalErrorA2178MLNonfatalErrorA2179MLNonfatalErrorA2181MLNonfatalErrorA2187MLNonfatalErrorA2189MLNonfatalErrorA2190MLNonfatalErrorA2199MLNonfatalErrorA2200MLNonfatalErrorA2202MLNonfatalErrorA2206MLNonfatalErrorA2214MLNonfatalErrorA2217

NonMLcompatibleerrors

ASMCNonfatalErrorA3000ASMCNonfatalErrorA3001ASMCNonfatalErrorA3002ASMCNonfatalErrorA3003ASMCNonfatalErrorA3004ASMCNonfatalErrorA3005ASMCNonfatalErrorA3006ASMCNonfatalErrorA3007ASMCNonfatalErrorA3008ASMCNonfatalErrorA3009ASMCNonfatalErrorA3010ASMCNonfatalErrorA3011ASMCNonfatalErrorA3012ASMCNonfatalErrorA3013

Page 199: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3014ASMCNonfatalErrorA3015ASMCNonfatalErrorA3016ASMCNonfatalErrorA3017ASMCNonfatalErrorA3018ASMCNonfatalErrorA3019ASMCNonfatalErrorA3020ASMCNonfatalErrorA3021ASMCNonfatalErrorA3022

SeeAlso

AsmcErrorMessages

Page 200: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 201: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningMessages

MLcompatiblewarnings

MLWarningA4003MLWarningA4005MLWarningA4006MLWarningA4007MLWarningA4008MLWarningA4011MLWarningA4012MLWarningA4910

MLcompatiblelevel3warnings

MLWarningA6003MLWarningA6004MLWarningA6005

NonMLcompatiblewarnings

ASMCWarningA8000ASMCWarningA8001ASMCWarningA8002ASMCWarningA8003ASMCWarningA8004ASMCWarningA8005ASMCWarningA8006ASMCWarningA8007ASMCWarningA8008ASMCWarningA8009ASMCWarningA8010ASMCWarningA8011ASMCWarningA8012ASMCWarningA8013ASMCWarningA8014ASMCWarningA8015ASMCWarningA8017

Page 202: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA8018ASMCWarningA8019ASMCWarningA8020

NonMLcompatiblelevel3warnings

ASMCWarningA7000ASMCWarningA7001ASMCWarningA7002ASMCWarningA7003ASMCWarningA7004ASMCWarningA7005ASMCWarningA7006ASMCWarningA7007ASMCWarningA7008

SeeAlso

AsmcErrorMessages

Page 203: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 204: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Parsingoflabels

Allexpansionsarepre-processedbytheassemblerandthismayexpandmacrosandotherdirectivesbeforelabels.Ifamacroisaddedatthesamelineasalabelthismayfail.

Example

foo macro reg

bswap reg

exitm <reg>

endm

do: mov eax,foo(eax)

...

mov ecx,"3210"

jmp do

Asaresultthecodeproducedbythemacrowillbeexpandedabovethelabelandthusthejumpwillfail.

bswap ecx

do: mov eax,ecx

...

Asmcwillexpandthelinelefttorightinthiscase.

SeeAlso

AsmcExtensions

Page 205: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 206: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Expansionofmacros

ThelabelissuebecomesaproblemintheHLLsectionwherelabelsarecreatedlater:

.WHILE macro(...)

AsmcwillforthisreasondelayexpansionofmacrosinsomeoftheHLLdirectivesuntillabelsarecreated.Thisinclude.WHILE,.ELSEIF,and.CASE.

SeeAlso

AsmcExtensions

Page 207: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 208: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Theinvokedirective

InAsmcamacroishandledatthesamelevelasaprocedure.Theheaderfilemaythencontroltheexpansion:

ifdef__INLINE__

strlen macrostring

...

endm

else

strlen proto:dword

endif

Thisisachievedbysimplyexcludinginvokeasapposetoallowinvocationsofmacros.

strlen(esi)

Asmcseesthecombinationofaprocedurefollowedbyanopenbracketasinvoke.Emptybracketswillbegivenspecialhandlingifthetokeninfrontisnotamacro.

plabel proto

extern elabel:dword

.data

dlabel labeldword

.code

clabel:

call ax

call eax

call plabel

call elabel

call dlabel

call clabel

call xlabel

ax()

eax()

plabel()

elabel()

dlabel()

clabel()

xlabel()

Page 209: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

xlabel:

Thissimplesolutionavoidsbreakinganyexistingcodewithafewexceptions:Masmallowsbracketstoaccessmemory.

.ifedx<foo(1)

;MASM:cmpedx,foo+1

;ASMC:invokefoo,1:cmpedx,eax

Sosquarebracketsshouldbeusedforaccessingmemoryandroundbracketstoexecute.However,anerrormustthenbeissuedifAsmcextensionsareturnedoffandlabelsareaccessedusingroundbracketstoensurecompatibility.

TheinsideofbracketsmayberecursiveusedatanylengthincludingC-strings.However,thereturncodeforaprocedureis[R|E]AXsothereisalimitwithregardstoOR/ANDtestingofnestedfunctions.

.iffoo(bar(1),2)==TRUE

SeeAlso

AsmcExtensions

Page 210: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

TheHLLsection

Asmcextensionsareallowedinthefollowingconditionalcontrolflowdirectives:

.IFexpression

.ELSEIFexpression

.UNTILexpression

.WHILEexpression

.BREAK.IFexpression

.CONTINUE.IFexpression

.SWITCHproc(...)

.CASEexpression

.ENDC.IFexpression

.ASSERTexpression

SeeAlso

AsmcExtensions

Page 211: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 212: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Handlingofstrings

Given"quotedstrings"maybeusedasarguments,oringeneralasaconstvalue,C-stringsarelimitedtobeusedinsidebracketsofaprocedure.

.iffopen("readme.txt","rt")

SeeAlso

AsmcExtensions|SymbolsReference

Page 213: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 214: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Enhancedvectorextension

Fromversion2.26AsmcsupporttheIntelAVX-512instructionset.

Thisincludes12new128-bitregisters(XMM16toXMM31),12new256-bitregisters(YMM16toYMM31),32new512-bitregisters(ZMM0toZMM31),and8newopmaskregisters(K0toK7).

TheEVEXencodingprefixwillbeomittedbyusinganEVEXexclusiveinstructionoranyoftheextendedSIMDregisters.Aprecedingprefix({evex})maybeusedforEVEXencodingofotherinstructions.

vcomisdxmm0,xmm1;normal

vcomisdxmm0,xmm16;prefix(auto)

{evex}vcomisdxmm0,xmm1;prefix

SeeAlso

AsmcExtensions|InstructionSets

Page 215: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

OPTIONASMC

OPTIONASMC:[ON|OFF|0..255]

ThiscontrolsthemainextensionofAsmc.ThedefaultvalueisON.Thecommand-lineswitch/XcturnsthisoptionOFF.

SeeAlso

DirectivesReference

Page 216: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

OPTIONLOOPALIGN

OPTIONLOOPALIGN:[0|2|4|8|16]

Thiscontrolsthealignmentfor.WHILEand.REPEATlabels.Thedefaultvalueis0.

jmploop_start

* ALIGN<loopalign>;alignlabelafterjump

loop_label:

SeeAlso

DirectivesReference

Page 217: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

OPTIONCASEALIGN

OPTIONCASEALIGN:[0|2|4|8|16]

Thiscontrolsthealignmentfor.CASElabels.Thedefaultvalueis0.

* ALIGN<casealign>;alignlabelafterjump

case:

SeeAlso

DirectivesReference

Page 218: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 219: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

.IF

.IFcondition1

statements

[[.ELSEIFcondition2

statements]]

[[.ELSE

statements]]

.ENDIF

Generatescodethattestscondition1(forexample,AX>7)andexecutesthestatementsifthatconditionistrue.Ifa.ELSEfollows,itsstatementsareexecutediftheoriginalconditionwasfalse.Notethattheconditionsareevaluatedatruntime.

SeeAlso

DirectivesReference|Flagconditions|Signedcompare|Returncode

Page 220: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 221: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

.WHILE

.WHILEcondition

statements

.ENDW

Generatescodethatexecutestheblockofstatementswhileconditionremainstrue.

SeeAlso

DirectivesReference|Flagconditions|Signedcompare|Returncode

Page 222: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

.REPEAT

.REPEAT

statements

.UNTILcondition

Generatescodethatrepeatsexecutionoftheblockofstatementsuntilconditionbecomestrue..UNTILCXZ,whichbecomestruewhenCXiszero,maybesubstitutedfor.UNTIL.Theconditionisoptionalwith.UNTILCXZ.

SeeAlso

DirectivesReference|Signedcompare|Returncode

Page 223: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

.UNTILCXZ

See.REPEAT

SeeAlso

DirectivesReference,.UNTILAXZ,.UNTILBXZ,.UNTILDXZ

Page 224: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 225: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

.BREAK

.BREAK(n)[[.IFcondition]]

Generatescodetoterminatea.WHILEor.REPEATblockifconditionistrue.

BREAK[(n)]isoptionalnestingleveltoterminate.

.while1

.break;break.while1

.while2

.break(1);break.while1

.while3

.break(2);break.while1

.while4

.break(3);break.while1

.break(2);break.while2

.break(1);break.while3

.endw

.endw

.endw

.endw

SeeAlso

DirectivesReference|.CONTINUE

Page 226: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 227: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

.CONTINUE

.CONTINUE[([0]1..n)][[.IFcondition]]

Generatescodetojumptothetopofa.WHILEor.REPEATblockifconditionistrue.

.CONTINUE[(1..n)]isoptionalnestingleveltocontinue.

.while1

.continue;continue.while1

.while2

.continue(1);continue.while1

.while3

.continue(2);continue.while1

.while4

.continue(3);continue.while1

.continue(2);continue.while2

.continue(1);continue.while3

.endw

.endw

.endw

.endw

.CONTINUE[(0[1..n])]jump'sdirectlytoSTARTlabel:noTEST.

.while1

.continue(0);JumptoSTARTlabel

.continue;JumptoSTARTlabel

.endw

.whileeax

.continue(0);JumptoSTARTlabel

.continue;JumptoTESTlabel

.endw

.repeat

.continue(0);JumptoSTARTlabel

.continue;JumptoEXITlabel

.break;JumptoEXITlabel

.until1

SeeAlso

Page 228: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

DirectivesReference|.BREAK

Page 229: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 230: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

.FOR

.FOR[S][initialization]:[condition]:[increment/decrement]

statements

.ENDF

Generatescodethatexecutestheblockofstatementswhileconditionremainstrue.

SeeAlso

DirectivesReference|Flagconditions|Signedcompare|.ENDF

Page 231: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 232: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

.SWITCH

Theswitchcomesinthreemainvariants:astructuredswitch,asinPascal,whichtakesexactlyonebranch,anunstructuredswitch,asinC,whichfunctionsasatypeofgoto,andacontroltableswitchwiththeaddedpossibilityoftestingforcombinationsofinputvalues,usingbooleanstyleAND/ORconditions,andpotentiallycallingsubroutinesinsteadofjustasinglesetofvalues.

Thecontroltableswitchisdeclaredwithnoargumentsandeach.CASEdirectivedoesallthetesting.

.switch

.casestrchr(esi,'<')

.casestrchr(esi,'>')

jmparound

...

.endsw

TheunstructuredswitchworksasaregularCswitchwhereeach.CASEdirectiveisjustalabel.

.switcheax

.case0:.repeat:movsb

.case7:movsb

.case6:movsb

.case5:movsb

.case4:movsb

.case3:movsb

.case2:movsb

.case1:movsb:.untilcxz

.endsw

ThestructuredswitchworksasaregularPascalswitchwhereeach.CASEdirectiveisaclosedbranch.

.switcheax

.case1:printf("Goldmedal")

.case2:printf("Silvermedal")

.case3:printf("Bronzemedal")

.default

printf("Betterlucknexttime")

.endsw

Page 233: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

SeeAlso

DirectivesReference

Page 234: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 235: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

.CASE

Caseopensacasestatement.Thecasestatementcomparesthevalueofanordinalexpressiontoeachselector,whichcanbeaconstant,asubrange,oralistofthemseparatedbycommas.

TheselectorfieldisseparatedfromactionfieldbyColonoranewline.

.CASE1:movax,2:.ENDC

.CASE2

movax,3

.ENDC

.CASEal

.CASE0,1,4,7

.CASE0..9

Inthecontroltableswitch.CASEisequalto.IF:

.CASEal

.CASEax<=2&&!bx

SeeAlso

.SWITCH|.ENDC|.DEFAULT|.ENDSW

Page 236: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 237: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

.ENDC

.ENDCclosesa.CASEstatement.

ThenamewasseparatedfromBREAKtohavemoreflexibilitywithregardstocontrolflowofloops.However,ENDChavethesamequalitiesasBREAKandthuscanbeusedincombinationwith.IF:

.ENDC.IFal==2

SeeAlso

.SWITCH|.CASE|.DEFAULT|.GOTOSW|.ENDSW

Page 238: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 239: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

.GOTOSW

.GOTOSW[1|2|3][[(<case_val>)]|[.IFcondition]]

Generatescodetojumptothetopofa.SWITCHblockifconditionistrue.

.GOTOSWjump'sdirectlytotheTESTlabel.

.switchal

.case1

...

.case9

moval,1

.gotosw ;"Jump"tocase1

GOTOSW[1|2|3]isoptionalnestingleveltocontinue.

.switchal

.case1

.gotosw ;continue.switchal

.switchbl

.case1

.gotosw1 ;continue.switchal

.switchcl

.case1

.gotosw2 ;continue.switchal

.switchdl

.case1

.gotosw3;continue.switchal

.gotosw2;continue.switchbl

.gotosw1;continue.switchcl

;

;Directjumpto.switchcl/case1

;

.gotosw1(1)

.endsw

.endsw

.endsw

.endsw

GOTOSWcanbeusedincombinationwith.IFcondition,oradirectjumpto.GOTOSW(<case_val>).

Page 240: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

SeeAlso

DirectivesReference|.ENDC|.SWITCH

Page 241: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 242: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

.DEFAULT

.DEFAULTexecuteswhennoneoftheothercasesmatchthecontrolexpression.

SeeAlso

.SWITCH|.CASE|.ENDC|.ENDSW

Page 243: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 244: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

.ENDSW

.ENDSWclosesa.SWITCHstatement.

SeeAlso

.SWITCH|.CASE|.ENDC|.DEFAULT

Page 245: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 246: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

.COMDEF

.COMDEFname

DeclaresastructuretypeforaCOMinterfacebasedontheComponentObjectModelintroducedbyMicrosoftin1993.

AtypicalCdeclarationforaCOMinterface:

typedefstructIShellFolderVtbl{

BEGIN_INTERFACE

HRESULT(STDMETHODCALLTYPE*QueryInterface)(

IShellFolder*_This,REFIIDriid,void**ppvObject);

...

END_INTERFACE

}IShellFolderVtbl;

interfaceIShellFolder{

CONST_VTBLstructIShellFolderVtbl*lpVtbl;

};

Sameusing.COMDEF:

.comdefIShellFolder

QueryInterfaceproc:REFIID,:ptr

...

.ends

TheobjectsarenormallyinstantiatedwithaCreateInstance()functionthattakestheclassasargumentandweendupwithapointerorjustAX.Thecalltothemethodisthensomethinglikethis:

movrcx,rax;loadargs

movrdx,riid

movr8,ppvObject

movrax,[rcx];makethecall

call[rax].IShellFolderVtbl.QueryInterface

Theassemblerneedstoknowthenameofthebaseclassinordertousethesemethods.Ifthemethodnameisnotfoundinthebaseclass,'Vtbl'isaddedtotheclassname.IfmethodexistinclassVtblthepointerisassumedtobethefirstmemberofthebase(lpVtbl).

Page 247: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

locals:IShellFolder

s.QueryInterface(riid,ppvObject)

*learcx,s

localp:ptrIShellFolder

p.QueryInterface(riid,ppvObject)

*movrcx,p

assumerbx:ptrIShellFolder

[rbx].QueryInterface(riid,ppvObject)

*movrcx,rbx

IfPROCisusedinsideastructure(normallyanerror)Asmcassumesthistobeapointertoafunction.

*T$0001typedefprotoWINAPI:REFIID,:ptr

*P$0001typedefptrT$0001

*QueryInterfaceP$0001?

Thefirstmethodclosethebaseclassandopen(inthiscase)theIShellFolderVtblstructureand.ENDSwillthenclosethecurrentstruct.

.ends

*IShellFolderVtblends

SeeAlso

.ENDS|.CLASSDEF

Page 248: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 249: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

.CLASSDEF

.CLASSDEFname[args]

DeclaresastructuretypeforaCOMinterface.

.CLASSDEFaddsthefollowingtypes:

.classdefClass

*LPCLASStypedefptrClass

*LPCLASSVtbltypedefptrClassVtbl

*Class@Classproto:ptrClass

*Classstruct8

*lpVtblLPCLASSVtbl?

Release()isaddedasthefirstmethod:

Method1proclocal;static

Method2proc:ptr;firstvirtualfunction

*Classends

*ClassVtblstruct

*T$000Btypedefproto:ptrClass

*P$000BtypedefptrT$000B

*ReleaseP$000B?

*T$000Btypedefproto:ptrClass

*P$000BtypedefptrT$000B

*Method2P$000B?

TodefineamethodlocallyinthebaseclassthekeywordLOCALmaybeused.Locallydefinedfunctionsarecalleddirectlywithoutthe_thisargumentomitted.

assumercx:LPCLASS

fooproc

localp:LPCLASS

[rcx].Method1()

[rcx].Method2(rdx)

[rcx].Release()

ret

Page 250: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

fooendp

Codeproduced:

0:55pushrbp

1:488becmovrbp,rsp

4:4883ec30subrsp,0x30

8:ff5110callQWORDPTR[rcx+0x10]

b:488b01movrax,QWORDPTR[rcx]

e:ff5008callQWORDPTR[rax+0x8]

11:488b01movrax,QWORDPTR[rcx]

14:ff10callQWORDPTR[rax]

16:c9leave

17:c3ret

SeeAlso

.ENDS|.COMDEF

Page 251: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 252: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

.ENDS

.ENDSclosesa.COMDEFor.CLASSDEFstatement.

SeeAlso

.COMDEF|.CLASSDEF

Page 253: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 254: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

.ASSERT

.ASSERT[D|W|B]<assert_expression>

.ASSERT:[<handler>|ON|OFF|PUSH|POP|PUSHF|POPF|CODE|ENDS]

Options

ON/OFF Mainswitch.

PUSH/POP SaveandrestoretheASMCflag.Stacklevelis128.

PUSHF/POPF TogglesusingPUSHF[D|Q]beforecallinghandler.

CODE/ENDS AssemblecodesectionifASSERTisON.

HandlerTheassertmacrocallsthisroutineifexpressionisnottrue.Thedefaulthandlernameisassert_exit.

SeeAlso

DirectivesReference|.IF|Returncode

Page 255: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 256: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Flagconditions

Theoptionslistedmaybeusedasdirective.IFxx,.WHILExx,and.UNTILxx.

xxA NBE Above|NotBeloworEqualB C/NAE Below|Carry|NotAboveorEqualG NLE Greater|NotLessorEqual(signed)L NGE Less|NotGreaterorEqual(signed)O Overflow(signed)P PE Parity|ParityEvenS Signed(signed)Z E Zero|EqualNA BE NotAbove|NotBeloworEqualNB NC/AE NotBelow|NotCarry|AboveorEqualNG LE NotGreater|LessorEqual(signed)NL GE NotLess|GreaterorEqual(signed)NO NotOverflow(signed)NP PO NoParity|ParityOddNS NotSigned(signed)NZ NE NotZero|NotEqual

Notethatifusedwithconditionthedirectivemayhaveadifferentmeaning.

SeeAlso

DirectivesReference|Signedcompare|Returncode

Page 257: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 258: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Signedcompare

Flipstheexpressiontosignedifthefirstoperandisaregister.

.IFSx,.WHILESx,and.UNTILSx<expression>.

xx

S SignedREGSB SignedALSW SignedAXSD SignedEAX

SeeAlso

DirectivesReference|Flagconditions|Returncode

Page 259: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 260: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

Returncode

Setssizefromafunctioncalltoxx.

.IFxx,.WHILExx,.UNTILxx,and.ASSERTx<expression>.

xx

B BYTEW WORDD DWORDSB SBYTESW SWORDSD SDWORD

SeeAlso

DirectivesReference|Flagconditions|Signedcompare

Page 261: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 262: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

@Date

@Date

Thesystemdateintheformatyyyy-mm-dd(textmacro).

SeeAlso

SymbolsReference

Page 263: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 264: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

@CStr

@CStr(string)

Macrofunctionthatcreatesastringinthe.DATAsegment.ThemacroacceptsC-escapecharactersinthestring.Stringsareaddedtoastackandreusedifduplicatedstringsarefound.Themacroreturnsoffsetstring.

Example

mov eax,@CStr("\tCreatea\"C\"string:%s%d\n")

mov ebx,@CStr("string:%s%d\n")

mov ecx,@CStr("%s%d\n")

mov edx,@CStr("%d\n")

mov edi,@CStr("\n")

Generatedcode

.data

DS0000db9,"Createa",'"',"C",'"',"string:%s%d",10,0

.code

mov eax,offsetDS0000

mov ebx,offsetDS0000[14]

mov ecx,offsetDS0000[22]

mov edx,offsetDS0000[24]

mov edi,offsetDS0000[26]

SeeAlso

SymbolsReference

Page 265: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

6.2.1Win64StructuredExceptionHandling(SEH)SEHinWin64differssignificantlyfromtheimplementationinWin32.It'sverywellpossibletoignoreWin64SEHforassembly.However,ifanassemblyroutinewantstocomplytotheserules,athoroughunderstandingoftheWin64ABIisnecessary.Masm(the64-bitversion)suppliessome"primitives"forSEHsupport(.ALLOCSTACK,.PUSHREG,.SAVEREG,...),alongwithanewFRAMEattributeforthePROCdirective.ThesefeaturesarealsosupportedbyJWasm.SeesampleWin64_3howthe"primitives"aretobeusedforSEHsupport.

ThebigdisadvantageisthatusingtheFRAMEkeywordinMasm"disables"mostoftheotherhighlevelfeaturescombinedwithPROC(functionparameters,localsandregisterssavedwithUSES)becausenofunctionprologuesandepiloguesaregeneratedanymore.Additionally,theimplementationinsomeMasmversionsseemstobeabitbuggy.BecauseofthisandtoeasetheusageofSEHinWin64thereisanewdirectiveimplementedinJWasm:

OPTIONFRAME:AUTO

Ifthisoptionisset,JWasmwillcreateWin64SEH-compatibleprologuesandepilogues.Iftheoptionisoff,JWasmwillbehaveMasm-compatible,thatis,FRAMEfoundinaPROCdirectivewilldisableautomaticprologue/epiloguegeneration.SeesampleWin64_3ehowthisoptionissupposedtobeused.

AsforthePROCsyntax:TheMasmdocumentationstatesthatFRAMEcanbeusedincombinationwithUSESandprocedureparametersandmustbelocatedbehindallparameters.However,thissyntaxisn'tacceptedbyanyMasmversion.TheonlysyntaxwhichMasmwillacceptwithoutbeingconfusedisFRAMEastheoneandonlyparameterforPROC.ThereforeJWasmdoesn'tfollowtheMasmdocumentationinthispoint:theoptionalFRAMEkeywordisexpected*before*theprocedureparameters.ThesyntaxinJWasmis:

Page 266: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

procnamePROC[public]FRAME[:exc_handler][USES<reglist>][parameters]

TheSEH"primitives"willgeneratesomeadditionaldatainsegments.pdataand.xdata.Thisdataissomewhathidden,butJWasmwilldisplaythecorrespondingdatadefinitionsinthelistingifoption-Sgisset.

Page 267: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 268: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCFatalErrorA1000

cannotopenfile:filename

Thefiledoesnotexist.Thefileisinusebyanotherprocess.Thefilenameisnotvalid.Aread-onlyfilewiththeoutputfilenamealreadyexists.Thecurrentdriveisfull.Thecurrentdirectoryistherootandisfull.Thedevicecannotbewrittento.Thedriveisnotready.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 269: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 270: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCFatalErrorA1001

I/Oerrorclosingfile

Theoperatingsystemreturnedanerrorwhentheassemblerattemptedtocloseafile.Thiserrorcanbecausedbyhavingacorruptfilesystemorbyremovingadiskbeforethefilecouldbeclosed.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 271: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 272: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCFatalErrorA1002

I/Oerrorwritingfile

Theassemblerwasunabletowritetoanoutputfile.Oneofthefollowingmaybeacause:

Thecurrentdriveisfull.Thecurrentdirectoryistherootandisfull.Thedevicecannotbewrittento.Thedriveisnotready.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 273: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 274: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCFatalErrorA1005

Assemblerlimit:macroparameternametablefull

Toomanyparameters,locals,ormacrolabelsweredefinedforamacro.Therewasnomoreroominthemacronametable.

Defineshorterorfewernames,orremoveunnecessarymacros.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 275: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 276: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCFatalErrorA1006

Invalidcommand-lineoption:option

ASMCdidnotrecognizethegivenparameterasanoption.Thiserrorisgenerallycausedwhenthereisasyntaxerroronthecommandline.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 277: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 278: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCFatalErrorA1007

Nestingleveltoodeep

Theassemblerreacheditsnestinglimit.Thelimitis20levelsexceptwherenotedotherwise.

Oneofthefollowingwasnestedtoodeeply:

Ahigh-leveldirectivesuchas.IF,.REPEAT,or.WHILEAstructuredefinitionAconditional-assemblydirectiveAproceduredefinitionAPUSHCONTEXTdirective(thelimitis10).AsegmentdefinitionAnincludefileAmacro

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 279: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 280: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCFatalErrorA1008

Unmatchedmacronesting

Eitheramacrowasnotterminatedbeforetheendofthefile,ortheterminatingdirectiveENDMwasfoundoutsideofamacroblock.Onecauseofthiserrorisomissionofthedotbefore.REPEATor.WHILE.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 281: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 282: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCFatalErrorA1009

Linetoolong

Alineinasourcefileexceededthelimitof1024characters.

Ifmultiplephysicallinesareconcatenatedwiththeline-continuationcharacter(\),theresultinglogicallineisstilllimitedto1024characters.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 283: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 284: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCFatalErrorA1010

Unmatchedblocknesting:

Ablockbeginningdidnothaveamatchingend,orablockenddidnothaveamatchingbeginning.Oneofthefollowingmaybeinvolved:

Ahigh-leveldirectivesuchas.IF,.REPEAT,or.WHILEAconditional-assemblydirectivesuchasIF,REPEAT,orWHILEAstructureoruniondefinitionAproceduredefinitionAsegmentdefinitionAPOPCONTEXTdirectiveAconditional-assemblydirective,suchasanELSE,ELSEIF,orENDIFwithoutamatchingIF

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 285: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 286: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCFatalErrorA1011

Directivemustbeincontrolblock

Theassemblerfoundahigh-leveldirectivewhereonewasnotexpected.Oneofthefollowingdirectiveswasfound:

.ELSEwithout.IF

.ENDIFwithout.IF

.ENDWwithout.WHILE

.UNTIL[[CXZ]]without.REPEAT

.CONTINUEwithout.WHILEor.REPEAT

.BREAKwithout.WHILEor.REPEAT

.ELSEfollowing.ELSE

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 287: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 288: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCFatalErrorA1012

Errorcountexceeds100;stoppingassembly

Thenumberofnonfatalerrorsexceededtheassemblerlimitof100.NonfatalerrorsareintherangeA2xxx.Whenwarningsaretreatedaserrorstheyareincludedinthecount.Warningsareconsiderederrorsifyouusethe/Wxcommand-lineoption,orifyousettheWarningsTreatedasErrorsoptionintheMacroAssemblerGlobalOptionsdialogboxofPWB.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 289: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 290: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCFatalErrorA1017

Missingsourcefilename

MLcouldnotfindafiletoassembleorpasstothelinker.

ThiserrorisgeneratedwhenyougiveASMCcommand-lineoptionswithoutspecifyingafilenametoactupon.Toassemblefilesthatdonothavea.ASMextension,usethe/Tacommand-lineoption.

ThiserrorcanalsobegeneratedbyinvokingASMCwithnoparametersiftheASMCenvironmentvariablecontainscommand-lineoptions.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 291: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 292: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCFatalErrorA1901

InternalAssemblerError

ContactProductSupportServices

TheASMCdriver,calledASMC.exe,generatedasystemerror.NotethecircumstancesoftheerrorandfileabugreportatASMCDevelopment

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 293: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 294: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2004

Symboltypeconflict:identifier

TheEXTERNDEForLABELdirectivewasusedonavariable,symbol,datastructure,orlabelthatwasdefinedinthesamemodulebutwithadifferenttype.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 295: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 296: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2005

Symbolredefinition:identifier

Thegivennonredefinablesymbolwasdefinedintwoplaces.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 297: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 298: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2006

Undefinedsymbol:identifier

Anattemptwasmadetouseasymbolthatwasnotdefined.Oneofthefollowingmayhaveoccurred:

Asymbolwasnotdefined.Afieldwasnotamemberofthespecifiedstructure.Asymbolwasdefinedinanincludefilethatwasnotincluded.AnexternalsymbolwasusedwithoutanEXTERNorEXTERNDEFdirective.Asymbolnamewasmisspelled.Alocalcodelabelwasreferencedoutsideofitsscope.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 299: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 300: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2007

Non-benignrecordredefinition

ARECORDdefinitionconflictedwithapreviousdefinition.Oneofthefollowingoccurred:

Thereweredifferentnumbersoffields.Thereweredifferentnumbersofbitsinafield.Therewasadifferentlabel.Thereweredifferentinitializers.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 301: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 302: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2008

syntaxerror:

Atokenatthecurrentlocationcausedasyntaxerror.Oneofthefollowingmayhaveoccurred:

Adotprefixwasaddedtooromittedfromadirective.Areservedword(suchasCorSIZE)wasusedasanidentifier.Aninstructionwasusedthatwasnotavailablewiththecurrentprocessororcoprocessorselection.Acomparisonrun-timeoperator(suchas==)wasusedinaconditionalassemblystatementinsteadofarelationaloperator(suchasEQ).Aninstructionordirectivewasgiventoofewoperands.Anobsoletedirectivewasused.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 303: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 304: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2009

syntaxerrorinexpression

Anexpressiononthecurrentlinecontainedasyntaxerror.Thiserrormessagemayalsobeaside-effectofaprecedingprogramerror.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 305: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 306: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2010

invalidtypeexpression

TheoperandtoTHISorPTRwasnotavalidtypeexpression.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 307: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 308: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2011

distanceinvalidforwordsizeofcurrentsegment

AproceduredefinitionoracodelabeldefinedwithLABELspecifiedanaddresssizethatwasincompatiblewiththecurrentsegmentsize.Oneofthefollowingoccurred:

ANEAR16orFAR16procedurewasdefinedina32-bitsegment.ANEAR32orFAR32procedurewasdefinedina16-bitsegment.AcodelabeldefinedwithLABELspecifiedFAR16orNEAR16ina32-bitsegment.AcodelabeldefinedwithLABELspecifiedFAR32orNEAR32ina16-bitsegment.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 309: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 310: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2012

PROC,MACRO,ormacrorepeatdirectivemustprecedeLOCAL

ALOCALdirectivemustbeimmediatelyprecededbyaMACRO,PROC,macrorepeatdirective(suchasREPEAT,WHILE,orFOR),oranotherLOCALdirective.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 311: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 312: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2013

.MODELmustprecedethisdirective

Asimplifiedsegmentdirectiveora.STARTUPor.EXITdirectivewasnotprecededbya.MODELdirective.A.MODELdirectivemustspecifythemodeldefaultsbeforeasimplifiedsegmentdirective,ora.STARTUPor.EXITdirectivemaybeused.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 313: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 314: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2014

cannotdefineaspublicorexternal:identifier

Onlylabels,procedures,andnumericequatescanbemadepublicorexternalusingPUBLIC,EXTERN,orEXTERNDEF.Localcodelabelscannotbemadepublic.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 315: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 316: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2015

segmentattributescannotchange:attribute

Asegmentwasreopenedwithdifferentattributesthanitwasopenedwithoriginally.

WhenaSEGMENTdirectiveopensapreviouslydefinedsegment,thenewlyopenedsegmentinheritstheattributesthesegmentwasdefinedwith.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 317: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 318: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2016

expressionexpected

Theassemblerexpectedanexpressionatthecurrentlocationbutfoundoneofthefollowing:

AunaryoperatorwithoutanoperandAbinaryoperatorwithouttwooperandsAnemptypairofparentheses,(),orbrackets,[]

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 319: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 320: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2018

invaliduseofexternalsymbol:identifier

Anattemptwasmadetocomparethegivenexternalsymbolusingarelationaloperator.

Thecomparisoncannotbemadebecausethevalueoraddressofanexternalsymbolisnotknownatassemblytime.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 321: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 322: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2019

operandmustbeRECORDtypeorfield

TheoperandfollowingtheWIDTHorMASKoperatorwasnotvalid.TheWIDTHoperatortakesanoperandthatisthenameofafieldorarecord.TheMASKoperatortakesanoperandthatisthenameofafieldorarecordtype.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 323: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 324: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2022

instructionoperandsmustbethesamesize

Theoperandstoaninstructiondidnothavethesamesize.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 325: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 326: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2023

instructionoperandmusthavesize

Atleastoneoftheoperandstoaninstructionmusthaveaknownsize.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 327: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 328: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2024

invalidoperandsizeforinstruction

Thesizeofanoperandwasnotvalid.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 329: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 330: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2025

operandsmustbeinsamesegment

Relocatableoperandsusedwitharelationalorminusoperatorwerenotlocatedinthesamesegment.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 331: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 332: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2026

constantexpected

Theassemblerexpectedaconstantexpressionatthecurrentlocation.Aconstantexpressionisanumericexpressionthatcanberesolvedatassemblytime.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 333: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 334: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2028

expressionmustbeacodeaddress

Anexpressionevaluatingtoacodeaddresswasexpected.Oneofthefollowingoccurred:

SHORTwasnotfollowedbyacodeaddress.NEARPTRorFARPTRwasappliedtosomethingthatwasnotacodeaddress.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 335: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 336: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2029

multiplebaseregistersnotallowed

Anattemptwasmadetocombinetwobaseregistersinamemoryexpression.

Forexample,thefollowingexpressionscausethiserror:

[bx+bp]

[bx][bp]

Inanotherexample,giventhefollowingdefinition:

id1procarg1:byte

eitherofthefollowinglinescausesthiserror:

moval,[bx].arg1

leaax,arg1[bx]

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 337: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 338: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2030

multipleindexregistersnotallowed

Anattemptwasmadetocombinetwoindexregistersinamemoryexpression.

Forexample,thefollowingexpressionscausethiserror:

[si+di]

[di][si]

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 339: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 340: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2031

mustbeindexorbaseregister

Anattemptwasmadetousearegisterthatwasnotabaseorindexregisterinamemoryexpression.

Forexample,thefollowingexpressionscausethiserror:

[ax]

[bl]

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 341: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 342: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2032

invaliduseofregister

Anattemptwasmadetousearegisterthatwasnotvalidfortheintendeduse.Oneofthefollowingoccurred:

OFFSETwasappliedtoaregister.(OFFSETcanbeappliedtoaregisterundertheM510option.)Aspecial386registerwasusedinaninvalidcontext.AregisterwascastwithPTRtoatypeofinvalidsize.Aregisterwasspecifiedastherightoperandofasegmentoverrideoperator(:).Aregisterwasspecifiedastherightoperandofabinaryminusoperator(–).Anattemptwasmadetomultiplyregistersusingthe*operator.Brackets([])weremissingaroundaregisterthatwasaddedtosomething.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 343: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 344: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2033

invalidINVOKEargument:argumentnumber

TheINVOKEdirectivewaspassedaspecial386register,oraregisterpaircontainingabyteregisterorspecial386register.TheseregistersareillegalwithINVOKE.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 345: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 346: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2034

mustbeinsegmentblock

Oneofthefollowingwasfoundoutsideofasegmentblock:

AninstructionAlabeldefinitionATHISoperatorA$operatorAproceduredefinitionAnALIGNdirectiveAnORGdirective

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 347: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 348: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2036

toomanyinitialvaluesforstructure:structure

Thegivenstructurewasdefinedwithmoreinitializersthanthenumberoffieldsinthetypedeclarationofthestructure.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 349: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 350: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2037

statementnotallowedinsidestructuredefinition

Astructuredefinitioncontainedaninvalidstatement.Astructurecannotcontaininstructions,labels,procedures,control-flowdirectives,.STARTUP,or.EXIT.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 351: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 352: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2039

linetoolong

Asource-filelineexceededthelimitof1024characters.

Ifmultiplephysicallinesareconcatenatedwiththeline-continuationcharacter(\),theresultinglogicallineisstilllimitedto1024characters.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 353: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 354: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2041

stringortextliteraltoolong

Astringortextliteral,oramacrofunctionreturnvalue,exceededthelimitof255characters.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 355: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 356: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2043

identifiertoolong

Anidentifierexceededthelimitof247characters.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 357: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 358: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2045

missinganglebracketorbraceinliteral

Anunmatchedanglebracket(either<or>)orbrace(either{or})wasfoundinaliteralconstantoraninitializer.Oneofthefollowingoccurred:

Apairofanglebracketsorbraceswasnotcomplete.Ananglebracketwasintendedtobeliteral,butitwasnotprecededbyanexclamationpoint(!)toindicatealiteralcharacter.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 359: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 360: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2046

missingsingleordoublequotationmarkinstring

Anunmatchedquotationmark(either'or")wasfoundinastring.Oneofthefollowingmayhaveoccurred:

Apairofquotationmarksaroundastringwasnotcomplete.Apairofquotationmarksaroundastringwasformedofonesingleandonedoublequotationmark.Asingleordoublequotationmarkwasintendedtobeliteral,butthesurroundingquotationmarkswerethesamekindastheliteralone.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 361: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 362: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2047

empty(null)string

Astringconsistedofadelimitingpairofquotationmarksandnocharacterswithin.

Forastringtobevalid,itmustcontain1-255characters.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 363: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 364: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2048

nondigitinnumber

Anumbercontainedacharacterthatwasnotinthesetofcharactersusedbythecurrentradix(base).

ThiserrorcanoccurifaBorDradixspecifierisusedwhenthedefaultradixisonethatincludesthatletterasavaliddigit.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 365: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 366: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2050

realorBCDnumbernotallowed

Afloating-point(real)numberorbinarycodeddecimal(BCD)constantwasusedotherthanasadatainitializer.

Oneofthefollowingoccurred:

ArealnumberoraBCDwasusedinanexpression.ArealnumberwasusedtoinitializeadirectiveotherthanDWORD,QWORD,orTBYTE.ABCDwasusedtoinitializeadirectiveotherthanTBYTE.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 367: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 368: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2051

textitemrequired

Aliteralconstantortextmacrowasexpected.

Oneofthefollowingwasexpected:

Aliteralconstant,whichistextenclosedin<>AtextmacronameAmacrofunctioncallA%followedbyaconstantexpression

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 369: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 370: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2052

forcederror

Theconditional-errordirective.ERRor.ERR1wasusedtogeneratethiserror.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 371: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 372: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2053

forcederror:valueequalto0

Theconditional-errordirective.ERREwasusedtogeneratethiserror.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 373: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 374: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2054

forcederror:valuenotequalto0

Theconditional-errordirective.ERRNZwasusedtogeneratethiserror.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 375: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 376: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2055

forcederror:symbolnotdefined

Theconditional-errordirective.ERRNDEFwasusedtogeneratethiserror.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 377: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 378: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2056

forcederror:symboldefined

Theconditional-errordirective.ERRDEFwasusedtogeneratethiserror.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 379: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 380: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2057

forcederror:stringblank

Theconditional-errordirective.ERRBwasusedtogeneratethiserror.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 381: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 382: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2058

forcederror:stringnotblank

Theconditional-errordirective.ERRNBwasusedtogeneratethiserror.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 383: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 384: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2059

forcederror:stringsequal

Theconditional-errordirective.ERRIDNor.ERRIDNIwasusedtogeneratethiserror.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 385: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 386: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2060

forcederror:stringsnotequal

Theconditional-errordirective.ERRDIFor.ERRDIFIwasusedtogeneratethiserror.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 387: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 388: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2061

[[[ELSE]]]IF2/.ERR2notallowed:single-passassembler

Adirectiveforatwo-passassemblerwasfound.

TheMicrosoftMacroAssembler(MASM)isaone-passassembler.MASMdoesnotaccepttheIF2,ELSEIF2,and.ERR2directives.ThiserroralsooccursifanELSEdirectivefollowsanIF1directive.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 389: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 390: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2062

expressiontoocomplexfor.UNTILCXZ

Anexpressionusedintheconditionthatfollows.UNTILCXZwastoocomplex.The.UNTILCXZdirectivecantakeonlyoneexpression,whichcancontainonly==or!=.Itcannottakeothercomparisonoperatorsormorecomplexexpressionsusingoperatorslike||.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 391: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 392: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2063

canALIGNonlytopowerof2:expression

TheexpressionspecifiedwiththeALIGNdirectivewasinvalid.TheALIGNexpressionmustbeapowerof2between2and256,andmustbelessthanorequaltothealignmentofthecurrentsegment,structure,orunion.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 393: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 394: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2064

structurealignmentmustbe1,2,or4

Thealignmentspecifiedinastructuredefinitionwasinvalid.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 395: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 396: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2065

expected:token

Theassemblerexpectedthegiventoken.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 397: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 398: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2066

incompatibleCPUmodeandsegmentsize

AnattemptwasmadetoopenasegmentwithaUSE16,USE32,orFLATattributethatwasnotcompatiblewiththespecifiedCPU,ortochangetoa16-bitCPUwhileina32bitsegment.

TheUSE32andFLATattributesmustbeprecededbyoneofthefollowingprocessordirectives:.386,.386C,.386P,.486,or.486P.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 399: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 400: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2068

instructionprefixnotallowed

OneoftheprefixesREP,REPE,REPNE,orLOCKprecededaninstructionforwhichitwasnotvalid.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 401: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 402: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2070

invalidinstructionoperands

Oneormoreoperandswerenotvalidfortheinstructiontheywerespecifiedwith.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 403: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 404: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2071

initializertoolargeforspecifiedsize

Aninitializervaluewastoolargeforthedataareaitwasinitializing.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 405: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 406: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2072

cannotaccesssymbolingivensegmentorgroup:identifier

Thegivenidentifiercannotbeaddressedfromthesegmentorgroupspecified.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 407: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 408: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2074

cannotaccesslabelthroughsegmentregisters

Anattemptwasmadetoaccessalabelthroughasegmentregisterthatwasnotassumedtoitssegmentorgroup.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 409: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 410: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2075

jumpdestinationtoofar[:by'n'bytes]

Thedestinationspecifiedwithajumpinstructionwastoofarfromtheinstruction.Oneofthefollowingmaybeasolution:

EnabletheLJMPoption.RemovetheSHORToperator.IfSHORThasforcedajumpthatistoofar,nisthenumberofbytesoutofrange.Rearrangecodesothatthejumpisnolongeroutofrange.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 411: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 412: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2076

jumpdestinationmustspecifyalabel

Adirectjumps'destinationmustberelativetoacodelabel.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 413: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 414: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2077

instructiondoesnotallowNEARindirectaddressing

Aconditionaljumporloopcannottakeamemoryoperand.Itmustbegivenarelativeaddressorlabel.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 415: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 416: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2079

instructiondoesnotallowFARdirectaddressing

Aconditionaljumporloopcannotbetoadifferentsegmentorgroup.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 417: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 418: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2080

jumpdistancenotpossibleincurrentCPUmode

Adistancewasspecifiedwithajumpinstructionthatwasincompatiblewiththecurrentprocessormode.

Forexample,48-bitjumpsrequire.386orabove.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 419: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 420: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2081

missingoperandafterunaryoperator

Anoperatorrequiredanoperand,butnooperandfollowed.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 421: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 422: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2082

cannotmix16-and32-bitregisters

Anaddressexpressioncontainedboth16-and32-bitregisters.Forexample,thefollowingexpressioncausesthiserror:

[bx+edi]

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 423: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 424: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2083

invalidscalevalue

Aregisterscalewasspecifiedthatwasnot1,2,4,or8.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 425: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 426: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2084

constantvaluetoolarge

Aconstantwasspecifiedthatwastoobigforthecontextinwhichitwasused.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 427: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 428: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2085

instructionorregisternotacceptedincurrentCPUmode

Anattemptwasmadetouseaninstruction,register,orkeywordthatwasnotvalidforthecurrentprocessormode.

Forexample,32-bitregistersrequire.386orabove.ControlregisterssuchasCR0requireprivilegedmode.386Porabove.ThiserrorwillalsobegeneratedfortheNEAR32,FAR32,andFLATkeywords,whichrequire.386orabove.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 429: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 430: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2086

reservedwordexpected

OneormoreitemsinthelistspecifiedwithaNOKEYWORDoptionwerenotrecognizedasreservedwords.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 431: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 432: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2087

instructionformrequires80386/486

Aninstructionwasusedthatwasnotcompatiblewiththecurrentprocessormode.

Oneofthefollowingprocessordirectivesmustprecedetheinstruction:.386,.386C,.386P,.486,or.486P.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 433: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 434: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2088

ENDdirectiverequiredatendoffile

Theassemblerreachedtheendofthemainsourcefileanddidnotfindan.ENDdirective.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 435: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 436: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2089

toomanybitsinRECORD:identifier

Oneofthefollowingoccurred:

Toomanybitsweredefinedforthegivenrecordfield.Toomanytotalbitsweredefinedforthegivenrecord.Thesizelimitforarecordorafieldinarecordis16bitswhendoing16-bitarithmeticor32bitswhendoing32-bitarithmetic.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 437: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 438: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2090

positivevalueexpected

Apositivevaluewasnotfoundinoneofthefollowingsituations:

ThestartingpositionspecifiedforSUBSTRor@SubStrThenumberofdataobjectsspecifiedforCOMMTheelementsizespecifiedforCOMM

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 439: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 440: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2091

indexvaluepastendofstring

AnindexvalueexceededthelengthofthestringitreferredtowhenusedwithINSTR,SUBSTR,@InStr,or@SubStr.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 441: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 442: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2092

countmustbepositiveorzero

TheoperandspecifiedtotheSUBSTRdirective,@SubStrmacrofunction,SHLoperator,SHRoperator,orDUPoperatorwasnegative.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 443: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 444: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2093

countvaluetoolarge

ThelengthargumentspecifiedforSUBSTRor@SubStrexceededthelengthofthespecifiedstring.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 445: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 446: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2094

operandmustberelocatable

Anoperandwasnotrelativetoalabel.Oneofthefollowingoccurred:

AnoperandspecifiedwiththeENDdirectivewasnotrelativetoalabel.AnoperandtotheSEGoperatorwasnotrelativetoalabel.Therightoperandtotheminusoperatorwasrelativetoalabel,buttheleftoperandwasnot.Theoperandstoarelationaloperatorwereeithernotbothintegerconstantsornotbothmemoryoperands.Relationaloperatorscantakeoperandsthatarebothaddressesorbothnon-addressesbutnotoneofeach.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 447: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 448: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2095

constantorrelocatablelabelexpected

Theoperandspecifiedmustbeaconstantexpressionoramemoryoffset.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 449: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 450: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2096

segment,group,orsegmentregisterexpected

Asegmentorgroupwasexpectedbutwasnotfound.Oneofthefollowingoccurred:

Theleftoperandspecifiedwiththesegmentoverrideoperator(:)wasnotasegmentregister(CS,DS,SS,ES,FS,orGS),groupname,segmentname,orsegmentexpression.TheASSUMEdirectivewasgivenasegmentregisterwithoutavalidsegmentaddress,segmentregister,group,orthespecialFLATgroup.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 451: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 452: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2097

segmentexpected:identifier

TheGROUPdirectivewasgivenanidentifierthatwasnotadefinedsegment.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 453: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 454: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2098

invalidoperandforOFFSET

TheexpressionfollowingtheOFFSEToperatormustbeamemoryexpressionoranimmediateexpression.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 455: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 456: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2100

segmentorgroupnotallowed

Anattemptwasmadetouseasegmentorgroupinawaythatwasnotvalid.Segmentsorgroupscannotbeadded.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 457: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 458: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2101

cannotaddtworelocatablelabels

Anattemptwasmadetoaddtwoexpressionsthatwerebothrelativetoalabel.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 459: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 460: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2103

segmentexceeds64Klimit

A16-bitsegmentexceededthesizelimitof64K.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 461: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 462: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2104

invalidtypefordatadeclaration:type

Thegiventypewasnotvalidforadatadeclaration.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 463: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 464: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2105

HIGHandLOWrequireimmediateoperands

TheoperandspecifiedwitheithertheHIGHortheLOWoperatorwasnotanimmediateexpression.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 465: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 466: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2107

cannothaveimplicitfarjumporcalltonearlabel

Anattemptwasmadetomakeanimplicitfarjumporcalltoanearlabelinanothersegment.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 467: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 468: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2108

useofregisterassumedtoERROR

AnattemptwasmadetousearegisterthathadbeenassumedtoERRORwiththeASSUMEdirective.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 469: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 470: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2110

COMMENTdelimiterexpected

AdelimitercharacterwasnotspecifiedforaCOMMENTdirective.

Thedelimitercharacterisspecifiedbythefirstcharacterthatisnotwhitespace(spacesorTABcharacters)aftertheCOMMENTdirective.Thecommentconsistsofalltextfollowingthedelimiteruntiltheendofthelinecontainingthenextappearanceofthedelimiter.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 471: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 472: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2111

conflictingparameterdefinition

AproceduredefinedwiththePROCdirectivedidnotmatchitsprototypeasdefinedwiththePROTOdirective.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 473: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 474: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2112

PROCandprototypecallingconventionsconflict

Aprocedurewasdefinedinaprototype(usingthePROTO,EXTERNDEF,orEXTERNdirective),butthecallingconventiondidnotmatchthecorrespondingPROCdirective.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 475: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 476: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2113

invalidradixtag

Thespecifiedradixwasnotanumberintherange2-16.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 477: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 478: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2114

INVOKEargumenttypemismatch:argumentnumber

ThetypeoftheargumentspassedusingtheINVOKEdirectivedidnotmatchthetypeoftheparametersintheprototypeoftheprocedurebeinginvoked.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 479: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 480: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2119

languagetypemustbespecified

Aproceduredefinitionorprototypewasnotgivenalanguagetype.

Alanguagetypemustbedeclaredineachproceduredefinitionorprototypeifadefaultlanguagetypeisnotspecified.Adefaultlanguagetypeissetusingeitherthe.MODELdirective,OPTIONLANG,ortheASMCcommand-lineoptions/Gcor/Gd.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 481: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 482: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2120

PROLOGUEmustbemacrofunction

TheidentifierspecifiedwiththeOPTIONPROLOGUEdirectivewasnotrecognizedasadefinedmacrofunction.

Theuser-definedprologuemustbeamacrofunctionthatreturnsthenumberofbytesneededforlocalvariablesandanyextraspaceneededforthemacrofunction.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 483: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 484: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2121

EPILOGUEmustbemacroprocedure

TheidentifierspecifiedwiththeOPTIONEPILOGUEdirectivewasnotrecognizedasadefinedmacroprocedure.Theuser-definedepiloguemacrocannotreturnavalue.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 485: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 486: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2123

textmacronestingleveltoodeep

Atextmacrowasnestedtoodeeply.Thenestinglimitfortextmacrosis100.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 487: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 488: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2125

missingmacroargument

Arequiredargumentto@InStr,@SubStr,orauser-definedmacrowasnotspecified.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 489: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 490: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2129

VARARGparametermustbelastparameter

AparameterotherthanthelastonewasgiventheVARARGattribute.

The:VARARGspecificationcanbeappliedonlytothelastparameterinaparameterlistformacroandproceduredefinitionsandprototypes.Youcannotusemultiple:VARARGspecificationsinamacro.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 491: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 492: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2131

VARARGparameterrequiresCcallingconvention

AVARARGparameterwasspecifiedinaproceduredefinitionorprototype,buttheC,SYSCALL,orSTDCALLcallingconventionwasnotspecified.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 493: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 494: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2132

ORGneedsaconstantorlocaloffset

TheexpressionspecifiedwiththeORGdirectivewasnotvalid.ORGrequiresanimmediateexpressionwithnoreferencetoanexternallabelortoalabeloutsidethecurrentsegment.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 495: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 496: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2133

registervalueoverwrittenbyINVOKE

Aregisterwaspassedasanargumenttoaprocedure,butthecodegeneratedbyINVOKEtopassotherargumentsdestroyedthecontentsoftheregister.

TheAX,AL,AH,EAX,DX,DL,DH,andEDXregistersmaybeusedbytheassemblertoperformdataconversion.

Useadifferentregister.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 497: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 498: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2136

toomanyargumentstoINVOKE

ThenumberofargumentspassedusingtheINVOKEdirectiveexceededthenumberofparametersintheprototypefortheprocedurebeinginvoked.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 499: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 500: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2141

toomanyoperandstoinstruction

Toomanyoperandswerespecifiedwithastringcontrolinstruction.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 501: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 502: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2142

cannothavemorethanone.ELSEclauseper.IFblock

Theassemblerfoundmorethanone.ELSEclausewithinthecurrent.IFblock.Use.ELSEIFforallbutthelastblock.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 503: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 504: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2143

expecteddatalabel

TheLENGTHOF,SIZEOF,LENGTH,orSIZEoperatorwasappliedtoanon-datalabel,ortheSIZEOForSIZEoperatorwasappliedtoatype.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 505: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 506: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2144

cannotnestprocedures

Anattemptwasmadetonestaprocedurecontainingaparameter,localvariable,USESclause,orastatementthatgeneratedanewsegmentorgroup.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 507: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 508: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2145

EXPORTmustbeFAR:procedure

ThegivenprocedurewasgivenEXPORTvisibilityandNEARdistance.AllEXPORTproceduresmustbeFAR.ThedefaultvisibilitymayhavebeensetwiththeOPTIONPROC:EXPORTstatementortheSMALLorCOMPACTmemorymodels.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 509: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 510: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2147

macrolabelnotdefined:macrolabel

Thegivenmacrolabelwasnotfound.Amacrolabelisdefinedwith:macrolabel.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 511: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 512: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2148

invalidsymboltypeinexpression:identifier

Thegivenidentifierwasusedinanexpressioninwhichitwasnotvalid.Forexample,amacroprocedurenameisnotallowedinanexpression.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 513: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 514: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2151

specialregistercannotbefirstoperand

Aspecialregisterwasspecifiedtoaninstructionthatcannottakeitasthefirstoperand.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 515: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 516: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2154

syntaxerrorincontrol-flowdirective

Theconditionforacontrol-flowdirective(suchas.IFor.WHILE)containedasyntaxerror.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 517: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 518: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2156

constantvalueoutofrange

AninvalidvaluewasspecifiedforthePAGEdirective.ThefirstparameterofthePAGEdirectivecanbeeither0oravalueintherange10-255.ThesecondparameterofthePAGEdirectivecanbeeither0oravalueintherange60-255.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 519: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 520: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2157

missingrightparenthesis

Arightparenthesis,),wasmissingfromamacrofunctioncall.Besurethatparenthesesareinpairsifnested.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 521: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 522: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2159

structurecannotbeinstanced

AnattemptwasmadetocreateaninstanceofastructurewhentherewerenofieldsordatadefinedinthestructuredefinitionorwhenORGwasusedinthestructuredefinition.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 523: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 524: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2166

structurefieldexpected

Therighthandsideofadotoperator(.)isnotastructurefield.Thiserrormayoccurwithsomecodeacceptabletopreviousversionsoftheassembler.Toenabletheoldbehavior,useOPTIONOLDSTRUCTS,whichisautomaticallyenabledbyOPTIONM510orthe/Zmcommand-lineoption.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 525: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 526: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2167

unexpectedliteralfoundinexpression

Aliteralwasfoundwhereanexpressionwasexpected.Oneofthefollowingmayhaveoccurred:

AliteralwasusedasaninitializerArecordtagwasomittedfromarecordconstant

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 527: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 528: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2169

dividebyzeroinexpression

Anexpressioncontainsadivisorwhosevalueisequaltozero.

Checkthatthesyntaxoftheexpressioniscorrectandthatthedivisor(whetherconstantorvariable)iscorrectlyinitialized.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 529: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 530: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2170

directivemustappearinsideamacro

AGOTOorEXITMdirectivewasfoundoutsidethebodyofamacro.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 531: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 532: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2172

toofewbitsinRECORD

Therewasanattempttodefinearecordfieldof0bits.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 533: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 534: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2175

invalidqualifiedtype

Anidentifierwasencounteredinaqualifiedtypethatwasnotatype,structure,record,union,orprototype.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 535: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 536: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2178

invaliduseofFLAT

TherewasanambiguousreferencetoFLATasagroup.ThiserrorisgeneratedwhenthereisareferencetoFLATinsteadofaFLATsubgroup.Forexample,

movax,FLAT;GeneratesA2178

movax,SEGFLAT:_data;Correct

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 537: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 538: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2179

structureimproperlyinitialized

Therewasanerrorinastructureinitializer.Oneofthefollowingoccurred:

Theinitializerisnotavalidexpression.TheinitializerisaninvalidDUPstatement.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 539: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 540: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2181

initializermustbeastringorsingleitem

Therewasanattempttoinitializeastructureelementwithsomethingotherthanasingleitemorstring.

Thiserrorcanbecausedbyomittingbraces({})aroundaninitializer.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 541: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 542: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2187

mustusefloatingpointinitializer

AvariabledeclaredwiththeREAL4,REAL8,andREAL10directivesmustbeinitializedwithafloating-pointnumberoraquestionmark(?).

Thiserrorcanbecausedbygivinganinitializerinintegerform(suchas18)insteadofinfloating-pointform(18.0).

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 543: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 544: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2189

invalidcombinationwithsegmentalignment

ThealignmentspecifiedbytheALIGNorEVENdirectivewasgreaterthanthecurrentsegmentalignmentasspecifiedbytheSEGMENTdirective.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 545: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 546: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2190

INVOKErequiresprototypeforprocedure

TheINVOKEdirectivemustbeprecededbyaPROTOstatementfortheprocedurebeingcalled.WhenusingINVOKEwithanaddressratherthananexplicitprocedurename,youmustprecedetheaddresswithapointertotheprototype.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 547: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 548: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2199

symbollanguageattributeconflict

Twodeclarationsforthesamesymbolhaveconflictinglanguageattributes(suchasCandPASCAL).Theattributesshouldbeidenticalorcompatible.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 549: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 550: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2200

.STARTUPdoesnotworkwith32-bitsegments

The.STARTUPdirectivecannotbeusedina32-bitsegment;itisvalidonlywhengenerating16-bitcode.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 551: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 552: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2202

ORGdirectivenotallowedinunions

TheORGdirectiveisnotvalidinsideaUNIONdefinition.

YoucanusetheORGdirectiveinsideSTRUCTdefinitions,butitismeaninglessinsideaUNION.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 553: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 554: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2206

illegaluseofsegmentregister

YoucannotusesegmentoverridesfortheFSorGSsegmentregisterswhengeneratingfloating-pointemulationinstructionswiththe/FPicommand-lineoptionorOPTIONEMULATOR.

*ML6.0compatibleerror

SeeAlso

ASMCErrorMessages

Page 555: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 556: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2214

GROUPdirectivenotallowedwith/coffoption

TheGROUPdirectiveisnotpermittedwhencompilingwith/coff.

SeeMLandML64Command-LineReferenceformoreinformation.

*ML8compatibleerror

SeeAlso

ASMCErrorMessages

Page 557: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 558: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA2217

mustbepublicorexternal

Analternatesymbolwasnotpublicorexternal.

Example

ThecodesamplebelowwouldgenerateA2217iftheline:

public alternate

werenotpresent.

.686

.model flat

extrn primary(alternate):near

.code

public alternate

alternate:

ret

end

*ML8compatibleerror

SeeAlso

ASMCErrorMessages

Page 559: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 560: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3000

assemblypassesreached:passes

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages

Page 561: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 562: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3001

invalidfixuptypefor:

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages

Page 563: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 564: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3002

/PEoptionrequiresFLATmemorymodel

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages

Page 565: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 566: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3003

/bin:invalidstartlabel

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages

Page 567: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 568: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3004

cannotuseTR-TRwithcurrentCPUsetting

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages

Page 569: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 570: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3005

nosegmentinformationtocreatefixup:

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages

Page 571: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 572: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3006

notsupportedwithcurrentoutputformat:

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages

Page 573: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 574: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3007

missing.ENDPROLOG:

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages

Page 575: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 576: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3008

.ENDPROLOGfoundbeforeEHdirectives

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages

Page 577: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 578: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3009

missingFRAMEinPROC,nounwindcodewillbegenerated

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages

Page 579: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 580: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3010

sizeofprologtoobig,mustbe<256bytes

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages

Page 581: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 582: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3011

toomanyunwindcodesinFRAMEprocedure

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages

Page 583: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 584: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3012

registersAH-DHmaynotbeusedwithSPL-DILorR8-R15

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages

Page 585: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 586: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3013

multipleoverrides

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages

Page 587: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 588: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3014

unknownfixuptype::at

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages

Page 589: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 590: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3015

filenameparametermustbeenclosedin<>orquotes

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages

Page 591: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 592: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3016

literalexpectedafter'='

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages

Page 593: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 594: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3017

.SAFESEHargumentmustbeaPROC

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages

Page 595: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 596: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3018

invalidoperandfor:

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages

Page 597: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 598: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3019

invalidfixuptypeforformat:typesymbolatlocationoffset

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages

Page 599: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 600: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3020

cannotopenfile:filename

SameasMLA1000.

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages

Page 601: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 602: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3021

I/Oerrorclosingfile

SameasMLA1001.

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages

Page 603: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 604: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCNonfatalErrorA3022

.CASEredefinition:identifierA(val):identifierB(val)

Thegivennonredefinablesymbolwasdefinedintwoplaces.

*NonMLcompatibleerror

SeeAlso

ASMCErrorMessages|A2005

Page 605: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 606: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA4003

startaddressonENDdirectiveignoredwith.STARTUP

Both.STARTUPandaprogramloadaddress(optionalwiththeENDdirective)werespecified.TheaddressspecificationwiththeENDdirectivewasignored.

*ML6.0compatiblewarning

SeeAlso

ASMCErrorMessages

Page 607: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 608: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA4005

unknowndefaultprologueargument

Anunknownargumentwaspassedtothedefaultprologue.ThedefaultprologueunderstandsonlytheFORCEFRAMEandLOADDSarguments.

*ML6.0compatiblewarning

SeeAlso

ASMCErrorMessages

Page 609: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 610: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA4006

toomanyargumentsinmacrocall

Thereweremoreargumentsgiveninthemacrocallthantherewereparametersinthemacrodefinition.

*ML6.0compatiblewarning

SeeAlso

ASMCErrorMessages

Page 611: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 612: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA4007

optionuntranslated,directiverequired:option

ThereisnoASMCcommand-lineequivalentforthegivenoption.Thedesiredbehaviorcanbeobtainedbyusingadirectiveinthesourcefile.

OptionDirective

/A

/P

/S

.ALPHA

OPTIONREADONLY

.SEQ

*ML6.0compatiblewarning

SeeAlso

ASMCErrorMessages

Page 613: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 614: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA4008

invalidcommand-lineoptionvalue,defaultisused:option

Thevaluespecifiedwiththegivenoptionwasnotvalid.Theoptionwasignored,andthedefaultwasassumed.

*ML6.0compatiblewarning

SeeAlso

ASMCErrorMessages

Page 615: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 616: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA4011

multiple.MODELdirectivesfound:.MODELignored

Morethanone.MODELdirectivewasfoundinthecurrentmodule.Onlythefirst.MODELstatementisused.

*ML6.0compatiblewarning

SeeAlso

ASMCErrorMessages

Page 617: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 618: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA4012

linenumberinformationforsegmentwithoutclass'CODE'

Therewereinstructionsinasegmentthatdidnothaveaclassnamethatendswith"CODE."TheassemblerdidnotgenerateCodeViewinformationfortheseinstructions.

CodeViewcannotprocessmoduleswithcodeinsegmentswithclassnamesthatdonotendwith"CODE."

*ML6.0compatiblewarning

SeeAlso

ASMCErrorMessages

Page 619: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 620: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA4910

cannotopenfile:filename

Thegivenfilenamecouldnotbeinthecurrentpath.

Makesurethatfilenamewascopiedfromthedistributiondisksandisinthecurrentpath.

*ML6.0compatiblewarning

SeeAlso

ASMCErrorMessages

Page 621: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 622: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA6003

conditionaljumplengthened

Aconditionaljumpwasencodedasareverseconditionaljumparoundanearunconditionaljump.

Youmaybeabletorearrangecodetoavoidthelongerform.

*ML6.0compatiblelevel3warning(-W3)

SeeAlso

ASMCErrorMessages

Page 623: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 624: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA6004

procedureargumentorlocalnotreferenced

YoupassedaprocedureargumentorcreatedavariablewiththeLOCALdirectivethatwasnotusedintheprocedurebody.

Unnecessaryparametersandlocalswastecodeandstackspace.*ML6.0compatiblelevel3warning(-W3)

SeeAlso

ASMCErrorMessages

Page 625: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 626: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA6005

expressionconditionmaybepass-dependent

Thiswarningmessagemayindicatethatthecodeispass-dependentandshouldberewritten.

Example

moval,reg

regequ<cl>

*ML8.0/NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 627: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 628: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA8000

Invalidcommand-lineoption:option

ASMCdidnotrecognizethegivenparameterasanoption.Thiserrorisgenerallycausedwhenthereisasyntaxerroronthecommandline.

SameasA1006

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 629: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 630: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA8001

SeeA2167

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 631: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 632: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA8002

SeeA2189

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 633: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 634: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA8003

SeeA2103

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 635: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 636: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA8004

SeeA2004

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 637: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 638: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA8005

IF[n]DEFexpectsaplainsymbolasargument:argument

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 639: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 640: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA8006

instructionsandinitializeddatanotsupportedinsegmentsegments

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 641: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 642: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA8007

16bitfixupfor32bitlabel:label

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 643: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 644: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA8008

displacementoutofrange:displacement

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 645: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 646: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA8009

nostartlabeldefined

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 647: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 648: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA8010

nostackdefined

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 649: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 650: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA8011

for-coffleadingunderscorerequiredforstartlabel:label

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 651: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 652: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA8012

librarynameismissing

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 653: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 654: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA8013

ELFGNUextensions(8/16-bitrelocations)used

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 655: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 656: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA8014

LOADDSignoredinflatmodel

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 657: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 658: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA8015

directiveignoredwithout-switchswitch

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 659: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 660: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA8017

ignored:symbol

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 661: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 662: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA8018

groupdefinitiontoolarge,truncated:group

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 663: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 664: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA8019

sizenotspecified,assuming:

Thisisawarning.maybeBYTE,WORDorDWORD.Themessagemayoccurifanimmediatevalueiswrittentoanuntypedmemoryreference:

mov[ebx],1

JWasmmakesaguessanddisplaysthewarning,whileMLwilldisplayanerrorinsuchcases.

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages|ErrorA2070

Page 665: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 666: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA8020

constantexpected

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages|ErrorA2026

Page 667: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 668: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA7000

symbollanguageattributeconflict

Twodeclarationsforthesamesymbolhaveconflictinglanguageattributes(suchasCandPASCAL).Theattributesshouldbeidenticalorcompatible.

SameasMLErrorA2192

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 669: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 670: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA7001

positivevalueexpected

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages|ErrorA2090

Page 671: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 672: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA7002

registervalueoverwrittenbyINVOKE

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages|ErrorA2133

Page 673: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 674: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA7003

farcallisconvertedtonearcall

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 675: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 676: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA7004

floating-pointinitializerignored

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 677: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 678: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA7005

directiveignored:

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 679: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 680: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA7006

parameter/localnameisreservedword:

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 681: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 682: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA7007

.CASEwithout.ENDC:assumedfallthrough

IncaseOPTIONSWITCH:Cisset(default)

.switcheax

.case1:moval,1 ;warning

.case2:.endc

.endsw

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 683: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 684: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

ASMCWarningA7008

cannotdelaymacrofunction:<token>

Macrothatnormallywouldbedelayedexpanded.

.WHILEmacro(<...>)

.ELSEIFmacro(<...>)

.CASEmacro(<...>)

*NonMLcompatiblewarning

SeeAlso

ASMCErrorMessages

Page 685: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

.UNTILAXZ

See.REPEAT

SeeAlso

DirectivesReference,.UNTILBXZ,.UNTILCXZ,.UNTILDXZ

Page 686: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

.UNTILBXZ

See.REPEAT

SeeAlso

DirectivesReference,.UNTILAXZ,.UNTILCXZ,.UNTILDXZ

Page 687: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

.UNTILDXZ

See.REPEAT

SeeAlso

DirectivesReference,.UNTILAXZ,.UNTILBXZ,.UNTILCXZ

Page 688: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

AsmcMacroAssemblerReference

Page 689: Asmc Macro Assembler Reference · Asmc Macro Assembler Reference Asmc Extensions The main goal with Asmc is an attempt to provide more readability to the assembly language based on

.ENDF

.ENDFclosesa.FOR[S]statement.

SeeAlso

DirectivesReference|.FOR