kbd - evaluate input.

This commit is contained in:
Kelvin Sherlock 2019-12-13 23:52:02 -05:00
parent 903a6be697
commit 6024ff6436
2 changed files with 6 additions and 5 deletions

View File

@ -713,10 +713,11 @@ void evaluate(label_t label, opcode_t opcode, operand_t operand) {
char *cp = fgets(buffer, sizeof(buffer), stdin);
if (!cp) return;
uint32_t value = 0;
// evaluate string. expressions and labels are allowed....
define(label, value, LBL_KBD);
operand_t number_operand(const char *YYCURSOR, bool required);
operand_t op = number_operand(cp, true);
define(label, eval(op), LBL_KBD);
break;
}

View File

@ -179,8 +179,8 @@ exit:
static operand_t number_operand(const char *YYCURSOR, bool required = true) {
/* not static - called from link.cpp */
operand_t number_operand(const char *YYCURSOR, bool required = true) {
const char *iter = YYCURSOR;
// const char *YYMARKER = nullptr;