1
0
mirror of https://gitlab.os-k.eu/os-k-team/kvisc.git synced 2023-08-25 14:05:46 +02:00
This commit is contained in:
julianb0 2019-05-29 22:59:17 +02:00
parent 49215693b8
commit 0dc287e889
No known key found for this signature in database
GPG Key ID: DDF8325C95299A62
4 changed files with 16 additions and 19 deletions

View File

@ -2,19 +2,19 @@
# See the LICENSE file in the project root for more information.
all: kas
# kas
kpc:
@cd pc && make --no-print-directory
kas: kpc as/k-as.py as/regs.lst as/testfile.k
kas: kpc as/k-as.py as/regs.lst
@cp pc/instrs/instrs.lst as
@rm -f pc/instrs/instrs.lst
test: kas
@cd as && ./k-as.py testfile.k 0x100000 testfile.out
@pc/k.exe as/testfile.out
asm: os/dos.k
@cd os && ../as/k-as.py dos.k 0x100000 a.out
disasm: kas
@cd as && ./k-as.py testfile.k 0x100000 testfile.out
@pc/k.exe as/testfile.out -d
test: kas asm
@pc/k.exe os/a.out
disasm: kas asm
@pc/k.exe os/a.out -d

View File

@ -3,6 +3,7 @@
# The OS/K Team licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.
import os
import sys
import subprocess
from array import array
@ -17,8 +18,8 @@ instrs = open(".{}.instr".format(sys.argv[3]), "w+")
b_data = open(".{}.data".format(sys.argv[3]), "w+b")
b_text = open(".{}.text".format(sys.argv[3]), "w+b")
lst_regs = open("regs.lst")
lst_instrs = open("instrs.lst")
lst_regs = open(os.path.join(sys.path[0], "regs.lst"))
lst_instrs = open(os.path.join(sys.path[0], "instrs.lst"))
fi = open(sys.argv[1])
b_out = open(sys.argv[3], "wb")
@ -199,7 +200,7 @@ def parse():
if line[0] == ' ' or line[0] == '\t':
line = line.lstrip()
if line[0] == '#' or line[0] == ';':
if line[0] in '#;@!/':
continue
ok, line = apply_pdefs(line)

View File

@ -3,6 +3,8 @@
hw = "Hello World"
;
; void main(void)
;
; Entry point
;
@ -13,11 +15,6 @@ main:
mov ax0, hw
call print
; mov ax0, hw
; mov ax1, hw_len
; call print_n
stop
;
@ -45,7 +42,6 @@ print:
leave
ret
;
; void print_n(char *, int)
;

View File

@ -5,7 +5,7 @@
reg_t arch_r[NREGS] =
{
{ "inv", "Invalid register", 0, RES },
{ "inv", "Invalid register", "Invalid", 0, RES },
{ "rip", "Instruction pointer", "Special; Volatile", 0, RES },
{ "flg", "Flags register", "Special; Volatile", 0, RES },
@ -71,7 +71,7 @@ void dumpregs(ctx_t *ctx)
int i;
reg_t *r;
//assert(ctx->r[INV].val == 0);
assert(ctx->r[INV].val == 0);
log("\nRegisters:\n");
log("rip=0x%-16lX flg=0x%-16lX ", ctx->r[RIP].val, ctx->r[FLG].val);