1
0
mirror of https://github.com/irmen/ksim65.git synced 2024-11-15 09:05:52 +00:00

fix 'a' command

This commit is contained in:
Irmen de Jong 2020-02-19 01:13:18 +01:00
parent be8716c4a4
commit 99d8f5cd97
2 changed files with 2 additions and 2 deletions

View File

@ -49,7 +49,6 @@ class Assembler(cpu: Cpu6502, val memory: MemMappedComponent, initialStartAddres
fun assemble(lines: Iterable<String>): Result {
for(line in lines) {
val result = assemble(line)
println("line: $line -> ${result.success} ${result.error}") // TODO
if(!result.success)
return result
assembledSize += result.numBytes

View File

@ -83,7 +83,8 @@ class Monitor(val bus: Bus, val cpu: Cpu6502) {
IVirtualMachine.MonitorCmdResult("", "", true)
}
'a' -> {
val address = 0 // TODO parse from line
val parts = command.substring(1).trim().split(' ')
val address = if(parts.size>=2) Assembler.parseNumber(parts[0]) else 0
val assembler = Assembler(cpu, bus.memoryComponentFor(address), address)
val result = assembler.assemble(command.substring(1).trimStart())
if(result.success) {