📄 nasm.vim
字号:
syn match nasmInstrModifier "\<F\(ADD\|MUL\|\(DIV\|SUB\)R\=\)\s\+TO\>"lc=5,ms=e-1" the 'to' keyword is not allowed for fpu-pop instructions (yet)"syn match nasmInstrModifier "\<F\(ADD\|MUL\|\(DIV\|SUB\)R\=\)P\s\+TO\>"lc=6,ms=e-1" NAsm directivessyn keyword nasmRepeat TIMESsyn keyword nasmDirective ALIGN[B] INCBIN EQU NOSPLIT SPLITsyn keyword nasmDirective ABSOLUTE BITS SECTION SEGMENTsyn keyword nasmDirective ENDSECTION ENDSEGMENTsyn keyword nasmDirective __SECT__" Macro created standard directives: (requires %include)syn case matchsyn keyword nasmStdDirective ENDPROC EPILOGUE LOCALS PROC PROLOGUE USESsyn keyword nasmStdDirective ENDIF ELSE ELIF ELSIF IF"syn keyword nasmStdDirective BREAK CASE DEFAULT ENDSWITCH SWITCH"syn keyword nasmStdDirective CASE OF ENDCASEsyn keyword nasmStdDirective DO ENDFOR ENDWHILE FOR REPEAT UNTIL WHILE EXITsyn case ignore" Format specific directives: (all formats)" (excluded: extension directives to section, global, common and extern)syn keyword nasmFmtDirective ORGsyn keyword nasmFmtDirective EXPORT IMPORT GROUP UPPERCASE SEG WRTsyn keyword nasmFmtDirective LIBRARYsyn case matchsyn keyword nasmFmtDirective _GLOBAL_OFFSET_TABLE_ __GLOBAL_OFFSET_TABLE_syn keyword nasmFmtDirective ..start ..got ..gotoff ..gotpc ..plt ..symsyn case ignore" Standard Instructions:syn match nasmInstructnError "\<\(F\=CMOV\|SET\)N\=\a\{0,2}\>"syn keyword nasmInstructnError CMPS MOVS LCS LODS STOS XLATsyn match nasmStdInstruction "\<MOV\>"syn match nasmInstructnError "\<MOV\s[^,;[]*\<CS\>\s*[^:]"he=e-1syn match nasmStdInstruction "\<\(CMOV\|J\|SET\)\(N\=\([ABGL]E\=\|[CEOSZ]\)\|P[EO]\=\)\>"syn match nasmStdInstruction "\<POP\>"syn keyword nasmStdInstruction AAA AAD AAM AAS ADC ADD ANDsyn keyword nasmStdInstruction BOUND BSF BSR BSWAP BT[C] BTR BTSsyn keyword nasmStdInstruction CALL CBW CDQ CLC CLD CMC CMP CMPSB CMPSD CMPSWsyn keyword nasmStdInstruction CMPXCHG CMPXCHG8B CPUID CWD[E]syn keyword nasmStdInstruction DAA DAS DEC DIV ENTERsyn keyword nasmStdInstruction IDIV IMUL INC INT[O] IRET[D] IRETWsyn keyword nasmStdInstruction JCXZ JECXZ JMPsyn keyword nasmStdInstruction LAHF LDS LEA LEAVE LES LFS LGS LODSB LODSDsyn keyword nasmStdInstruction LODSW LOOP[E] LOOPNE LOOPNZ LOOPZ LSSsyn keyword nasmStdInstruction MOVSB MOVSD MOVSW MOVSX MOVZX MUL NEG NOP NOTsyn keyword nasmStdInstruction OR POPA[D] POPAW POPF[D] POPFWsyn keyword nasmStdInstruction PUSH[AD] PUSHAW PUSHF[D] PUSHFWsyn keyword nasmStdInstruction RCL RCR RETF RET[N] ROL RORsyn keyword nasmStdInstruction SAHF SAL SAR SBB SCASB SCASD SCASWsyn keyword nasmStdInstruction SHL[D] SHR[D] STC STD STOSB STOSD STOSW SUBsyn keyword nasmStdInstruction TEST XADD XCHG XLATB XOR" System Instructions: (usually privileged)" Verification of pointer parameterssyn keyword nasmSysInstruction ARPL LAR LSL VERR VERW" Addressing descriptor tablessyn keyword nasmSysInstruction LLDT SLDT LGDT SGDT" Multitaskingsyn keyword nasmSysInstruction LTR STR" Coprocessing and Multiprocessing (requires fpu and multiple cpu's resp.)syn keyword nasmSysInstruction CLTS LOCK WAIT" Input and Outputsyn keyword nasmInstructnError INS OUTSsyn keyword nasmSysInstruction IN INSB INSW INSD OUT OUTSB OUTSB OUTSW OUTSD" Interrupt controlsyn keyword nasmSysInstruction CLI STI LIDT SIDT" System controlsyn match nasmSysInstruction "\<MOV\s[^;]\{-}\<CR\o\>"me=s+3syn keyword nasmSysInstruction HLT INVD LMSWsyn keyword nasmSseInstruction PREFETCHT0 PREFETCHT1 PREFETCHT2 PREFETCHNTAsyn keyword nasmSseInstruction RSM SFENCE SMSW SYSENTER SYSEXIT UD2 WBINVD" TLB (Translation Lookahead Buffer) testingsyn match nasmSysInstruction "\<MOV\s[^;]\{-}\<TR\o\>"me=s+3syn keyword nasmSysInstruction INVLPG" Debugging Instructions: (privileged)syn match nasmDbgInstruction "\<MOV\s[^;]\{-}\<DR\o\>"me=s+3syn keyword nasmDbgInstruction INT1 INT3 RDMSR RDTSC RDPMC WRMSR" Floating Point Instructions: (requires FPU)syn match nasmFpuInstruction "\<FCMOVN\=\([AB]E\=\|[CEPUZ]\)\>"syn keyword nasmFpuInstruction F2XM1 FABS FADD[P] FBLD FBSTPsyn keyword nasmFpuInstruction FCHS FCLEX FCOM[IP] FCOMP[P] FCOSsyn keyword nasmFpuInstruction FDECSTP FDISI FDIV[P] FDIVR[P] FENI FFREEsyn keyword nasmFpuInstruction FIADD FICOM[P] FIDIV[R] FILDsyn keyword nasmFpuInstruction FIMUL FINCSTP FINIT FIST[P] FISUB[R]syn keyword nasmFpuInstruction FLD[1] FLDCW FLDENV FLDL2E FLDL2T FLDLG2syn keyword nasmFpuInstruction FLDLN2 FLDPI FLDZ FMUL[P]syn keyword nasmFpuInstruction FNCLEX FNDISI FNENI FNINIT FNOP FNSAVEsyn keyword nasmFpuInstruction FNSTCW FNSTENV FNSTSW FNSTSWsyn keyword nasmFpuInstruction FPATAN FPREM[1] FPTAN FRNDINT FRSTORsyn keyword nasmFpuInstruction FSAVE FSCALE FSETPM FSIN FSINCOS FSQRTsyn keyword nasmFpuInstruction FSTCW FSTENV FST[P] FSTSW FSUB[P] FSUBR[P]syn keyword nasmFpuInstruction FTST FUCOM[IP] FUCOMP[P]syn keyword nasmFpuInstruction FXAM FXCH FXTRACT FYL2X FYL2XP1" Multi Media Xtension Packed Instructions: (requires MMX unit)" Standard MMX instructions: (requires MMX1 unit)syn match nasmInstructnError "\<P\(ADD\|SUB\)U\=S\=[DQ]\=\>"syn match nasmInstructnError "\<PCMP\a\{0,2}[BDWQ]\=\>"syn keyword nasmMmxInstruction EMMS MOVD MOVQsyn keyword nasmMmxInstruction PACKSSDW PACKSSWB PACKUSWB PADDB PADDD PADDWsyn keyword nasmMmxInstruction PADDSB PADDSW PADDUSB PADDUSW PAND[N]syn keyword nasmMmxInstruction PCMPEQB PCMPEQD PCMPEQW PCMPGTB PCMPGTD PCMPGTWsyn keyword nasmMmxInstruction PMACHRIW PMADDWD PMULHW PMULLW PORsyn keyword nasmMmxInstruction PSLLD PSLLQ PSLLW PSRAD PSRAW PSRLD PSRLQ PSRLWsyn keyword nasmMmxInstruction PSUBB PSUBD PSUBW PSUBSB PSUBSW PSUBUSB PSUBUSWsyn keyword nasmMmxInstruction PUNPCKHBW PUNPCKHDQ PUNPCKHWDsyn keyword nasmMmxInstruction PUNPCKLBW PUNPCKLDQ PUNPCKLWD PXOR" Extended MMX instructions: (requires MMX2/SSE unit)syn keyword nasmMmxInstruction MASKMOVQ MOVNTQsyn keyword nasmMmxInstruction PAVGB PAVGW PEXTRW PINSRW PMAXSW PMAXUBsyn keyword nasmMmxInstruction PMINSW PMINUB PMOVMSKB PMULHUW PSADBW PSHUFW" Streaming SIMD Extension Packed Instructions: (requires SSE unit)syn match nasmInstructnError "\<CMP\a\{1,5}[PS]S\>"syn match nasmSseInstruction "\<CMP\(N\=\(EQ\|L[ET]\)\|\(UN\)\=ORD\)\=[PS]S\>"syn keyword nasmSseInstruction ADDPS ADDSS ANDNPS ANDPSsyn keyword nasmSseInstruction COMISS CVTPI2PS CVTPS2PIsyn keyword nasmSseInstruction CVTSI2SS CVTSS2SI CVTTPS2PI CVTTSS2SIsyn keyword nasmSseInstruction DIVPS DIVSS FXRSTOR FXSAVE LDMXCSRsyn keyword nasmSseInstruction MAXPS MAXSS MINPS MINSS MOVAPS MOVHLPS MOVHPSsyn keyword nasmSseInstruction MOVLHPS MOVLPS MOVMSKPS MOVNTPS MOVSS MOVUPSsyn keyword nasmSseInstruction MULPS MULSSsyn keyword nasmSseInstruction ORPS RCPPS RCPSS RSQRTPS RSQRTSSsyn keyword nasmSseInstruction SHUFPS SQRTPS SQRTSS STMXCSR SUBPS SUBSSsyn keyword nasmSseInstruction UCOMISS UNPCKHPS UNPCKLPS XORPS" Three Dimensional Now Packed Instructions: (requires 3DNow! unit)syn keyword nasmNowInstruction FEMMS PAVGUSB PF2ID PFACC PFADD PFCMPEQ PFCMPGEsyn keyword nasmNowInstruction PFCMPGT PFMAX PFMIN PFMUL PFRCP PFRCPIT1syn keyword nasmNowInstruction PFRCPIT2 PFRSQIT1 PFRSQRT PFSUB[R] PI2FDsyn keyword nasmNowInstruction PMULHRWA PREFETCH[W]" Vendor Specific Instructions:" Cyrix instructions (requires Cyrix processor)syn keyword nasmCrxInstruction PADDSIW PAVEB PDISTIB PMAGW PMULHRW[C] PMULHRIWsyn keyword nasmCrxInstruction PMVGEZB PMVLZB PMVNZB PMVZB PSUBSIWsyn keyword nasmCrxInstruction RDSHR RSDC RSLDT SMINT SMINTOLD SVDC SVLDT SVTSsyn keyword nasmCrxInstruction WRSHR" AMD instructions (requires AMD processor)syn keyword nasmAmdInstruction SYSCALL SYSRET" Undocumented Instructions:syn match nasmUndInstruction "\<POP\s[^;]*\<CS\>"me=s+3syn keyword nasmUndInstruction CMPXCHG486 IBTS ICEBP INT01 INT03 LOADALLsyn keyword nasmUndInstruction LOADALL286 LOADALL386 SALC SMI UD1 UMOV XBTS" Synchronize Syntax:syn sync clearsyn sync minlines=50 "for multiple region nestingsyn sync match nasmSync grouphere nasmMacroDef "^\s*%i\=macro\>"me=s-1syn sync match nasmSync grouphere NONE "^\s*%endmacro\>"" Define the default highlighting." For version 5.7 and earlier: only when not done already" For version 5.8 and later : only when an item doesn't have highlighting yetif version >= 508 || !exists("did_nasm_syntax_inits") if version < 508 let did_nasm_syntax_inits = 1 command -nargs=+ HiLink hi link <args> else command -nargs=+ HiLink hi def link <args> endif " Sub Links: HiLink nasmInMacDirective nasmDirective HiLink nasmInMacLabel nasmLocalLabel HiLink nasmInMacLblWarn nasmLabelWarn HiLink nasmInMacMacro nasmMacro HiLink nasmInMacParam nasmMacro HiLink nasmInMacParamNum nasmDecNumber HiLink nasmInMacPreCondit nasmPreCondit HiLink nasmInMacPreProc nasmPreProc HiLink nasmInPreCondit nasmPreCondit HiLink nasmInStructure nasmStructure HiLink nasmStructureLabel nasmStructure " Comment Group: HiLink nasmComment Comment HiLink nasmSpecialComment SpecialComment HiLink nasmInCommentTodo Todo " Constant Group: HiLink nasmString String HiLink nasmStringError Error HiLink nasmBinNumber Number HiLink nasmOctNumber Number HiLink nasmDecNumber Number HiLink nasmHexNumber Number HiLink nasmFltNumber Float HiLink nasmNumberError Error " Identifier Group: HiLink nasmLabel Identifier HiLink nasmLocalLabel Identifier HiLink nasmSpecialLabel Special HiLink nasmLabelError Error HiLink nasmLabelWarn Todo " PreProc Group: HiLink nasmPreProc PreProc HiLink nasmDefine Define HiLink nasmInclude Include HiLink nasmMacro Macro HiLink nasmPreCondit PreCondit HiLink nasmPreProcError Error HiLink nasmPreProcWarn Todo " Type Group: HiLink nasmType Type HiLink nasmStorage StorageClass HiLink nasmStructure Structure HiLink nasmTypeError Error " Directive Group: HiLink nasmConstant Constant HiLink nasmInstrModifier Operator HiLink nasmRepeat Repeat HiLink nasmDirective Keyword HiLink nasmStdDirective Operator HiLink nasmFmtDirective Keyword " Register Group: HiLink nasmCtrlRegister Special HiLink nasmDebugRegister Debug HiLink nasmTestRegister Special HiLink nasmRegisterError Error HiLink nasmMemRefError Error " Instruction Group: HiLink nasmStdInstruction Statement HiLink nasmSysInstruction Statement HiLink nasmDbgInstruction Debug HiLink nasmFpuInstruction Statement HiLink nasmMmxInstruction Statement HiLink nasmSseInstruction Statement HiLink nasmNowInstruction Statement HiLink nasmAmdInstruction Special HiLink nasmCrxInstruction Special HiLink nasmUndInstruction Todo HiLink nasmInstructnError Error delcommand HiLinkendiflet b:current_syntax = "nasm"" vim:ts=8 sw=4
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -