Commit 88daccb0 authored by John P. Willis's avatar John P. Willis
Browse files

Catch up

parent 8e20195f
......@@ -25,31 +25,41 @@
#
BINFILES = xiasm mkdisk ilxi ilxi.xmf
all: vm xiasm util
all: vm xiasm util linker
dist: all
mkdir -p dist/
cp src/linker/link dist/
cp src/vm/ilxi dist/
cp src/util/mkdisk dist/
cp src/xiasm/xiasm dist/
cp doc/ilxi.xmf dist/
cp bin/.ilximrc dist/
cp examples/input/input.xa dist/
lib:
cd src/lib; make
vm: lib
libilxi:
cd src/libilxi; make
libobj: libilxi
cd src/libobj; make
linker: libilxi libobj
cd src/linker; make
vm: libilxi
cd src/vm; make
xiasm: lib
xiasm: libilxi libobj
cd src/xiasm; make
util: lib
util: libilxi
cd src/util; make
clean:
cd src/lib; make clean
cd src/libilxi; make clean
cd src/libobj; make clean
cd src/vm; make clean
cd src/util; make clean
cd src/xiasm; make clean
cd src/linker; make clean
rm -rf dist
'
' OBJECT FILE FORMAT
'
' object_header
' magic: must be XIO
' relocation_count: number of relocation_entry records
'
' relocation_entry: 1 per relocation entry
'
' section_header:
'
' st_page: binary image
type object_header
magic as string * 3 ' XIO
symbol_count as integer
relocation_count as integer
section_count as integer
end type
' these are references to symbols
type relocation_entry
key as string * 24
reference_offset as ushort
section_title as string * 16
section_offset as ushort
end type
type section_header
title as string * 16
origin as ushort
size as ushort
end type
'
' message.bi
'
#define MSG_INFO 0
#define MSG_WARN 1
#define MSG_WARNING 1
#define MSG_ERROR 2
#define MSG_LISTING 3
declare sub message_init()
declare sub message_print(output_string as string)
declare sub tool_message(msg_level as ubyte, tool as string, message as string, byval output_location as string = "")
declare sub list_heading(tool as string, byval input_file as string)
declare sub listing(line_number as integer, address as string, code_output as string, byval listfile as string)
declare sub list_output(msg as string, byval listfile as string)
dim shared message_row as integer
dim shared message_col as integer
\ No newline at end of file
dim shared message_col as integer
......@@ -2,8 +2,6 @@
#define PAGECOUNT 2048
type st_page
task_id as ubyte
label as string * 255
contents(0 to PAGESIZE - 1) as ubyte
end type
......@@ -13,7 +11,7 @@ declare sub st_load_page(file as string, page as integer)
declare sub st_save_page(file as string, page as integer)
declare sub st_write_word(page as integer, offset as integer, wordval as ushort)
declare function st_read_word(page as integer, offset as integer) as ushort
declare function st_read_page(page as integer) as st_page
\ No newline at end of file
'
' message.bas
'
#include "message.bi"
#include "console.bi"
#include "cpu.bi"
#include "asm.bi"
sub message_init()
console_mutex = mutexcreate()
end sub ' message_init()
sub message_print(output_string as string)
mutexlock console_mutex
print output_string
mutexunlock console_mutex
end sub ' message_print()
\ No newline at end of file
'
' message.bas
'
#include "message.bi"
#include "console.bi"
#include "cpu.bi"
#include "asm.bi"
sub message_init()
console_mutex = mutexcreate()
end sub ' message_init()
sub message_print(output_string as string)
mutexlock console_mutex
print output_string
mutexunlock console_mutex
end sub ' message_print()
sub tool_message(msg_level as ubyte, tool as string, message as string, byval output_location as string = "")
dim msg_prefix as string
msg_prefix = ucase(tool) + ": "
select case msg_level
case MSG_INFO
msg_prefix += "INFO " + message
case MSG_WARN
msg_prefix += "WARNING " + message
case MSG_ERROR
msg_prefix += "ERROR " + message
end select
if len(output_location) > 0 then
dim fnum as integer = freefile()
open output_location for append as #fnum
print #fnum, msg_prefix
close #fnum
else
print msg_prefix
end if
end sub
sub list_heading(tool as string, byval input_file as string)
dim fnum as integer = freefile()
dim listfile as string
listfile = ucase(left(input_file, instrrev(input_file, ".") - 1)) & ".LIS"
open listfile for append as #fnum
print #fnum,""
print #fnum,
print #fnum, "", tool; " LISTING FOR "; ucase(input_file), date()
print #fnum,""
print #fnum," LINE", "OFFSET" , "CODE"
print #fnum, string(72, "-")
close #fnum
end sub
sub listing(line_number as integer, address as string, code_output as string, byval listfile as string)
dim fnum as integer = freefile()
listfile = ucase(left(listfile, instrrev(listfile, ".") - 1)) & ".LIS"
open listfile for append as #fnum
print #fnum, line_number, address, code_output
close #fnum
end sub
sub list_output(msg as string, byval listfile as string)
dim fnum as integer = freefile()
listfile = ucase(left(listfile, instrrev(listfile, ".") - 1)) & ".LIS"
open listfile for append as #fnum
print #fnum, msg
close #fnum
end sub
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment