Welcome, Guest. Please login or register.


Author Topic: Enterprise Programming (Read 4505 times)

Offline Saint

  • EP user
  • *
  • Posts: 266
  • Country: gb
Enterprise Programming
« 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?

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14777
  • Country: hu
    • http://enterprise.iko.hu/
Re: Enterprise Programming
« Reply #1 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.)

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14777
  • Country: hu
    • http://enterprise.iko.hu/
Re: Enterprise Programming
« Reply #2 on: 2013.November.13. 00:15:51 »
About 1 years ago I uploaded for you a sample.asm for the begining.

Offline Z80System

  • EP addict
  • *
  • Posts: 3848
  • Country: hu
Re: Enterprise Programming
« Reply #3 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
« Last Edit: 2013.November.13. 11:05:56 by Z80System »
Z80 System

Offline Z80System

  • EP addict
  • *
  • Posts: 3848
  • Country: hu
Re: Enterprise Programming
« Reply #4 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.
Z80 System

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14777
  • Country: hu
    • http://enterprise.iko.hu/
Re: Enterprise Programming
« Reply #5 on: 2013.November.13. 11:15:56 »
From 0000-002Fh and 005C-00FFh also can be used under EXOS. Many programs place SP to 100h (using stack under 0100h).

Offline Z80System

  • EP addict
  • *
  • Posts: 3848
  • Country: hu
Re: Enterprise Programming
« Reply #6 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.
Z80 System

Offline Saint

  • EP user
  • *
  • Posts: 266
  • Country: gb
Re: Enterprise Programming
« Reply #7 on: 2013.November.13. 11:27:21 »
Quote from: Zozosoft
About 1 years ago I uploaded for you a sample.asm for the begining.
Yes, I was reading this last night. :ds_icon_cheesygrin:

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