Enterprise Forever

:UK => Programming => Topic started by: Saint on 2013.November.12. 23:47:04

Title: Enterprise Programming
Post by: Saint on 2013.November.12. 23:47:04
I've been thinking about programming on the Enterprise, and one thing that is quite alien to me is the memory paging and limited 64k address space, as I learnt assembly on the Atari ST and 68000 processor.

Are there any particular requirements to have specific pages setup in memory while making EXOS calls, or anything like that? Or on a 128k machine (or more!) am I free to setup the 64k address space with entirely new RAM segments and just page in one of the onboard RAM segments to update the video when needed?
Title: Re: Enterprise Programming
Post by: Zozosoft on 2013.November.13. 00:06:36
For use EXOS calls and IRQ system needed the Page0 segment in the Z80 page 0. The machine code program loaded to this segment from 100h. (With carefuly programming you can page out this segment.)
Title: Re: Enterprise Programming
Post by: Zozosoft on 2013.November.13. 00:15:51
About 1 years ago I uploaded for you a sample.asm (http://enterpriseforever.com/other-topics/xenon-2-on-enterprise/msg28248/#msg28248) for the begining.
Title: Re: Enterprise Programming
Post by: Z80System on 2013.November.13. 11:00:57
In other words (what Zozo already said), when you want to call EXOS, or leaving EXOS interrupts working, you have to leave the Page0 (0xB0) segment alone. On that page there will be usually the 0xF8 segment (on a 128K machine), or I think 0xFC segment (on a 64K) machine. (Or any other working RAM segment detected by EXOS with the smallest segment number).

The other pages can be populated by wish. EXOS will save and restore those pages at an EXOS call. This will happen with almost all the registers, too.

"Parameters are passed to EXOS calls in registers A, BC and DE, and results are passed back in the same registers. Register A returns a status code which is zero if the call was successful and a nonĀ­zero error code otherwise. All other registers (HL, IX, IY, AF', BC', DE', HL') are preserved by all EXOS calls, and also the user's paging is not disturbed. EXOS calls can be made from any address in any Z80 page, and user's stack can be in any of the four pages."

http://gafz.enterpriseforever.com/Dokumentacio/Konyvek/EXOS_2.1_technikal_information/exos/kernel/Ch11.html (http://gafz.enterpriseforever.com/Dokumentacio/Konyvek/EXOS_2.1_technikal_information/exos/kernel/Ch11.html)
Title: Re: Enterprise Programming
Post by: Z80System on 2013.November.13. 11:04:39
When you want to make EXOS calls, and want to cooperate with EXOS and you want more memory than the 0x4000-0x100 available for you on the Page0 segment, then you have to get more free segment form EXOS, of course. So you can place those to any page (P1,P2,P3), but first you have to ask EXOS wich are free to use.
Title: Re: Enterprise Programming
Post by: Zozosoft on 2013.November.13. 11:15:56
From 0000-002Fh and 005C-00FFh also can be used under EXOS (http://gafz.enterpriseforever.com/Dokumentacio/Konyvek/EXOS_2.1_technikal_information/exos/kernel/Ch4.html). Many programs place SP to 100h (using stack under 0100h).
Title: Re: Enterprise Programming
Post by: Z80System on 2013.November.13. 11:18:33
Quote
Many programs place SP to 100h (using stack under 0100h).
Hmmm ... good idea! This will be good for me, too.
Title: Re: Enterprise Programming
Post by: Saint on 2013.November.13. 11:27:21
Quote from: Zozosoft
About 1 years ago I uploaded for you a sample.asm (http://enterpriseforever.com/other-topics/xenon-2-on-enterprise/msg28248/#msg28248) for the begining.
Yes, I was reading this last night. :ds_icon_cheesygrin:

Thank-you everyone for the information, that's very helpful!