MZ-700 Monitor Command 'F' and add-on ROM hardware

jejump
Posts: 31
Joined: Tue Jun 04, 2019 9:32 pm

MZ-700 Monitor Command 'F' and add-on ROM hardware

Post by jejump »

 
 
Hello again, from a USA MZ-700 owner! Back at working on my 700 again and hoping to design some hardware that will attach. Please take a look at the screenshot below:

 
 
 


FD_Access.JPG
FD_Access.JPG (69.99 KiB) Viewed 4206 times

This screenshot was taken from this URL(scroll to the extreme bottom of the web page. Easy to locate):

https://www.sharpmz.no/articles/the-mz- ... r-1z-013a/

Circled in yellow, are instructions for what I believe to be launching a user program stored on some type of ROM (or RAM, as it also says) using the 'F' monitor command instead of using this command for an external floppy drive. Q: Is this the best way to do this on the 700? I've been searching for examples of custom built hardware attachments on the internet for the 700 and can't find a lot of talk about it. Could be that I just don't know specific terms to search, so I decided to start this forum post and see if anyone could share the proper way to A), launch a ROM attachment, and B), properly interface it to the system. It seems that interfacing is probably a fairly simple hardware creation (maybe a ROM chip and 'glue' chip or two) but I'd like to avoid time wasted on an incorrectly engineered PCB if I can have guidance from those with experience. I'm a newbie when it comes to SHARP computers. I do have some Z80 assembly language experience in my past though. That screenshot doesn't mention where the user ROM is attached, so I'm assuming it's the 50-pin expansion bus connector as all of the Z80 address, data, and control buses appear to be transparent all the way to that connector. I may also want to add custom ports to this hardware too (MIDI UART specifically) and would like forum input on creating custom port addressing as well. If anyone has schematics that relate to anything I'm asking about and is willing to share their drawings, that would be a huge help! I suppose in short, I'm looking for the "Hello World" example of program ROM (and I/O) interfacing to one of these machines.

Thanks in advance, everyone!
John

One other thing... When I 'D'ump memory starting at address F000h, I have a 160 byte array of '7E' on my screen. If I try to change any of those elements using 'M', it doesn't accept my change and doesn't increment the address counter as it would if I changed memory contents at 1200h. Why is this? :?
hlide
Posts: 681
Joined: Thu Jan 25, 2018 9:31 pm

Re: MZ-700 Monitor Command 'F' and add-on ROM hardware

Post by hlide »

On a stock MZ-700, $E010-$FFFF is not mapped to anything, that's why.
jejump
Posts: 31
Joined: Tue Jun 04, 2019 9:32 pm

Re: MZ-700 Monitor Command 'F' and add-on ROM hardware

Post by jejump »

So, is that 8K of address space where a ROM cartridge might live within since nothing else is present and won't conflict, or is my thinking completely off course? I know there's this fact of memory address banking too. Still trying to wrap my head around what that's all about.
User avatar
Pacman
Posts: 172
Joined: Mon Feb 05, 2018 2:59 pm

Re: MZ-700 Monitor Command 'F' and add-on ROM hardware

Post by Pacman »

I used this command for a long time, which is associated with a 5-inch drive type SFD700 K&P version 2: It allows you to boot on the MASTER disk. This reader has a ROM starting at the address $F000 whose disassembly can be found here: viewtopic.php?f=6&t=184
jejump
Posts: 31
Joined: Tue Jun 04, 2019 9:32 pm

Re: MZ-700 Monitor Command 'F' and add-on ROM hardware

Post by jejump »

Awesome! I've passed over other literature regarding that reader. Haven't looked that deeply into it, but I for sure will now. At the moment, I'm familiarizing myself with the various assemblers and symbolic debuggers that are available. Currently exploring these on an emulator. Right now, my attention is all absorbed by Avalon ZEN. Just discovered that one today. The manual is a quick read, and I just assembled the example program without error. So proud of myself! :D If anyone has suggestions for a good assembler/debugger they'd recommend, I'm open to hearing about it. Any programming tools I should know about, for that matter.

