Syntax Highlighting
Posted: Sun Feb 01, 2009 2:42 pm
I think a wiki with so much code samples should support syntax highlighting. It would make code a lot easier to read.
JJ
JJ
If we all just used the damn ponies theme, this wouldn't be a problem!XenOS wrote:There might be other opinions, since anything dealing with colors depends on skin settings, which differ among users. So, a syntax highlighting suitable for one user might be painful for another.
Code: Select all
<source lang="asm">
mov eax, 0x0
cpuid
</source>
Code: Select all
<source lang="asm" line>
mov eax, 0x0
cpuid
</source>
Code: Select all
<source lang="asm" line start="20">
mov eax, 0x0
cpuid
</source>
Code: Select all
abap
actionscript3
actionscript
ada
apache
applescript
apt_sources
asm
asp
autoit
bash
basic4gl
blitzbasic
bnf
boo
caddcl
cadlisp
cfdg
cfm
cil
c_mac
cobol
c
cpp
cpp-qt
csharp
css
delphi
diff
div
dos
dot
d
eiffel
fortran
freebasic
genero
gettext
glsl
gml
gnuplot
groovy
haskell
html4strict
idl
ini
inno
io
java5
java
javascript
kixtart
klonec
klonecpp
latex
lisp
lotusformulas
lotusscript
lua
m68k
matlab
mirc
mpasm
mxml
mysql
nsis
objc
ocaml-brief
ocaml
oobas
oracle8
pascal
perl
per
php-brief
php
plsql
powershell
python
qbasic
rails
reg
robots
ruby
sas
scala
scheme
sdlbasic
smalltalk
smarty
sql
tcl
text
thinbasic
tsql
vbnet
vb
verilog
vhdl
visualfoxpro
winbatch
xml
xorg_conf
xpp
z80
It seems that all of the MMX and SSE instructions are absent, the long mode registers.I noticed that at least the cpuid instruction was missing from the syntax file for asm so I added that. I'm sure there are other instructions that are missing
Code: Select all
'KEYWORDS' => array(
/*CPU*/
1 => array(
'aaa','aad','aam','aas','adc','add','and','call','cbw', 'cflush', 'clc','cld','cli','cmc','cmp',
'cmps','cmpsb','cmpsw','cmpxchg8b','cpuid','cwd','daa','das','dec','div','esc','hlt','idiv','imul','in','inc',
'int','int1','int3','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','iretw',
'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','rdmsr','wrmsr','rdpmc','rdshr','rdtsc','rsdc','rsldt','rsm',
'rsts','salc','smi','smintold','smint','svdc','svldt','svts','pause','syscall','sysenter','sysexit','sysret',
'ud2','umov','xbts','wrshr'
),
/*FPU*/
2 => array(
'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',
'emms','femms','fxsave','fxrstor'
),
/*registers*/
3 => array(
'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',
'rax','rbx','rcx','rdx','rsi','rdi','rbp','rsp','cr8','spl','bpl','sil','dil',
'r8b','r9b','r10b','r11b','r12b','r13b','r14b','r15b',
'r8w','r9w','r10w','r11w','r12w','r13w','r14w','r15w',
'r8d','r9d','r10d','r11d','r12d','r13d','r14d','r15d',
'r8','r9','r10','r11','r12','r13','r14','r15'
),
/*Directive*/
4 => array(
'186','286','286c','286p','287','386','386c','386p','387','486','486p','586','686'
'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','dq',
'dt','dup','dw','echo','elseif1','elseif2','elseifb','elseifdef','elseifdif',
'elseifdifi','elseife','elseifidn','elseifidni','elseifnb','elseifndef','end',
'endm','endp','ends','eq',' equ','even','exitm','extern','externdef','extrn','for',
'forc','ge','goto','group','high','highword','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',
'macro','mask','mod','msfloat','name','ne','offset','opattr','option','org','%out',
'page','popcontext','private','proc','proto','ptr','public','purge','pushcontext','record',
'rept','seg','segment','short','size','sizeof','sizestr','struc','struct',
'substr','subtitle','subttl','textequ','this','title','typedef','union','width',
'.model', '.stack', '.code', '.data'
),
/*Operands*/
5 => array(
'@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',
'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','prologue',
'readonly','req','scoped','setif2','smallstack','tiny','use16','use32','uses'
)
),