<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language _name="Assembler" version="1.0" _section="Sources" mimetypes="text/x-asm;text/x-assembler">
	
	<escape-char>\</escape-char>

	<line-comment _name = "Line Comment" style= "Comment">
		<start-regex>#|@</start-regex>
	</line-comment>

	<block-comment _name = "Block Comment" style = "Comment">
		<start-regex>/\*</start-regex>
        	<end-regex>\*/</end-regex>
	</block-comment>

	<pattern-item _name = "Operators" style = "Keyword">
		<regex>[-.,:\+\*\/\(\)\{\}\[]|]</regex>
	</pattern-item>

	<pattern-item _name = "ImOperand" style = "Keyword">
		<regex>\$[A-Za-z0-9_\-\+]*</regex>
	</pattern-item>

	<pattern-item _name = "Label" style = "Preprocessor">
		<regex>^[A-Za-z_][A-Za-z_0-9]*\:</regex>
	</pattern-item>

	<string _name = "String" style = "String" end-at-line-end = "TRUE">
		<start-regex>&quot;</start-regex>
		<end-regex>&quot;</end-regex>
	</string>

	<keyword-list _name = "Registers" style = "Data Type" case-sensitive="FALSE"
		match-empty-string-at-beginning = "FALSE"
		match-empty-string-at-end = "TRUE"
		beginning-regex = "%">
		
		<!-- intel 386 -->
		
		<keyword>eax</keyword>
		<keyword>ebx</keyword>
		<keyword>ecx</keyword>
		<keyword>edx</keyword>		
		<keyword>esi</keyword>
		<keyword>edi</keyword>		
		<keyword>esp</keyword>
		<keyword>ebp</keyword>

		<keyword>ax</keyword>
		<keyword>bx</keyword>
		<keyword>cx</keyword>
		<keyword>dx</keyword>
		<keyword>di</keyword>
		<keyword>si</keyword>
		<keyword>bp</keyword>
		<keyword>sp</keyword>

		<keyword>al</keyword>
		<keyword>ah</keyword>
		<keyword>bh</keyword>
		<keyword>bl</keyword>
		<keyword>ch</keyword>
		<keyword>cl</keyword>
		<keyword>dh</keyword>
		<keyword>dl</keyword>

		<keyword>cs</keyword>
		<keyword>ds</keyword>
		<keyword>ss</keyword>
		<keyword>es</keyword>
		<keyword>fs</keyword>
		<keyword>gs</keyword>
		
		<keyword>cr0</keyword>
		<keyword>cr2</keyword>
		<keyword>cr3</keyword>
		
		<keyword>db0</keyword>
		<keyword>db1</keyword>
		<keyword>db2</keyword>
		<keyword>db3</keyword>
		<keyword>db6</keyword>
		<keyword>db7</keyword>
		
		<keyword>tr6</keyword>
		<keyword>tr7</keyword>
		
		<keyword>st</keyword>
		<keyword>st(0)</keyword>
		<keyword>st(1)</keyword>
		<keyword>st(2)</keyword>
		<keyword>st(3)</keyword>
		<keyword>st(4)</keyword>
		<keyword>st(5)</keyword>
		<keyword>st(6)</keyword>
		<keyword>st(7)</keyword>
		
		<keyword>mm0</keyword>
		<keyword>mm1</keyword>
		<keyword>mm2</keyword>
		<keyword>mm3</keyword>
		<keyword>mm4</keyword>
		<keyword>mm5</keyword>
		<keyword>mm6</keyword>
		<keyword>mm7</keyword>
		
		<keyword>xmm0</keyword>
		<keyword>xmm1</keyword>
		<keyword>xmm2</keyword>
		<keyword>xmm3</keyword>
		<keyword>xmm4</keyword>
		<keyword>xmm5</keyword>
		<keyword>xmm6</keyword>
		<keyword>xmm7</keyword>
	</keyword-list>

	<pattern-item _name = "Character Constant" style = "String">
		<regex>&apos;([^\]|\\(.?))</regex>
	</pattern-item>

	<pattern-item _name = "Decimal" style = "Decimal">
		<regex>\b([1-9][0-9]*|0)([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)?\b</regex>
	</pattern-item>

	<pattern-item _name = "Floating Point Number" style = "Floating Point">
		<regex>\b([0-9]+[Ee][-]?[0-9]+|([0-9]*\.[0-9]+|[0-9]+\.)([Ee][-]?[0-9]+)?)[fFlL]?</regex>
	</pattern-item>

	<pattern-item _name = "Hex Number" style = "Base-N Integer">
		<regex>\b0[xX][0-9a-fA-F]+([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)?\b</regex>
	</pattern-item>

</language>
