# Define SciTE settings for Assembler files (IA32 MASM and NASM)
# Originally by Black Horus blackhorus@gmx.net 2002
# Updated by Kein-Hong Man mkh@pl.jaring.my 2003-10

# Masm files
file.patterns.asm=*.asm;*.asx;*.h;*.a65;*.mac;*.fas;*.mae
filter.asm=mads (*.asm;*.asx;*.h;*.a65;*.mac;*.fas;*.mae)|$(file.patterns.asm)|

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


cpu_instruction=lda   ldx   ldy   sta   stx   sty   adc   and \
  asl   sbc   jsr   jmp   lsr   ora   cmp   cpy \
  cpx   dec   inc   eor   rol   ror   brk   clc \
  cli   clv   cld   php   plp   pha   pla   rti \
  rts   sec   sei   sed   iny   inx   dey   dex \
  txa   tya   txs   tay   tax   tsx   nop   bpl \
  bmi   bne   bcc   bcs   beq   bvc   bvs   bit \
  stz   sep   rep   trb   tsb   bra   cop   mvn \
  mvp   pea   phb   phd   phk   phx   phy   plb \
  pld   plx   ply   rtl   stp   tcd   tcs   tdc \
  tsc   txy   tyx   wai   wdm   xba   xce   dea \
  ina   brl   jsl   jml   per   pei


ext_instruction=equ   opt   org   ins   end   dta   icl   run \
  nmb   ini   rmb   lmb   ift   eli   els   eif \
  ert   smb   blk   sin   rnd   req   rne   rpl \
  rmi   rcc   rcs   rvc   rvs   seq   sne   spl \
  smi   scc   scs   svc   svs	jeq   jne   jpl \
  jmi   jcc   jcs   jvc   jvs   ext   add   sub \
  mva   mvx   mvy   mwa   mwx   mwy   inw   dew \
  adw   sbw   phr   plr   adb   sbb   set


register=x y


# mads directives

directive=.macro  .endm   .proc   .endp   .rept   .endr   .exit \
  .local .endl   .struct .ends   .error  .print  .if \
  .else  .elseif .endif  .byte   .word   .long   .dword \
  .or    .and    .xor    .not    .ds     .dbyte \
  .def   .array  .enda   .hi     .lo     .get    .put \
  .sav	 .pages	 .endpg  .reloc  .extrn  .public .var \
  .reg	 .while	 .endw   .by     .wo     .he	 .en \
  .sb	 .test	 .endt   .switch .case   .endsw  .lend \
  .pend	 .aend	 .wend   .tend   .send   .fl     .symbol \
  .link  .global .globl  .adr    .len    .mend   .pgend \
  .rend  .using  .use    .echo   .align  .zpvar  .enum \
  .ende  .eend   .elif   .define .undef


keywords.$(file.patterns.asm)=$(cpu_instruction)
keywords2.$(file.patterns.asm)=$(ext_instruction)
keywords3.$(file.patterns.asm)=$(register)
keywords4.$(file.patterns.asm)=$(directive)

comment.block.asm=;

comment.stream.start.asm=/*
comment.stream.end.asm=*/

comment.box.start.asm=/*
comment.box.middle.asm=*
comment.box.end.asm= */


# Assembler Styles
style.asm.32=fore:#000000,font:Fixedsys,size:8
# Default
style.asm.0=
# Comment
style.asm.1=fore:#EE44AA
# Number
style.asm.2=fore:#ff0000
# String
style.asm.3=$(colour.string)
# Operator
style.asm.4=$(colour.operator),bold
# Identifier
style.asm.5=
# CPU instruction
style.asm.6=fore:#0000ff
#fore:#0000ff
# EXT instruction
style.asm.7=fore:#002080
# Register
style.asm.8=fore:#55aa10,bold
# assembler Directive
style.asm.9=fore:#aa0044
# assembler Directive Operand
style.asm.10=fore:#0000ff
# Comment block (GNU as /*...*/ syntax, unimplemented)
style.asm.11=$(colour.code.comment.box),$(font.code.comment.box)
# Character/String (single quote) (also character prefix in GNU as)
style.asm.12=$(colour.char)
# End of line where string is not closed
style.asm.13=fore:#000000,back:#E0C0E0,eolfilled
# Extended instructions
style.asm.14=fore:#B00040


command.compile.$(file.patterns.asm)=mads $(FileNameExt)

statement.indent.$(file.patterns.asm)=9 .if
statement.end.$(file.patterns.asm)=9 .endif