Thanks,
John
jejump
Posts: 31
Joined: Tue Jun 04, 2019 9:32 pm

Re: MZ-700 Monitor Command 'F' and add-on ROM hardware

Post by jejump »

I've been trying to follow along with all that this has to say:

https://www.sharpmz.no/articles/the-mz- ... ap/#banksw

I think I understand now that when the 700 boots at power up, as hlide stated:
by hlide » Mon Jun 07, 2021 11:34 am

On a stock MZ-700, $E010-$FFFF is not mapped to anything, that's why.
I had asked why I couldn't see a change in memory and incremented address counter using monitor command 'M' at address $F000. However, IF I could instead, switch banks and allocate that area to DRAM in an assembled program using "OUT $E1, A", WOULD I then see a change in value at that address? Correct me if I'm wrong but, I believe I probably wouldn't see a live change in a debugger environment just by running that one OUT instruction. V-RAM also switches for that whole area of interest, so I suppose I would lose the ability to see what I'm doing on screen (and probably lose program control too) at that point UNLESS a hardware interrupt causes code to run that switches banks to service video, keyboard, etc.. If that were true, the ISR would have to end and return leaving the memory bank select in the state it found it and I'm not seeing a good way for it to keep track of that. According to the article, the A register is not the importance of that OUT instruction. It's what's placed on the address lines ($E1) at the time of the OUT instruction that matters. The A register has to be included to satisfy the assembled line, but its contents is disregarded (right?). Therefore, how can you read the current memory bank selection in an interrupt if you wanted that interrupt to change bank, make modifications (or whatever), then return it back to the state it was in? That one is still a little confusing. Seems like you would want an interrupt to handle chores like that at times.

Is this all true? Am I following along and understanding that correctly?
hlide
Posts: 681
Joined: Thu Jan 25, 2018 9:31 pm

Re: MZ-700 Monitor Command 'F' and add-on ROM hardware

Post by hlide »

Yep, doing a OUT ($E1),A would prevent from you viewing the M command to operate.

I'm not sure why it doesn't increase. Does it mean the M command check whether your writing is effective? I wouldn't expect it but that seems the only explanation I can see for the moment.
hlide
Posts: 681
Joined: Thu Jan 25, 2018 9:31 pm

Re: MZ-700 Monitor Command 'F' and add-on ROM hardware

Post by hlide »

When accessing $E0-$E7, only address bus is considered, data address is dummy.
hlide
Posts: 681
Joined: Thu Jan 25, 2018 9:31 pm

Re: MZ-700 Monitor Command 'F' and add-on ROM hardware

Post by hlide »

Interrupt is only for AM/PM toggling. In my game, I simply disable interrupt forever, so I can enable the first DRAM area and fill it with whatever I want. You could also enable the third area as DRAM ($E000-$FFFF) because the moment you need to access VRAM or I/O are deterministic: you simply disable that area when you need to access those special range then re-enable that DRAM area. BUT you must avoid to place their code or their data in that area for obvious reason.
jejump
Posts: 31
Joined: Tue Jun 04, 2019 9:32 pm

Re: MZ-700 Monitor Command 'F' and add-on ROM hardware

Post by jejump »

Thanks, hlide for that enlightenment! Would you happen to know... If I were to invoke a hardware interrupt on the system bus connector (/INT signal, I believe), where in memory would that start code execution to service that interrupt? According to the Z80 datasheet, there are modes that the processor can be configured for that would allow for different interrupt address scheming. I seem to remember reading somewhere (maybe in the monitor listing) that at least one interrupt jumps to 0038H and starts executing. The Z80 datasheet calls this Mode 1. In Mode 2 though, the connected device can place the low order 8 bits of a word on the address bus after an ACK of the INT signal and that will determine where the jump-to will occur. Is the MZ-700 flexible enough to use either mode, or does it expect mode 1 only?

Thahks,
John

EDIT: I just realized the /INT signal I referenced is actually called EXINT and ACK signal doesn't seem to be included in the system bus expansion pins.
Post Reply