6809 / mc6809 Goto Github PK
View Code? Open in Web Editor NEWImplementation of the MC6809 CPU in Python (Extracted from https://github.com/jedie/DragonPy project)
License: GNU General Public License v3.0
Implementation of the MC6809 CPU in Python (Extracted from https://github.com/jedie/DragonPy project)
License: GNU General Public License v3.0
Hi, I am not sure this qualifies as an issue. I would generally put this in a discussion tab but there does not seem to be one for this repository. Anyway, I am trying to execute the following code on an instance of the class CPUSpeedLimit:
self.cpu.memory.load(0x100, bytearray([
# A = atoi(*(0x1000)) + atoi(*(0x1001)):
0xB6, 0x10, 0x00, # LDA (extended) 0x1000
0x80, 0x30, # SUBA (immediate) 0x30 (48 in base 10)
0xF6, 0x10, 0x01, # LDB (extended) 0x1001
0xC0, 0x30, # SUBB (immediate) 0x30 (48 in base 10)
0xF7, 0x10, 0x02, # STB (extended) 0x1002
0xBB, 0x10, 0x02 # ADDA (extended) 0x1002
]))
self.cpu.program_counter.set(0x100)
self.cpu.run(target_cycles_per_sec=1)
But upon running it, I get the following error:
File "MC6809/MC6809/components/mc6809_base.py", line 787, in instruction_NEG_memory raise RuntimeError("Wrong PC ???") RuntimeError: Wrong PC ???
I am not sure about what causes this error. Again, I apologize if it is the wrong place to ask but I did not really know where to put my message. Thanks in advance.
Steps to reproduce:
Assemble and run the following code:
LDA #$91
ADD #$91
DAA
What happened?
Carry was reset.
When similar code was used for multi-byte decimal addition, it yielded incorrect results.
What was expected?
Carry should be set. DAA keeps the carry flag set if it was set beforehand, see the mc6809 emulator sources for comparison: https://github.com/spc476/mc6809/blob/master/mc6809.c#L420 or the official Programming Manual: https://archive.org/details/bitsavers_motorola68_13419254/page/n83/mode/2up
C โ Set if a carry is generated or if the carry bit was set before the operation; cleared otherwise.
After some research, I noticed that this is a common bug in many 6809 emulators.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.