\lstdefinelanguage{lX86}{
keywordstyle = [5]\xlstGetStyle{literals}, % for other literals :D
sensitive=false, % we are case insensitive
alsoletter={.}, alsoother={:}, comment=[l]{;},
moredelim=**[is][{\xlsthlbox{xlstwarning}}]{|warn|}{|warn|},
moredelim=**[is][{\xlsthlboxd{\xlstcustom}}]{|custom|}{|custom|},
moredelim=[is][]{|plain|}{|plain|},
moredelim=[is][\xlstGetStyle{highlight}]{|ihl|}{|ihl|},
moredelim=**[is][\xlstGetStyle{numbers}]{|num|}{|num|},
moredelim=**[is][\xlstGetStyle{literals}]{|str|}{|str|},
moredelim=**[is][\xlstGetStyle{comments}]{|cmt|}{|cmt|},
moredelim=**[is][\itshape\bfseries]{|bhl|}{|bhl|},
moredelim=**[il][\itshape]{mrk>},
morestring = [s]"", % maybe use d?
morestring = [s]'',
morekeywords={%
  add,and,arpl,bound,bsf,bsr,bswap,bt,btc,%
  btr,bts,call,cbw,cdq,clc,cld,cli,clts,cmc,cmp,cmps,cmpsb,cmpsw,%
  cmpsd,cmpxchg,cwd,cwde,daa,das,dec,div,enter,hlt,idiv,imul,in,%
  inc,ins,int,into,invd,invlpg,iret,ja,jae,jb,jbe,jc,jcxz,jecxz,%
  je,jg,jge,jl,jle,jna,jnae,jnb,jnbe,jnc,jne,jng,jnge,jnl,jnle,%
  jno,jnp,jns,jnz,jo,jp,jpe,jpo,js,jz,jmp,lahf,lar,lea,leave,lgdt,%
  lidt,lldt,lmsw,lock,lods,lodsb,lodsw,lodsd,loop,loopz,loopnz,%
  loope,loopne,lds,les,lfs,lgs,lss,lsl,ltr,mov,movs,movsb,movsw,%
  movsd,movsx,movzx,mul,neg,nop,not,or,out,outs,pop,popa,popad,%
  popf,popfd,push,pusha,pushad,pushf,pushfd,rcl,rcr,rep,repe,%
  repne,repz,repnz,ret,retf,rol,ror,sahf,sal,sar,sbb,scas,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,sgdt,shl,shld,shr,%
  shrd,sidt,sldt,smsw,stc,std,sti,stos,stosb,stosw,stosd,str,sub,%
  test,verr,verw,wait,wbinvd,xadd,xchg,xlatb,xor,fabs,fadd,fbld,%
  fbstp,fchs,fclex,fcom,fcos,fdecstp,fdiv,fdivr,ffree,fiadd,ficom,%
  fidiv,fidivr,fild,fimul,fincstp,finit,fist,fisub,fisubr,fld,fld1,%
  fldl2e,fldl2t,fldlg2,fldln2,fldpi,fldz,fldcw,fldenv,fmul,fnop,%
  fpatan,fprem,fprem1,fptan,frndint,frstor,fsave,fscale,fsetpm,%
  fsin,fsincos,fsqrt,fst,fstcw,fstenv,fstsw,fsub,fsubr,ftst,fucom,%
  fwait,fxam,fxch,fxtract,fyl2x,fyl2xp1,f2xm1},%
morekeywords=[2]{%
  .align,.alpha,assume,byte,code,comm,comment,.const,%
  .cref,.data,.data?,db,dd,df,dosseg,dq,dt,dw,dword,else,end,endif,%
  endm,endp,ends,eq,equ,.err,.err1,.err2,.errb,.errdef,.errdif,%
  .erre,.erridn,.errnb,.errndef,.errnz,event,exitm,extrn,far,%
  .fardata,.fardata?,fword,ge,group,gt,high,if,if1,if2,ifb,ifdef,%
  ifdif,ife,ifidn,ifnb,ifndef,include,includelib,irp,irpc,label,%
  .lall,le,length,.lfcond,.list,local,low,lt,macro,mask,mod,.model,%
  name,ne,near,offset,flat,org,out,page,proc,ptr,public,purge,qword,.%
  radix,record,rept,.sall,seg,segment,.seq,.sfcond,short,size,%
  .stack,struc,subttl,tbyte,.tfcond,this,title,type,.type,width,%
  word,.xall,.xcref,.xlist,.string},%
morekeywords=[3]{%
  al,ah,ax,eax,bl,bh,bx,ebx,cl,ch,cx,ecx,dl,dh,dx,edx,%
  si,esi,di,edi,bp,ebp,sp,esp,cs,ds,es,ss,fs,gs,cr0,cr1,cr2,cr3,%
  db0,db1,db2,db3,db4,db5,db6,db7,tr0,tr1,tr2,tr3,tr4,tr5,tr6,tr7,%
  rax,rbx,rcx,rdx,rsi,rdi,rip,r8,r9,r10,r11,r12,r13,r14,r15,%
  st,aaa,aad,aam,aas,adc,rbp,rsp%
}}

\RegisterLanguage{x86}{lX86}