changeset 362:7101ad443081

Add null terminator to string literals in x86 module and fix a bug that interfered with use of function name labels in call instructions
author Michael Pavone <pavone@retrodev.com>
date Sat, 25 Apr 2015 13:05:38 -0700
parents 06dceff348ea
children d949fe826e04
files modules/x86.tp
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/modules/x86.tp	Thu Apr 23 19:24:20 2015 -0700
+++ b/modules/x86.tp	Sat Apr 25 13:05:38 2015 -0700
@@ -256,11 +256,13 @@
 	
 	data <- :bytes {
 		#{
-			length <- { bytes byte_length }
+			length <- { (bytes byte_length) + 1 }
 			flattenTo:at <- :dest :idx {
 				foreach: (range from: 0 to: length) :_ cidx {
 					dest set: idx + cidx (bytes byte: cidx)
 				}
+				//NULL terminator
+				dest set: idx + (bytes byte_length) 0u8
 				idx + length
 			}
 			string <- {
@@ -471,6 +473,7 @@
 				length <- { 0 }
 				hasOffset? <- { _offset >= 0 }
 				offset <- { _offset }
+				isInteger? <- { false }
 				register? <- { false }
 				label? <- { true }
 				flattenTo:at <- :dest :idx {