Welcome, Guest. Please login or register.


Author Topic: Programming and use of full memory (Read 3665 times)

Offline nicalejo

  • Newbie
  • Posts: 12
Programming and use of full memory
« on: 2023.December.12. 17:32:47 »
Hi, I've been doing some test programming the ep128. I realized it is expandable til 3.5 mb, what is a craziness.

I did programming under IS-DOS and Turbo Pascal, wonderful tool, with the integrated editor, but I suspect the memory is limited to 64 kb due the nature of CP/m. ¿Am I right?
I also wrote the same under IS-BASIC. I am pretty sure under basic the whole memory is ready for programs but is slow as hell and we don't have an editor (copy, cut, paste).
I tried the same with Hisoft Pascal but ... I gave up. It has no integrated editor, the editing capabilities are limited and it is confusing to me how to work with several files. Maybe with an external editor, if exists, launched from HSP. Too much fight compared to Turbo Pascal.

So finally ¿are these the only options to develop with high level programming in the EP? ¿Cross compiling? I've read other posts in the forum but I don't know how up to date they are.


Online szipucsu

  • Global Moderator
  • EP addict
  • *
  • Posts: 9951
  • Country: hu
    • Támogató Támogató
    • Webnyelv.hu - Tanuljunk nyelveket!
Re: Programming and use of full memory
« Reply #1 on: 2023.December.12. 19:21:31 »
Welcome to the forum!

You can create your IS-BASIC program using a PC and a .txt editor (Notepad). The .txt file can be loaded to the basic using LOAD command. Do not forget to press enter at the end of the last line, otherwise the last line won't be sent to the basic.

I don't know if Pascal and other platforms can interprete the .txt files but you can give them a try.
100 SOUND SOURCE 2,STYLE 128,PITCH 25.2,SYNC 1
110 SOUND PITCH 25,SYNC 1
120 ! Videos

Offline ergoGnomik

  • EP addict
  • *
  • Posts: 1299
  • Country: hu
  • Stray cat from Commodore alley
Re: Programming and use of full memory
« Reply #2 on: 2023.December.12. 19:58:40 »
Obviously, any integrated development environment running on the target platform will make it harder using all resources of the platform since it has to use some of it itself. Therefore, cross development tools are better choice from this perspective. And we didn't even mention the better compiler performance on modern hardware and ease of use of emulators in testing. AFAIK, z88dk development suite has support for these machines. Maybe TRSE can also be used, although it has no Enterprise support. (Yet, but I can imagine its developers could be convinced to do something about that.) Still, it can be used for Z80 based computers like ZX Spectrum, CPC and TVC, so maybe you could trick it into working for Enterprise too.

Offline nicalejo

  • Newbie
  • Posts: 12
Re: Programming and use of full memory
« Reply #3 on: 2023.December.12. 20:08:39 »
Both options would be a dream for developing with comfort. I'll try to check how mature is z88dk with EP as target.

Thanks

Offline nicalejo

  • Newbie
  • Posts: 12
Re: Programming and use of full memory
« Reply #4 on: 2023.December.13. 13:02:51 »
I managed to install EP128 emulator and Z88dk in my Mac. I was able to compile and later execute the results successfully in the emulator. Text based C programs, seem to work without problems.

Anything related to the EP HW needs to be achieved through the exos calls, all through the enterprise.h file.

Would be great that someone with the skills build a high level API in C to program using the hw capabilities.

[ Guests cannot view attachments ]

Offline nicalejo

  • Newbie
  • Posts: 12
Re: Programming and use of full memory
« Reply #5 on: 2023.December.19. 10:14:55 »
Finally the subject of the thread did not reach what I wanted to know. Aside of the basic that can handle the full memory transparently to the programmer, is there another programming language able to do that? If I use hisoft pascal, ie, do I have the full memory for my programs or I have to deal with segments as other z80 machines?

I apologize because I've read about exos calls to allocate segments but I don't know if a compiler as Hisoft builds executables with these capabilities.

Thx

Offline gflorez

  • EP addict
  • *
  • Posts: 3610
  • Country: es
    • Támogató Támogató
Re: Programming and use of full memory
« Reply #6 on: 2023.December.19. 15:53:09 »
I think that the real magic of the Enterprise is EXOS. It is already managing the complete 4MB range of RAM/ROM, and very well, I think, because it behaves the same with 64KB than with 3MB of Ram.

You should be benevolent with classic programs, when it was hard and expensive to expand the machine memory. The HEASS assembler takes all the available memory, but it was made on the 90s.

Offline Povi

  • EP addict
  • *
  • Posts: 2300
  • Country: hu
    • http://povi.fw.hu
Re: Programming and use of full memory
« Reply #7 on: 2023.December.19. 16:35:36 »
If I use hisoft pascal, ie, do I have the full memory for my programs or I have to deal with segments as other z80 machines?
Unfortunatelly the hisoft pascal uses only 64kB RAM, where the lower part of memory is used by the compiler and stores the source code. Even if you open a graphic video channel, and you want to write the video ram directly (not via exos escape sequencees), you have to page it to the 3rd page, and set the compilers upper limit to 0xbfff.
*** Speicherplatz zu klein

