fixed 6809 asm
This commit is contained in:
parent
520bfbc84d
commit
fcc979f13f
|
@ -278,6 +278,9 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
|
||||||
<div class="emucontrols-williams text-center small control-insns" style="display:none">
|
<div class="emucontrols-williams text-center small control-insns" style="display:none">
|
||||||
<span class="control-def"><span class="control-key">A W S D</span> Move</span>
|
<span class="control-def"><span class="control-key">A W S D</span> Move</span>
|
||||||
<span class="control-def"><span class="control-key">←↑↓→</span> Fire</span>
|
<span class="control-def"><span class="control-key">←↑↓→</span> Fire</span>
|
||||||
|
<span class="control-def"><span class="control-key">\</span> Coin</span>
|
||||||
|
<span class="control-def"><span class="control-key small">Enter</span> Start</span>
|
||||||
|
<span class="control-def"><span class="control-key small">6 7 8 9</span> Extra</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="emucontrols-astrocade text-center small control-insns" style="display:none">
|
<div class="emucontrols-astrocade text-center small control-insns" style="display:none">
|
||||||
<span class="control-def"><span class="control-key">←↑↓→</span> Joystick</span>
|
<span class="control-def"><span class="control-key">←↑↓→</span> Joystick</span>
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
|
||||||
|
palette equ $c000
|
||||||
|
vidmem equ $0
|
||||||
|
wdogx39 equ $cbff
|
||||||
|
|
||||||
|
Start:
|
||||||
|
ldx #0
|
||||||
|
Loop:
|
||||||
|
lda >PALCONST,x
|
||||||
|
sta palette,x
|
||||||
|
leax 1,x
|
||||||
|
cpx #16
|
||||||
|
bne Loop
|
||||||
|
|
||||||
|
ldx #0
|
||||||
|
Loop2:
|
||||||
|
lda #$39
|
||||||
|
sta wdogx39
|
||||||
|
stx ,x
|
||||||
|
leax 1,x
|
||||||
|
cpx #$9800
|
||||||
|
bne Loop2
|
||||||
|
|
||||||
|
jmp Loop ; endless loop
|
||||||
|
|
||||||
|
PALCONST:
|
||||||
|
fcb $1,$2,$4,$8,$10,$20,$40,$80
|
||||||
|
fcb $88,$c0,$e0,$f0,$f8,$fc,$fe,$ff
|
|
@ -104,6 +104,17 @@ var PLATFORM_PARAMS = {
|
||||||
{name:'I/O Registers',start:0x6000,size:0x2000,type:'io'},
|
{name:'I/O Registers',start:0x6000,size:0x2000,type:'io'},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
'williams': {
|
||||||
|
code_start: 0x0,
|
||||||
|
rom_size: 0xc000,
|
||||||
|
data_start: 0x9800,
|
||||||
|
data_size: 0x2800,
|
||||||
|
stack_end: 0xc000,
|
||||||
|
extra_segments:[
|
||||||
|
{name:'Video RAM',start:0x0000,size:0xc000,type:'ram'},
|
||||||
|
{name:'I/O Registers',start:0xc000,size:0x1000,type:'io'},
|
||||||
|
],
|
||||||
|
},
|
||||||
'williams-z80': {
|
'williams-z80': {
|
||||||
code_start: 0x0,
|
code_start: 0x0,
|
||||||
rom_size: 0x9800,
|
rom_size: 0x9800,
|
||||||
|
@ -1908,10 +1919,9 @@ function translateShowdown(step:BuildStep) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// http://datapipe-blackbeltsystems.com/windows/flex/asm09.html
|
||||||
function assembleXASM6809(step:BuildStep) {
|
function assembleXASM6809(step:BuildStep) {
|
||||||
load("xasm6809");
|
load("xasm6809");
|
||||||
var origin = 0; // TODO: configurable
|
|
||||||
var alst = "";
|
var alst = "";
|
||||||
var lasterror = null;
|
var lasterror = null;
|
||||||
var errors = [];
|
var errors = [];
|
||||||
|
@ -1938,21 +1948,37 @@ function assembleXASM6809(step:BuildStep) {
|
||||||
});
|
});
|
||||||
var FS = Module['FS'];
|
var FS = Module['FS'];
|
||||||
//setupFS(FS);
|
//setupFS(FS);
|
||||||
var code = getWorkFileAsString(step.path);
|
populateFiles(step, FS, {
|
||||||
FS.writeFile("main.asm", code);
|
mainFilePath:'main.asm'
|
||||||
Module.callMain(["-c", "-l", "-s", "-y", "-o=main.bin", "main.asm"]);
|
});
|
||||||
|
var binpath = step.prefix + '.bin';
|
||||||
|
var lstpath = step.prefix + '.lst'; // in stdout
|
||||||
|
Module.callMain(["-c", "-l", "-s", "-y", "-o="+binpath, step.path]);
|
||||||
if (errors.length)
|
if (errors.length)
|
||||||
return {errors:errors};
|
return {errors:errors};
|
||||||
var aout = FS.readFile("main.bin", {encoding:'binary'});
|
var aout = FS.readFile(binpath, {encoding:'binary'});
|
||||||
putWorkFile('main.bin', aout);
|
if (aout.length == 0) {
|
||||||
// 00001 0000 [ 2] 1048 asld
|
console.log(alst);
|
||||||
var asmlines = parseListing(alst, /^\s*([0-9A-F]+)\s+([0-9A-F]+)\s+\[([0-9 ]+)\]\s+(\d+) (.*)/i, 1, 2, 4);
|
errors.push({line:0, msg:"Empty output file"});
|
||||||
// TODO
|
return {errors:errors};
|
||||||
|
}
|
||||||
|
putWorkFile(binpath, aout);
|
||||||
|
putWorkFile(lstpath, alst);
|
||||||
|
// TODO: symbol map
|
||||||
|
//mond09 0000
|
||||||
|
var symbolmap = {};
|
||||||
|
//00005 W 0003 [ 8] A6890011 lda >PALETTE,x
|
||||||
|
//00012 0011 0C0203 fcb 12,2,3
|
||||||
|
var asmlines = parseListing(alst, /^\s*([0-9]+) .+ ([0-9A-F]+)\s+\[([0-9 ]+)\]\s+([0-9A-F]+) (.*)/i, 1, 2, 4, 3);
|
||||||
|
var listings = {};
|
||||||
|
listings[step.prefix+'.lst'] = {lines:asmlines, text:alst};
|
||||||
|
var segments = step.params.extra_segments;
|
||||||
return {
|
return {
|
||||||
output:aout,
|
output:aout,
|
||||||
errors:errors,
|
listings:listings,
|
||||||
lines:asmlines,
|
errors:errors,
|
||||||
intermediate:{listing:alst},
|
symbolmap:symbolmap,
|
||||||
|
segments:segments
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -217,11 +217,9 @@ describe('Worker', function() {
|
||||||
it('should NOT preprocess SDCC', function(done) {
|
it('should NOT preprocess SDCC', function(done) {
|
||||||
compile('sdcc', 'int x=0\n#bah\n', 'mw8080bw', done, 0, 0, 1);
|
compile('sdcc', 'int x=0\n#bah\n', 'mw8080bw', done, 0, 0, 1);
|
||||||
});
|
});
|
||||||
/*
|
|
||||||
it('should compile XASM6809', function(done) {
|
it('should compile XASM6809', function(done) {
|
||||||
compile('xasm6809', '\tasld\n\tasld\n', 'williams', done, 4, 2, 0);
|
compile('xasm6809', '\tasld\n\tasld\n', 'williams', done, 4, 2, 0);
|
||||||
});
|
});
|
||||||
*/
|
|
||||||
it('should link two files with SDCC', function(done) {
|
it('should link two files with SDCC', function(done) {
|
||||||
var msgs = [
|
var msgs = [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue