6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 21, 2024 4:30 pm

All times are UTC




Post new topic Reply to topic  [ 413 posts ]  Go to page Previous  1 ... 22, 23, 24, 25, 26, 27, 28  Next
Author Message
PostPosted: Sun Jul 07, 2024 7:07 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8504
Location: Midwestern USA
I did a little messing around with the new simulator version.  It seems to be able to execute the initial set of instructions in my partition editor program, but, no surprise, couldn’t proceed when it encountered a COP instruction, COP being how the BIOS API is accessed.

The disassembly window seems to get confused with immediate mode instructions that have a 16-bit operand.  The mnemonic-operand disassembly was correct, but the bytes being displayed to the left of the mnemonic come out as opcode and the LSB of the operand, followed by another line with a new address and the MSB of the operand.  Dunno if you’ve gotten that far with it.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 07, 2024 4:15 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
Was there a problem with the COP instruction or is it you didn't have the handler loaded? BRK and COP should simulate correctly. BRK does have the option to include a signature byte following from the options menu.

As far as the disassembler goes, yes, I am aware of the confusion with 16 bit immediate values. The disassembler was written to disassemble a single line from an address pointer input. It knows nothing about what the simulator is doing or what mode it is in. The immediate value is stored in a 16 bit variable so sometimes you will see a 16 bit value to the right of the mnemonic and other times its only 8 bits. The operand byte field to the left of the mnemonic will always be 1 byte as you observed.

The simulator will pass the correct address for the next instruction, so it resyncs itself and continues correctly.

I've also observed some confusion with the yellow step pointer getting lost with JML/JSL/RTL jumps to other banks but it resyncs after one instruction. I have to track that down as well.

I will try on some future release to get the immediate modes corrected but it was not in my original release plans.

Thanks for looking!!

Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 07, 2024 7:38 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8504
Location: Midwestern USA
8BIT wrote:
Was there a problem with the COP instruction or is it you didn't have the handler loaded? BRK and COP should simulate correctly. BRK does have the option to include a signature byte following from the options menu.

In my POC unit, COP is “intercepted” by by the BIOS API, which is part of the firmware.  Are you saying that if the firmware was loaded into high, bank $00 RAM, the simulation would be able to execute it, other than things that touch the actual hardware?

Quote:
As far as the disassembler goes, yes, I am aware of the confusion with 16 bit immediate values...

Not a worry.  If I need to see the bytes that were generated for a given instruction, I can always look at the listing file, which does correctly display the MSB of an immediate-mode operand.

Given the nature of the 65C816 in native mode, simulating it is a challenging exercise.  That you’ve gotten the Kowalski simulator as far as you have says a lot about your patience and programming skill.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 07, 2024 7:55 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
BigDumbDinosaur wrote:
In my POC unit, COP is “intercepted” by by the BIOS API, which is part of the firmware.  Are you saying that if the firmware was loaded into high, bank $00 RAM, the simulation would be able to execute it, other than things that touch the actual hardware?


Yes, if the vectors are loaded @ $FFE0..$FFFF and the handlers are installed at the right addresses, then BRK, COP, INT, NMI, and RST all function as they would in hardware. This includes emulation mode and native mode behaviors as I understand them.

Give them a test!

thanks!
Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 09, 2024 1:21 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
Another setback with my test suite. I was able to rewrite it to use banks 0-7 vs 0-7F and was able to make a bootloader that would load the suite from $008000 - $04FFFF on my SBC-4. It started to run but had several test failures. Then I saw why. Many tests are testing stack wrapping vs non-wrapping modes. In some tests, data is stored and read on page $02xx. That happens to be where my SBC-4 has its IO page. So writes were not being read back correctly. I could move the stack for native mode but there are a few tests that runs in emulation mode that read or write to $200. These would fail.

I may dig out my Zilinx CPLD programmer and remap my IO to another page and modify the bootloader accordingly. I'm not sure when that will happen.

I'm going to go ahead package up the test suite and post it here, in case others would like to give it a try. It only needs a chr output and chr input (waiting for input) routine and lots of RAM to work.

Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 11, 2024 2:56 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
I have uploaded an update correcting most of the items found so far. The only outstanding issue is the disassembler & 16 bit immediate issue.

Source code is also available for this version (1.4.0.1). https://sbc.rictor.org/kowalski.html

Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 11, 2024 7:51 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8504
Location: Midwestern USA
8BIT wrote:
I have uploaded an update correcting most of the items found so far. The only outstanding issue is the disassembler & 16 bit immediate issue.

Source code is also available for this version (1.4.0.1). https://sbc.rictor.org/kowalski.html

Daryl

I’ll play around with it in the next few days.  Another busy music weekend coming up.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 18, 2024 4:41 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
I have uploaded an update correcting the 65816 instruction timing. Executable and source files are on my website.

https://sbc.rictor.org/kowalski.html

This will be my last feature update for the Kowalski Simulator. I feel it has been uplifted to a point where it is capable of supporting development on the 6502, 65c02, and 65816.

I will continue to support bug fixes of course, but do not plan to add anything more as far as capabilities or features.

