apple2-go/cmd/disasm.go

32 lines
519 B
Go
Raw Normal View History

2018-05-10 12:32:42 +00:00
package main
import (
"flag"
"mos6502go/cpu"
"mos6502go/mmu"
"mos6502go/utils"
)
func main() {
startString := flag.String("start", "", "Start address")
endString := flag.String("end", "", "End address")
flag.Parse()
2018-05-19 10:42:14 +00:00
start := utils.DecodeCmdLineAddress(startString)
end := utils.DecodeCmdLineAddress(endString)
2018-05-10 12:32:42 +00:00
2018-05-19 10:42:14 +00:00
if start == nil {
2018-05-10 12:32:42 +00:00
panic("Must include -start")
}
2018-05-19 10:42:14 +00:00
if end == nil {
2018-05-10 12:32:42 +00:00
e := uint16(0xffff)
2018-05-19 10:42:14 +00:00
end = &e
2018-05-10 12:32:42 +00:00
}
cpu.InitInstructionDecoder()
mmu.InitApple2eROM()
2018-05-19 10:42:14 +00:00
utils.Disassemble(*start, *end)
2018-05-10 12:32:42 +00:00
}