Offline nicalejo

  • Newbie
  • Posts: 12
Re: Programming and use of full memory
« Reply #8 on: 2023.December.19. 18:19:51 »
We need some kind of cross compiler that produces code taking profit de exos. Difficult task, would be great the people of Turbo Rascal put the hands on it

Offline ergoGnomik

  • EP addict
  • *
  • Posts: 1299
  • Country: hu
  • Stray cat from Commodore alley
Re: Programming and use of full memory
« Reply #9 on: 2023.December.19. 21:40:48 »
We need some kind of cross compiler that produces code taking profit de exos. Difficult task, would be great the people of Turbo Rascal put the hands on it
Or maybe you could try ask Povi if he's willing to help. He did some work on HiSoft Pascal. Version 1.2 is his achievement, AFAIK. The TRSE project repository is on github and the units folder hides some invaluable gems like CPC, MSX, Spectrum and TVC unit sources.

Offline Tuby128

  • EP addict
  • *
  • Posts: 1449
  • Country: hu
Re: Programming and use of full memory
« Reply #10 on: 2023.December.19. 23:18:17 »
Nicaleajo, do you have windows?

Offline ergoGnomik

  • EP addict
  • *
  • Posts: 1299
  • Country: hu
  • Stray cat from Commodore alley
Re: Programming and use of full memory
« Reply #11 on: 2023.December.20. 06:29:51 »
Nicaleajo, do you have windows?
Szerinted?
What do you think?
I managed to install EP128 emulator and Z88dk in my Mac.
És azt már merő rosszindulatnak érzem megemlíteni (elnézésedet is kérem érte), hogy a hozzászólása mellett az adattáblájában is ott virít a MacOS szimbólum és verziószám.
And I feel, it is sheer spite mentioning, which I apologise for, that next to his post in the data plate you can find the MacOS logo and version number.

Offline Tutus

  • EP lover
  • *
  • Posts: 682
  • Country: hu
    • Enterprise 128
Re: Programming and use of full memory
« Reply #12 on: 2023.December.20. 09:14:57 »
Szerinted?
What do you think?És azt már merő rosszindulatnak érzem megemlíteni (elnézésedet is kérem érte), hogy a hozzászólása mellett az adattáblájában is ott virít a MacOS szimbólum és verziószám.
And I feel, it is sheer spite mentioning, which I apologise for, that next to his post in the data plate you can find the MacOS logo and version number.
:D Jogos!

Offline nicalejo

  • Newbie
  • Posts: 12
Re: Programming and use of full memory
« Reply #13 on: 2023.December.20. 13:32:06 »
After doing some tests, the z88dk compiler can be used to develop programs. All the access to the video is done through ESC sequences and I suspect this is slow, so is intended the current support for the SDK to simple applications in terms of graphics.

I think the use of the full memory has to be completed developing the enterprise version of what they call the FAR allocating system, several routines for allocating and access data through an API.

Far memory API implementation

Would be great if someone wrote this in the z88dk project with the knowledge about EP system memory management.

This gives the comfort of programming in c and crosscompile

As a proof I wrote this

Code: [Select]
#include <stdio.h>
#include <enterprise.h>


void myplot(int x, int y)
{
 plot(x,y+33);
}

void mydraw(int x, int y)
{
 draw(x,y+33);
}

void mysetxy(int x, int y)
{
 setxy(x,y+33);
}

void myputchar(int x, int y, char c)
{
  esccmd_cmd='I'; // INK colour
  esccmd_x=1;
  exos_write_block(DEFAULT_VIDEO, 3, esccmd);
  mysetxy(x,y);printf("%c",c);
}

int main()
{
   int x,y;

   exos_set_vmode(VM_HRG,CM_2,40,24);
   exos_write_character(DEFAULT_VIDEO, 0x1A);

   for(y=0;y<=10;y+=10)
   {
   mysetxy(0,y);drawr(80,0);
   }

   for(x=0;x<=80;x+=10)
   {
   mysetxy(x,0);drawr(0,10);
   if (x != 80) myputchar(x+3,2,'A');
   }

   while (getch() == 0);

   for(x=0;x<=80;x+=10)
   {
   clga(x+1,33+1, x+9, 33+9);
   if (x != 80) myputchar(x+3,2,'B');
   }

   while (getch() == 0);

   return 0;
}

To compile

  zcc  +enterprise -lm -lgfxep  -create-app -otest.app test.c

I don't know why all the y coordinates have to be increased in 33 and then call the given function in the current API with the corrected value

[ Guests cannot view attachments ]
« Last Edit: 2023.December.20. 13:37:47 by nicalejo »

Offline Tuby128

  • EP addict
  • *
  • Posts: 1449
  • Country: hu
Re: Programming and use of full memory
« Reply #14 on: 2023.December.20. 15:49:07 »
A good programme always writes his own Library :D