local data

This commit is contained in:
julianb0 2019-05-30 12:37:22 +02:00
parent 847f2ba9d6
commit c2603b9692
No known key found for this signature in database
GPG Key ID: DDF8325C95299A62
2 changed files with 10 additions and 6 deletions

View File

@ -212,20 +212,25 @@ def parse_preproc(line):
leave() leave()
sys.exit(1) sys.exit(1)
label = tok[0]
if label[0] == '.':
label = plastlabel + label
plabels_data[label] = pdata
# number data
if is_number(tok[2]): 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)) written = b_data.write(int(tok[2], base=0).to_bytes(8, byteorder='little', signed=False))
assert(written == 8) assert(written == 8)
pdata += written pdata += written
# string data
elif tok[2][0] in "'\"": elif tok[2][0] in "'\"":
s = tok[2].strip() s = tok[2].strip()
assert(s[-1] == tok[2][0]) assert(s[-1] == tok[2][0])
s = s[1:-1] s = s[1:-1]
plabels_data[tok[0]] = pdata
real_len = 0 real_len = 0
escaping = False escaping = False

View File

@ -1,17 +1,16 @@
; The OS/K Team licences this file to you under the MIT license. ; The OS/K Team licences this file to you under the MIT license.
; See the LICENSE file in the project root for more information. ; See the LICENSE file in the project root for more information.
hw = "Hello World\n:)"
; ;
; Main function ; Main function
; ;
main: main:
enter enter
mov ax0, hw mov ax0, .hw
call print call print
leave leave
ret ret
.hw = "Hello World\n:)"