From 3b0ad0c84111be433de39b8a74c03db7e99cb686 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Fri, 23 Dec 2022 03:33:56 -0500 Subject: Add initial value functions --- tnslc/compile/isa_x86.tnsl | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'tnslc/compile/isa_x86.tnsl') diff --git a/tnslc/compile/isa_x86.tnsl b/tnslc/compile/isa_x86.tnsl index 02ba899..3fda486 100644 --- a/tnslc/compile/isa_x86.tnsl +++ b/tnslc/compile/isa_x86.tnsl @@ -131,31 +131,23 @@ # - bx # - cx # - dx -# - sp -# - bp # - si # - di +# - bp +# - sp # - 8-15 #/ /; get_reg (uint size, {}uint8 common) [{}uint8] ;{}uint8 out = "%" - /; if (string_equate(common, "ax") || string_equate(common, "bx") || string_equate(common, "cx") || string_equate(common, "dx")) - - /; if (size == 1) - ;common{1} = 'l' - ;; else if (size == 4) - ;out.append('e') - ;; else if (size == 8) - ;out.append('r') - ;/ - - ;add_strings(~out, ~common) + /; if (common{0} !< 'a') - ;; else if (string_equate(common, "sp") || string_equate(common, "bp") || string_equate(common, "si") || string_equate(common, "di")) - /; if (size == 1) - ;common.append('l') + /; if(common{1} == 'x') + ;common{1} = 'l' + ;; else + ;common.append('l') + ;/ ;; else if (size == 4) ;out.append('e') ;; else if (size == 8) -- cgit v1.2.3