From c2603b969282b746808ac35b3666aa1670396647 Mon Sep 17 00:00:00 2001 From: julianb0 Date: Thu, 30 May 2019 12:37:22 +0200 Subject: [PATCH] local data --- as/k-as.py | 11 ++++++++--- dos/main.k | 5 ++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/as/k-as.py b/as/k-as.py index 7c9f56c..b2cf7c2 100755 --- a/as/k-as.py +++ b/as/k-as.py @@ -212,20 +212,25 @@ def parse_preproc(line): leave() sys.exit(1) + label = tok[0] + if label[0] == '.': + label = plastlabel + label + + plabels_data[label] = pdata + + # number data if is_number(tok[2]): - plabels_data[tok[0]] = pdata written = b_data.write(int(tok[2], base=0).to_bytes(8, byteorder='little', signed=False)) assert(written == 8) pdata += written + # string data elif tok[2][0] in "'\"": s = tok[2].strip() assert(s[-1] == tok[2][0]) s = s[1:-1] - plabels_data[tok[0]] = pdata - real_len = 0 escaping = False diff --git a/dos/main.k b/dos/main.k index 4f8eca1..89fa0ef 100644 --- a/dos/main.k +++ b/dos/main.k @@ -1,17 +1,16 @@ ; The OS/K Team licences this file to you under the MIT license. ; See the LICENSE file in the project root for more information. -hw = "Hello World\n:)" - ; ; Main function ; main: enter - mov ax0, hw + mov ax0, .hw call print leave ret +.hw = "Hello World\n:)"