generated from roerohan/Template
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or requesthacktoberfestHacktoberfest 2020Hacktoberfest 2020help wantedExtra attention is neededExtra attention is needed
Description
Parser does not recognize relative addressing and pre-processor directives
Addressing types
As of now, the parser is very simple and recognizes only Immediate, Register and Direct (Memory) addressing, as you can see in lexer.js. The goal is to support all types of addressing supported by Intel 8086.
Pre-processor directives
The parser does not support pre-processor instructions such as assume
, or segments such as the data and the code segment. Support for this is essential for users to be able to create named procedures and store strings, etc. in the data segment.
Instruction validation
Currently, the parser does not do a lot of syntax validation, in parser.js. This might allow instructions such as:
add bx, ; Notice the trailing comma
Stronger syntax checking needs to be implemented.
8086.js/src/emulator/parser/parser.js
Lines 44 to 60 in 017505b
parse() { | |
this.rawInstructions.forEach((instruction) => { | |
if (instruction.length > 4) { | |
throw new SyntaxError(); | |
} | |
if (instruction.length > 2 | |
&& instruction[2].name !== 'SEPARATOR') { | |
throw new SyntaxError(); | |
} | |
this.instructions.push(new Instruction({ | |
mnemonic: instruction[0], | |
op1: instruction[1] || null, | |
op2: instruction[3] || null, | |
})); | |
}); |
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or requesthacktoberfestHacktoberfest 2020Hacktoberfest 2020help wantedExtra attention is neededExtra attention is needed