diff --git a/mar/ace/mode-mar.js b/mar/ace/mode-mar.js index 90e4d45..a6fb5b1 100755 --- a/mar/ace/mode-mar.js +++ b/mar/ace/mode-mar.js @@ -47,7 +47,7 @@ define("ace/mode/mar_rules", ["require", "exports", "module", "ace/lib/oop", "ac start: [{ token: 'keyword.function.assembly', - regex: '\\b(?:mov|add|sub|and|or|test|cmp|shl|shr|mul|push|pop|div|xor|dw|nop|equ|neg|hwq|not|ror|rol|sal|sar|inc|dec|rcl|xchg|rcr)\\b', + regex: '\\b(?:mov|add|sub|and|or|test|cmp|shl|shr|mul|push|pop|div|xor|dw|nop|equ|neg|hwq|not|ror|rol|sal|sar|inc|dec|rcl|xchg|rcr|pushf|popf)\\b', caseInsensitive: true }, { diff --git a/mar/ace/mode-mar.min.js b/mar/ace/mode-mar.min.js index 286fef3..e7f6795 100644 --- a/mar/ace/mode-mar.min.js +++ b/mar/ace/mode-mar.min.js @@ -1,4 +1,4 @@ -define("ace/mode/mar_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(a,d,b){b=a("../lib/oop");a=a("./text_highlight_rules").TextHighlightRules;var c=function(){this.$rules={start:[{token:"keyword.function.assembly",regex:"\\b(?:mov|add|sub|and|or|test|cmp|shl|shr|mul|push|pop|div|xor|dw|nop|equ|neg|hwq|not|ror|rol|sal|sar|inc|dec|rcl|xchg|rcr)\\b",caseInsensitive:!0},{token:"keyword.operator.assembly",regex:"\\b(?:call|ret|jmp|jnz|jg|jl|jge|jle|hwi|jz|js|jns|jc|jnc|jo|jno)\\b", +define("ace/mode/mar_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(a,d,b){b=a("../lib/oop");a=a("./text_highlight_rules").TextHighlightRules;var c=function(){this.$rules={start:[{token:"keyword.function.assembly",regex:"\\b(?:mov|add|sub|and|or|test|cmp|shl|shr|mul|push|pop|div|xor|dw|nop|equ|neg|hwq|not|ror|rol|sal|sar|inc|dec|rcl|xchg|rcr|pushf|popf)\\b",caseInsensitive:!0},{token:"keyword.operator.assembly",regex:"\\b(?:call|ret|jmp|jnz|jg|jl|jge|jle|hwi|jz|js|jns|jc|jnc|jo|jno)\\b", caseInsensitive:!0},{token:"variable.predefined.ahk",regex:"\\b(?:brk|dup)\\b",caseInsensitive:!0},{token:"variable.parameter.register.assembly",regex:"\\b(?:A|B|C|D|X|Y|bp|sp)\\b",caseInsensitive:!0},{token:"constant.character.decimal.assembly",regex:"\\b[0-9]+\\b"},{token:"constant.character.hexadecimal.assembly",regex:"\\b0x[A-F0-9]+\\b",caseInsensitive:!0},{token:"string.assembly",regex:/"([^\\"]|\\.)*"/},{token:"comment.assembly",regex:";.*$"},{token:"support.function.directive.assembly",regex:/^\.text|\.data/}, {token:"entity.name.function.assembly",regex:/\w*:/}]};this.normalizeRules()};c.metaData={fileTypes:["asm"],name:"Much Assembly Required",scopeName:"source.assembly"};b.inherits(c,a);d.MarHighlightRules=c}); define("ace/mode/mar","require exports module ace/lib/oop ace/mode/text ace/mode/mar_rules".split(" "),function(a,d,b){b=a("../lib/oop");var c=a("./text").Mode,e=a("./mar_rules").MarHighlightRules;a=function(){this.HighlightRules=e;this.$behaviour=this.$defaultBehaviour};b.inherits(a,c);a.prototype.lineCommentStart=";";a.prototype.$id="ace/mode/mar";d.Mode=a}); diff --git a/mar/editor.js b/mar/editor.js index 94f1b31..fa01d6e 100644 --- a/mar/editor.js +++ b/mar/editor.js @@ -261,7 +261,7 @@ function parseInstruction(line, result, currentLine) { if (!parseDWInstruction(line, result, currentLine)) { if (new RegExp('\\b(?:mov|add|sub|and|or|test|cmp|shl|shr|mul|push|pop|div|xor|hwi|hwq|nop|neg|' + - 'call|ret|jmp|jnz|jg|jl|jge|jle|int|jz|js|jns|brk|not|jc|jnc|ror|rol|sal|sar|jo|jno|inc|dec|rcl|xchg|rcr)\\b').test(mnemonic.toLowerCase())) { + 'call|ret|jmp|jnz|jg|jl|jge|jle|int|jz|js|jns|brk|not|jc|jnc|ror|rol|sal|sar|jo|jno|inc|dec|rcl|xchg|rcr|pushf|popf)\\b').test(mnemonic.toLowerCase())) { if (line.indexOf(",") !== -1) { @@ -319,7 +319,7 @@ function parseInstruction(line, result, currentLine) { strO1 = line.substring(line.indexOf(mnemonic) + mnemonic.length).trim(); //Validate operand number - if (!new RegExp('\\b(?:push|mul|pop|div|neg|call|jnz|jg|jl|jge|jle|hwi|hwq|jz|js|jns|ret|jmp|not|jc|jnc|jo|jno|inc|dec)\\b').test(mnemonic.toLowerCase())) { + if (!new RegExp('\\b(?:push|mul|pop|div|neg|call|jnz|jg|jl|jge|jle|hwi|hwq|jz|js|jns|ret|jmp|not|jc|jnc|jo|jno|inc|dec|popf)\\b').test(mnemonic.toLowerCase())) { result.annotations.push({ row: currentLine, column: 0, @@ -342,7 +342,7 @@ function parseInstruction(line, result, currentLine) { } else { //No operand - if (!new RegExp('\\b(?:ret|brk|nop)\\b').test(mnemonic.toLowerCase())) { + if (!new RegExp('\\b(?:ret|brk|nop|pushf)\\b').test(mnemonic.toLowerCase())) { //Validate operand number result.annotations.push({ diff --git a/mar/editor.min.js b/mar/editor.min.js index e293640..9dec85f 100644 --- a/mar/editor.min.js +++ b/mar/editor.min.js @@ -10,9 +10,9 @@ function parseDWInstruction(a,c,b){a=a.trim();if("dw"===a.substr(0,2).toLowerCas column:0,text:"Usage: DW IMM, IMM ...",type:"error"});break}}return!0}return!1} function getOperandType(a,c){a=a.trim();if(""===a)return OPERAND_INVALID;if(!isNaN(Number(a))&&Number(a)===Math.floor(Number(a))&&-1===a.indexOf("o")&&0!==a.indexOf("0e"))return OPERAND_IMM;if(/^(a|b|c|d|x|y|bp|sp)$/.test(a.toLowerCase()))return OPERAND_REG;for(b=0;b