# Define SciTE settings for Assembler files
# Black Horus blackhorus@gmx.net

# Masm files
file.patterns.asm=*.asm;*.S
filter.asm=Assembler (asm)|$(file.patterns.asm)|

lexer.$(file.patterns.asm)=asm

###these keywords are taken from the masm book (v6.13)

cpu_instruction=aaa aad aam aas adc add and call cbw \
	clc cld cli cmc cmp cmps cmpsb cmpsw cwd daa das dec div esc hlt \
	idiv imul in inc int into iret ja jae jb jbe jc jcxz je jg jge jl \
	jle jmp jna jnae jnb jnbe jnc jne jng jnge jnl jnle jno jnp jns \
	jnz jo jp jpe jpo js jz lahf lds lea les lods lodsb lodsw loop \
	loope loopew loopne loopnew loopnz loopnzw loopw loopz loopzw \
	mov movs movsb movsw mul neg nop not or out pop popf push pushf \
	rcl rcr ret retf retn rol ror sahf sal sar sbb scas scasb scasw \
	shl shr stc std sti stos stosb stosw sub test wait xchg xlat \
	xlatb xor \
	bound enter ins insb insw leave outs outsb outsw popa pusha pushw \
	arpl lar lsl sgdt sidt sldt smsw str verr verw clts lgdt lidt lldt lmsw ltr \
	bsf bsr bt btc btr bts cdq cmpsd cwde insd iretd iretdf  iretf \
	jecxz lfs lgs lodsd loopd  looped  loopned  loopnzd  loopzd  lss \
	movsd movsx movzx outsd popad popfd pushad pushd  pushfd scasd seta \
	setae setb setbe setc sete setg setge setl setle setna setnae setnb \
	setnbe setnc setne setng setnge setnl setnle setno setnp setns \
	setnz seto setp setpe setpo sets setz shld shrd stosd \
	bswap cmpxchg invd  invlpg  wbinvd  xadd \
	lock rep repe repne repnz repz

fpu_instruction=f2xm1 fabs fadd faddp fbld fbstp fchs fclex fcom fcomp fcompp fdecstp \
	fdisi fdiv fdivp fdivr fdivrp feni ffree fiadd ficom ficomp fidiv \
	fidivr fild fimul fincstp finit fist fistp fisub fisubr fld fld1 \
	fldcw fldenv fldenvw fldl2e fldl2t fldlg2 fldln2 fldpi fldz fmul \
	fmulp fnclex fndisi fneni fninit fnop fnsave fnsavew fnstcw fnstenv \
	fnstenvw fnstsw fpatan fprem fptan frndint frstor frstorw fsave \
	fsavew fscale fsqrt fst fstcw fstenv fstenvw fstp fstsw fsub fsubp \
	fsubr fsubrp ftst fwait fxam fxch fxtract fyl2x fyl2xp1 \
	fsetpm fcos fldenvd fnsaved fnstenvd fprem1 frstord fsaved fsin fsincos \
	fstenvd fucom fucomp fucompp

register=ah al ax bh bl bp bx ch cl cr0 cr2 cr3 cs \
	cx dh di dl dr0 dr1 dr2 dr3 dr6 dr7 ds dx eax ebp ebx ecx edi edx \
	es esi esp fs gs si sp ss st tr3 tr4 tr5 tr6 tr7

directive=.186 .286 .286c .286p .287 .386 .386c .386p .387 .486 .486p \
	.8086 .8087 .alpha .break .code .const .continue .cref .data .data?  \
	.dosseg .else .elseif .endif .endw .err .err1 .err2 .errb \
	.errdef .errdif .errdifi .erre .erridn .erridni .errnb .errndef \
	.errnz .exit .fardata .fardata? .if .lall .lfcond .list .listall \
	.listif .listmacro .listmacroall  .model .no87 .nocref .nolist \
	.nolistif .nolistmacro .radix .repeat .sall .seq .sfcond .stack \
	.startup .tfcond .type .until .untilcxz .while .xall .xcref \
	.xlist alias align assume catstr comm comment db dd df dosseg dq \
	dt dup dw echo else elseif elseif1 elseif2 elseifb elseifdef elseifdif \
	elseifdifi elseife elseifidn elseifidni elseifnb elseifndef end \
	endif endm endp ends eq  equ even exitm extern externdef extrn for \
	forc ge goto group gt high highword if if1 if2 ifb ifdef ifdif \
	ifdifi ife  ifidn ifidni ifnb ifndef include includelib instr invoke \
	irp irpc label le length lengthof local low lowword lroffset \
	lt macro mask mod .msfloat name ne offset opattr option org %out \
	page popcontext proc proto ptr public purge pushcontext record \
	repeat rept seg segment short size sizeof sizestr struc struct \
	substr subtitle subttl textequ this title type typedef union while width

directive_operand=$ ? @b @f addr basic byte c carry? dword \
	far far16 fortran fword near near16 overflow? parity? pascal qword  \
	real4  real8 real10 sbyte sdword sign? stdcall sword syscall tbyte \
	vararg word zero? flat near32 far32 \
	abs all assumes at casemap common compact \
	cpu dotname emulator epilogue error export expr16 expr32 farstack flat \
	forceframe huge language large listing ljmp loadds m510 medium memory \
	nearstack nodotname noemulator nokeyword noljmp nom510 none nonunique \
	nooldmacros nooldstructs noreadonly noscoped nosignextend nothing \
	notpublic oldmacros oldstructs os_dos para private prologue radix \
	readonly req scoped setif2 smallstack tiny use16 use32 uses

keywords.$(file.patterns.asm)=$(cpu_instruction)
keywords2.$(file.patterns.asm)=$(fpu_instruction)
keywords3.$(file.patterns.asm)=$(register)
keywords4.$(file.patterns.asm)=$(directive)
keywords5.$(file.patterns.asm)=$(directive_operand)

file.is.source.$(file.patterns.asm)=1
comment.block.asm=;
statement.indent.$(file.patterns.asm)=9 .if
statement.end.$(file.patterns.asm)=9 .endif

# Assembler Styles
style.asm.32=fore:#808080,font:Verdana,size:8
# Default
style.asm.0=$(style.default.whitespace)
# Comment
style.asm.1=$(style.default.comment)
#$(colour.code.comment.line),font:Comic Sans MS,size:8
# Number
style.asm.2=$(style.default.number)
# String
style.asm.3=$(style.default.singlequote)
# Operator
style.asm.4=$(style.default.operator)
# Identifier
style.asm.5=$(style.default.identifier)
# CPU instruction
style.asm.6=$(style.default.keyword)
#fore:#0000ff
# FPU instruction
style.asm.7=$(style.default.localkeyword)
# Register
style.asm.8=$(style.default.syskeyword)
# assembler Directive
style.asm.9=$(style.default.preprocessor)
# assembler Directive Operand
style.asm.10=fore:#0000ff

command.compile.file.$(file.patterns.asm)=as $(anjuta.compiler.flags) -c "$(current.file.name.ext)" -o "$(current.file.name).o"
command.build.file.$(file.patterns.asm)=link "$(current.file.name.ext)" $(anjuta.linker.flags) -o "$(current.file.name)"
command.execute.file.$(file.patterns.asm)="$(current.full.filename)" $(anjuta.program.arguments)

