throw error with non-register operands
This commit is contained in:
@@ -661,17 +661,27 @@ tokenise:
|
|||||||
|
|
||||||
mov cx, ax ; cx = length counter for safe keeping
|
mov cx, ax ; cx = length counter for safe keeping
|
||||||
call evaluate_operand
|
call evaluate_operand
|
||||||
|
; dl = return code
|
||||||
; ax = register's token ID
|
; ax = register's token ID
|
||||||
|
|
||||||
pop rsi
|
pop rsi
|
||||||
pop rdi ; rdi = first byte of operand
|
pop rdi ; rdi = first byte of operand
|
||||||
add di, cx ; rdi = last byte of operand
|
add di, cx ; rdi = last byte of operand
|
||||||
mov cx, ax ; cx = register's token ID for safe keeping
|
mov rcx, rax ; rcx = evaluate_operand's return value
|
||||||
pop rax ; rax = number of tokens processed
|
pop rax ; rax = number of tokens processed
|
||||||
|
|
||||||
|
; operand is a register
|
||||||
|
; cx = token ID
|
||||||
|
cmp dl, 0x00
|
||||||
|
je .operand_register
|
||||||
|
|
||||||
|
jmp .unexpected_operand
|
||||||
|
|
||||||
|
.operand_register:
|
||||||
mov [TOKEN_TABLE_ADDR + rax * TOKEN_TABLE_ENTRY_SIZE], cx
|
mov [TOKEN_TABLE_ADDR + rax * TOKEN_TABLE_ENTRY_SIZE], cx
|
||||||
inc rax ; another token processed
|
inc rax ; another token processed
|
||||||
|
jmp .operand_break_continue
|
||||||
|
|
||||||
|
.operand_break_continue:
|
||||||
mov byte [.expecting], E_COMMENT | E_NEWLINE | E_WHITESPACE | E_COMMA
|
mov byte [.expecting], E_COMMENT | E_NEWLINE | E_WHITESPACE | E_COMMA
|
||||||
jmp .loop
|
jmp .loop
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user