-
Notifications
You must be signed in to change notification settings - Fork 0
/
let_handler_main.js
40 lines (28 loc) · 1.02 KB
/
let_handler_main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*****************************************************************************
LET MAIN
*****************************************************************************/
var target_operand;
// data_type
// value
// addressing_mode
//============================================================================
// Let handler
//============================================================================
function handleLet() {
emitCurrentSourceLineAsCommentToCode();
// Get gobal "target_operand"
nextToken();
target_operand = getOperand();
nextToken(); // skip "="
nextToken(); // first token of math expression
parseMathExpressionToMathStack();
//optimizeStackCode();
//math_stack.forEach( debugOuputStackCode )
createTAC();
tac.forEach( debugOuputTacCode )
if ( target_operand.data_type == "word" )
output6502CodeForWordExpression();
else // "byte" and "dbyte"
output6502CodeForByteExpression();
emitEmptyCodeLine();
}