Enjoy!

Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 18, 2024 4:51 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8504
Location: Midwestern USA
8BIT wrote:
This will be my last feature update for the Kowalski Simulator. I feel it has been uplifted to a point where it is capable of supporting development on the 6502, 65c02, and 65816.

Your improvements have resulted in a superior (in my opinion) development package.  I’ve already used the 816 simulation to model some software algorithms, as well as ferret out an obscure bug I would periodically run into with one of my programs.  Time for you to retire and collect your pension.  8)

Now, if only we could track down that search-and-replace bug in the editor that periodically derails the train and trashes work in progress...  :D  I got bit by it again last night, but fortunately had save the source file before the editor went into la-la land.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 18, 2024 5:21 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
BigDumbDinosaur wrote:
Now, if only we could track down that search-and-replace bug in the editor that periodically derails the train and trashes work in progress...  :D  I got bit by it again last night, but fortunately had save the source file before the editor went into la-la land.


I know. As stated previously "Find Pattern match and Find & Replace crashes - these are Microsoft AFX functions that I do not want to dig into, so most likely will not get addressed anytime soon."

I don't have enough time or ambition to try to figure that framework out. Maybe Yuri's updates will be able to resolve it.

Kindly,

Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 18, 2024 3:36 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8504
Location: Midwestern USA
8BIT wrote:
BigDumbDinosaur wrote:
Now, if only we could track down that search-and-replace bug in the editor that periodically derails the train and trashes work in progress...  :D  I got bit by it again last night, but fortunately had save the source file before the editor went into la-la land.

I know. As stated previously "Find Pattern match and Find & Replace crashes - these are Microsoft AFX functions that I do not want to dig into, so most likely will not get addressed anytime soon."

Leave it to Microsoft to make things difficult.  :D

Quote:
I don't have enough time or ambition to try to figure that framework out. Maybe Yuri's updates will be able to resolve it.

Not to worry.  I’m developing the habit of saving all open files before doing an S&R operation. It is an intermittent problem with no obvious pattern.  So I just assume it will happen.  As I think I mentioned some time ago, I suspect the undo stack is involved.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 20, 2024 7:58 pm 
Offline
User avatar

Joined: Tue Feb 28, 2023 11:39 pm
Posts: 257
Location: Texas
8BIT wrote:
BigDumbDinosaur wrote:
Now, if only we could track down that search-and-replace bug in the editor that periodically derails the train and trashes work in progress...  :D  I got bit by it again last night, but fortunately had save the source file before the editor went into la-la land.


I know. As stated previously "Find Pattern match and Find & Replace crashes - these are Microsoft AFX functions that I do not want to dig into, so most likely will not get addressed anytime soon."

I don't have enough time or ambition to try to figure that framework out. Maybe Yuri's updates will be able to resolve it.

Kindly,

Daryl



Probably will, considering that I'm effectively having to rewrite the GUI portions of the code. I'll get these new versions up on the git hub as soon as I am able. (I've been out of pocket for a while while my apartment complex remediates my unit for mold)


That being said, I can probably track down the AFX issue if you can get me a core dump or know how to reliably recreate the crash. It is also possible that it got fixed with a newer MFC version, which is what I've been compiling with when I ported the project over to be usable in Visual Studio 2022.


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 20, 2024 8:19 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8504
Location: Midwestern USA
Yuri wrote:
...I can probably track down the AFX issue if you can get me a core dump...

Dunno how I'd be able to get a core dump of a Windows application that is still running.  When the error occurs, the editor is running, but is stuck in a loop of some sort.  In order to regain control, it is necessary to kill the simulator from within the task manager, which, naturally, trashes any work in progress.

Quote:
...or know how to reliably recreate the crash.

As I’ve said before, I’ve yet to discern a pattern to the error.  All I know is it appears when trying to close the S&R dialog box after an S&R session has resulted in a change to the loaded source file.  It seems the error is more likely to occur after an extended editing session, which is why I think it’s tied somehow to the undo function—the undo stack will, of course, continuously grow as code is added to the source file being edited.  An S&R session that changes a lot of lines will rapidly expand the undo stack, which could be where the error originates.

Another possibility might be an obscure memory leak.  I’m not a Windows programmer, so I don’t know enough about that environment to offer any useful guidance.


Quote:
It is also possible that it got fixed with a newer MFC version, which is what I've been compiling with when I ported the project over to be usable in Visual Studio 2022.

I do my Kowalski work on Windows XP SP3, for what it’s worth.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 21, 2024 5:30 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
I just remembered there was another minor change in V1.4.0.2. MVN and MVP now function more like the hardware in that they execute one copy in 7 cycles and don't increment the program counter until the A register equals $FFFF (creating a do until loop). That way, interrupts will happen in between the 7 cycle steps. Previously, the whole copy would have happened before an interrupt would have been recognized.

Happy coding.

Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 23, 2024 3:47 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
Question for the group:

Assembling a 65816 file... should LDA #300 cause an error (parameter won't fit in a byte) or should I let it go and have it assemble 3 bytes (A9 2C 01). The intended way is to use LDA !#300, which forces a 2 byte operand. Having no error can lead to logic errors the programmer may miss.

thanks!
Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 413 posts ]  Go to page Previous  1 ... 22, 23, 24, 25, 26, 27, 28  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: