mirror of
https://gitlab.os-k.eu/os-k-team/kvisc.git
synced 2023-08-25 14:05:46 +02:00
negative offset
This commit is contained in:
parent
a4544a2b57
commit
a20f4a248e
15
as/k-as.py
15
as/k-as.py
@ -421,13 +421,22 @@ def gentext():
|
||||
lastimm = 4
|
||||
elif word == "%imm64":
|
||||
lastimm = 8
|
||||
elif word[2:] == "off" and word[0] == '%':
|
||||
|
||||
if word[2:] == "off" and word[0] == '%':
|
||||
lastimm = 2
|
||||
b_text.write(special_syms[word].to_bytes(2, byteorder='little', signed=False))
|
||||
isSigned = True
|
||||
else:
|
||||
isSigned = False
|
||||
|
||||
b_text.write(special_syms[word].to_bytes(2, byteorder='little', signed=isSigned))
|
||||
continue
|
||||
|
||||
if is_number(word):
|
||||
b_text.write(int(word, base=0).to_bytes(lastimm, byteorder='little', signed=False))
|
||||
if word[0] == '-':
|
||||
isSigned = True
|
||||
else:
|
||||
isSigned = False
|
||||
b_text.write(int(word, base=0).to_bytes(lastimm, byteorder='little', signed=isSigned))
|
||||
continue
|
||||
|
||||
print("Assembly error, unknown token '{}' in line: {}".format(word, line))
|
||||
|
Loading…
x
Reference in New Issue
Block a user