armasm: fixed offsets; updated docs urls for help

This commit is contained in:
Steven Hugg 2021-06-18 09:08:25 -05:00
parent e7dc2ce750
commit a2ee3bf964
8 changed files with 28 additions and 15 deletions

View File

@ -60,7 +60,7 @@ var lastBreakExpr = "c.PC == 0x6000";
// TODO: codemirror multiplex support?
// TODO: move to views.ts?
var TOOL_TO_SOURCE_STYLE = {
const TOOL_TO_SOURCE_STYLE = {
'dasm': '6502',
'acme': '6502',
'cc65': 'text/x-csrc',
@ -88,6 +88,15 @@ var TOOL_TO_SOURCE_STYLE = {
'armips': 'vasm'
}
const TOOL_TO_HELPURL = {
'dasm': 'https://github.com/dasm-assembler/dasm/blob/master/docs/dasm.pdf',
'cc65': 'https://cc65.github.io/doc/cc65.html',
'ca65': 'https://cc65.github.io/doc/ca65.html',
'sdcc': 'http://sdcc.sourceforge.net/doc/sdccman.pdf',
'verilator': 'https://www.veripool.org/ftp/verilator_doc.pdf',
'fastbasic': 'https://github.com/dmsc/fastbasic/blob/master/manual.md'
}
function gaEvent(category:string, action:string, label?:string, value?:string) {
if (window['ga']) ga('send', 'event', category, action, label, value);
}

View File

@ -1,7 +1,7 @@
import { ARM32CPU, ARMCoreState } from "../common/cpu/ARM";
import { BasicScanlineMachine, HasSerialIO, SerialEvent, SerialIOInterface } from "../common/devices";
import { newAddressDecoder, Keys, makeKeycodeMap, newKeyboardHandler } from "../common/emu";
import { newAddressDecoder, Keys, makeKeycodeMap, newKeyboardHandler, EmuHalt } from "../common/emu";
import { Debuggable, EmuState } from "../common/baseplatform";
import { hex, lpad } from "../common/util";
@ -81,6 +81,9 @@ export class ARM32Machine extends BasicScanlineMachine implements Debuggable, Ha
[IO_START, IO_START+IO_SIZE-1, IO_SIZE-1, (a, v) => {
return this.readIO(a);
}],
[0, (1<<31)-1, 0, (a, v) => {
throw new EmuHalt(`Address read out of bounds: 0x${hex(a)}`);
}]
]);
write = newAddressDecoder([
@ -142,7 +145,7 @@ export class ARM32Machine extends BasicScanlineMachine implements Debuggable, Ha
}
getDebugCategories() {
return ['CPU'];
return ['CPU', 'Stack'];
}
getDebugInfo?(category: string, state: EmuState) : string {

View File

@ -40,7 +40,7 @@ class BallyAstrocadePlatform extends BaseZ80MachinePlatform<BallyAstrocade> impl
{name:'BIOS Variables',start:0x4fce,size:0x5000-0x4fce,type:'ram'},
] } };
showHelp(tool:string, ident:string) {
window.open("https://8bitworkshop.com/blog/platforms/astrocade/", "_help"); // TODO
window.open("https://8bitworkshop.com/docs/platforms/astrocade/", "_help"); // TODO
}
}

View File

@ -211,7 +211,7 @@ class BASICPlatform implements Platform {
if (o != null) return `${sym} = ${o}`;
}
showHelp(tool:string, ident:string) {
window.open("https://8bitworkshop.com/blog/platforms/basic/#basicreference", "_help");
window.open("https://8bitworkshop.com/docs/platforms/basic/#basicreference", "_help");
}
getDebugCategories() {

View File

@ -33,7 +33,7 @@ class ColecoVisionPlatform extends BaseZ80MachinePlatform<ColecoVision> implemen
{name:'Cartridge Header',start:0x8000,size:0x100,type:'rom'},
] } };
showHelp(tool:string, ident:string) {
window.open("https://8bitworkshop.com/blog/platforms/coleco/", "_help");
window.open("https://8bitworkshop.com/docs/platforms/coleco/", "_help");
}
}

View File

@ -483,7 +483,7 @@ class JSNESPlatform extends Base6502Platform implements Platform, Probeable {
] } };
showHelp(tool:string, ident:string) {
window.open("https://8bitworkshop.com/blog/platforms/nes/", "_help"); // TODO
window.open("https://8bitworkshop.com/docs/platforms/nes/", "_help"); // TODO
}
}

View File

@ -342,7 +342,7 @@ class VCSPlatform extends BasePlatform {
else if (tool == 'wiz')
window.open("https://github.com/wiz-lang/wiz/blob/master/readme.md#wiz", "_help");
else
window.open("https://8bitworkshop.com/blog/platforms/vcs/", "_help"); // TODO
window.open("https://8bitworkshop.com/docs/platforms/vcs/", "_help"); // TODO
}
getMemoryMap = function() { return {main:[

View File

@ -2935,20 +2935,21 @@ function assembleARMIPS(step:BuildStep) {
var lst = listings[path2];
if (lst == null) { lst = listings[path2] = {lines:[]}; }
var ofs = parseInt(m[1], 16);
var insn = objout.slice(ofs, ofs+4);
if (lastofs == ofs) {
lst.lines.pop(); // get rid of duplicate offset
} else if (lastofs+2 == ofs) {
var lastline = lst.lines[lst.lines.length-1]; // convert 4-byte to 2-byte insn
if (lastline && lastline.insns) lastline.insns = lastline.insns.substring(4,8);
} else if (ofs > lastofs) {
var lastline = lst.lines[lst.lines.length-1];
if (lastline && !lastline.insns) {
var insns = objout.slice(lastofs, ofs).reverse();
lastline.insns = Array.from(insns).map((b) => hex(b,2)).join('');
}
}
lastofs = ofs;
lst.lines.push({
path: path,
line: parseInt(m[4]),
offset: ofs,
insns: hex(insn[3]) + hex(insn[2]) + hex(insn[1]) + hex(insn[0])
offset: ofs
});
lastofs = ofs;
}
}
//listings[lstpath] = {lines:lstlines, text:lstout};