Writing to FE05 in Elkulator

want to talk about MESS/model b/beebem/b-em/electrem/elkulator? do it here!
User avatar
davidb
Posts: 1831
Joined: Sun Nov 11, 2007 10:11 pm
Contact:

Writing to FE05 in Elkulator

Postby davidb » Mon Jun 19, 2017 5:48 pm

I'm just testing some of my code that does things with the Electron's ULA in Elkulator and I've encountered something strange.

I had previously noticed that some code would fail if it was running from bank 13 (ROM cartridge bank 2) but work fine in bank 12 (ROM bank 1). I was stepping through it using the -debug option and discovered that when I write to FE05, the machine triggers a BRK instruction. The code at this point looks like this:

Code: Select all

    81B5 : LDA #10
    81B7 : STA FE05
    81BA : LDA #04
    81BC : BIT FE00

The debug session looks like this:

Code: Select all

81B5 : LDA #10       >s
81B7 : STA FE05      >s
BRK 81BA! 81BA 0000
BRK at 81BA
81BA : BRK           >c

So it looks like something causes the write to page out the ROM after the STA instruction. Is this normal? I'm now trying to remember if using different banks is a problem on the actual hardware.

If someone wants to try it, I've attached a ROM image in an archive.
Attachments
vscroll1-2017-06-19.zip
(16.14 KiB) Downloaded 5 times

dp11
Posts: 672
Joined: Sun Aug 12, 2012 8:47 pm

Re: Writing to FE05 in Elkulator

Postby dp11 » Mon Jun 19, 2017 6:10 pm

If you are running code from one ROM bank . Then change the ROM bank to a bank which doesn't have code at the next instruction then I would expect this to occur and unless i've missed something.

User avatar
davidb
Posts: 1831
Joined: Sun Nov 11, 2007 10:11 pm
Contact:

Re: Writing to FE05 in Elkulator

Postby davidb » Mon Jun 19, 2017 6:16 pm

dp11 wrote:If you are running code from one ROM bank . Then change the ROM bank to a bank which doesn't have code at the next instruction then I would expect this to occur and unless i've missed something.

You're quite right. I keep forgetting that FE05 is used for paging as well. #-o :roll:
Thanks. :)


Return to “emulators”

Who is online

Users browsing this forum: No registered users and 1 guest