From 0b7bb74541fd867ee8292c6525ad69fac68edda5 Mon Sep 17 00:00:00 2001 From: ALittlePatate Date: Mon, 19 Aug 2024 13:08:21 +0200 Subject: [PATCH] add: hex numbers in arguments --- src/instructions.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/instructions.c b/src/instructions.c index 6987556..96959af 100644 --- a/src/instructions.c +++ b/src/instructions.c @@ -90,7 +90,10 @@ long long get_value(char* arg) { } } else { - ret = atoi(arg); + if (strlen(arg) > 2 && arg[0] == '0' && arg[1] == 'x') { + ret = strtol(arg, NULL, 16); + } + ret = atoi(arg); } return ret; }