News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_AMSDOS

Hisoft Pascal 4T

Started by AMSDOS, 11:33, 25 August 12

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

funkheld

#125


Push screen into the higher memory?

Hi good afternoon.
I can not push the screen into the listening memory and bring it back.

What is there for a mistake in it?

Thank you.
greeting




PROGRAM MEMOBI;
{$C-}
{$L-}
   
TYPE NAME = ARRAY[1..12] OF CHAR;   


VAR
  N, X, Y : INTEGER;
   KVAL : CHAR;


PROCEDURE LOAD(FILE : NAME; ADRESS : INTEGER);
BEGIN
   RB:=CHR(SIZE(FILE));
   RHL:=ADDR(FILE);
   RDE:=ADRESS;
   USER(#BC77);
   RHL:=ADRESS;
   USER(#BC83);
   USER(#BC7A)
END;


PROCEDURE WARTE;
BEGIN
   FOR N:=0 TO 1000 DO
      BEGIN
         X:=23
     END
END;


PROCEDURE MODE(N : INTEGER);
BEGIN
  RA:=CHR(N);
  USER(#BC0E)
END;


PROCEDURE COPY40C0;
BEGIN
  INLINE( #11 ,#0 ,#C0 ,#21 ,#0 ,#40 ,#1 ,#0 ,#40 ,#ED);
  INLINE( #B0 ,#C9  );
END;


PROCEDURE COPYC040;
BEGIN
  INLINE( #11 ,#0 ,#40 ,#21 ,#0 ,#C0 ,#1 ,#0 ,#40 ,#ED);
  INLINE( #B0 ,#C9  );
END;


PROCEDURE GETSCR;
BEGIN
   LOAD('SCREEN01.DAT',#C000);
   OUT(#7F00,CHR(#C4));
   COPYC040;
   OUT(#7F00,CHR(#C0));
   LOAD('SCREEN02.DAT',#C000);
   OUT(#7F00,CHR(#C5));
   COPYC040;
   OUT(#7F00,CHR(#C0));
   LOAD('SCREEN03.DAT',#C000);
   OUT(#7F00,CHR(#C6));
   COPYC040;
   OUT(#7F00,CHR(#C0));
   LOAD('SCREEN04.DAT',#C000);
   OUT(#7F00,CHR(#C7));
   COPYC040;
   OUT(#7F00,CHR(#C0))
END;


PROCEDURE SCRGET1;
BEGIN
   OUT(#7F00,CHR(#C4));
   COPY40C0;
   OUT(#7F00,CHR(#C0))
END;


PROCEDURE SCRGET2;
BEGIN
  OUT(#7F00,CHR(#C5));
   COPY40C0;
   OUT(#7F00,CHR(#C0))
END;


PROCEDURE SCRGET3;
BEGIN
   OUT(#7F00,CHR(#C6));
   COPY40C0;
   OUT(#7F00,CHR(#C0))
END;


PROCEDURE SCRGET4;
BEGIN
   OUT(#7F00,CHR(#C7));
   COPY40C0;
   OUT(#7F00,CHR(#C0))
END;


PROCEDURE FTCHSCR;
BEGIN
  KVAL:=INCH;
  CASE ORD(KVAL) OF
      240 : SCRGET1;
      241 : SCRGET2;
      242 : SCRGET3;
      243 : SCRGET4
  END
END;


BEGIN
    MODE(0);
    GETSCR;
    REPEAT
    FTCHSCR;
   UNTIL ORD(KVAL)=252;
   MODE(2)
END.

AMSDOS



Quote from: funkheld on 12:29, 04 September 19
it should be visible to the screen $C000 and wants to invisibly write in $4000. then I want to switch from $C000 to $ 4000.


Thank you.
greeting


You have scrbase(#40), which will take you to the screen stored at #4000.




Quote from: funkheld on 12:32, 04 September 19
how does the symbol and symbolafter in pascal work?


Thank you.
greeting


There's different approaches to this and I have examples of it in Worm & Bouncing Ball, which work by passing the data internally within the Pascal program, but if a game for example required lots of data it would be using up lots of valuable space which there is not a lot of.
It would be best to save the symbol data into a file, a single procedure to setup a matrix table could be used to point to an array and then the applicable data loaded in (either with your load routine or TIN). So an example maybe:



var mygfx : array[1..24] of char;
.
.
procedure setmtable;
   begin
      rde:=253;
      rhl:=addr(mygfx);
      user(#bbab)
   end;
.
.
begin
   tin('mygfx1  .dat',addr(mygfx);
   write(chr(255)); write(chr(254)); write(chr(253))
end.





Quote from: funkheld on 15:32, 05 September 19
Hi good afternoon.


I load and save with amsdos-load-save.
working wonderfully, can ascii and am data load-saven.


Thank you
greeting




I'm not sure, I did write something at some time to handle ASCII files, but are handled differently because they don't have a regular header. The TIN & TOUT commands HP has to Load & Save are perhaps closer to representing a ASCII file and I wrote a small Assembly routine to demonstrate Loading one of those files in AMSDOS.

Quote from: funkheld on 08:06, 08 September 19Push screen into the higher memory?Hi good afternoon.I can not push the screen into the listening memory and bring it back.What is there for a mistake in it?Thank you.greeting



The problem here is if you are within Hisoft Pascal Compiler, code is placed in the Lower 16k #4000-&7FFF section. You cannot be here when you want to OUT &7F00,&C4 as you have no way of getting back. The only way around is to Translate File to Disk which starts compiling at &17C4, allowing you to have some space between &17C4 and &3fff to handle any upper Memory operations. As soon as you compile the source code to Disk, the code is transferred to that Location and the Compiler is Destroyed resulting in the return to BASIC.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

funkheld


Hello thanks for the information.


the hisoft pascal 4t can not be changed?


thanks.
greeting

AMSDOS

Quote from: funkheld on 15:37, 30 October 19
Hello thanks for the information.


the hisoft pascal 4t can not be changed?


thanks.
greeting


Not easily, as I mentioned earlier Hisoft Pascal 4t was written before 128k, where's Hisoft Pascal 80 came out after, though from what I can from it is it appears to only compile CP/M COM files, it includes a small COM file programme called TOAMS.COM, but that's for taking Source Code and converting it back for Hisoft Pascal 4t.


It would take an large amount of work, I don't even know if having the original Source Code would help and I haven't even been able to understand the final code generated apart from it being a file with a 7kb Library Stored at the start with a few other things it does on initiation, the Pascal source code produced begins at &17C4, but a look at &17C4 shows a whole series of initiations before commencing into the code.


Writing a Compiler is too big a project for an individual to write, it would be a full-time job just understanding the language your writing and understanding the Assembly which needs to be produced, others have tried producing Pascal Compilers unsuccessfully through Cross-Compiling avenues, though haven't been successful probably because of lack of interest or the scope of coding required. If you had a look at other Pascal compilers such as Free Pascal then it becomes more aparent that a lot of people work on that project.


If you like Coding in the CPC environment and want a Language which uses the upper 64k then perhaps PhrozenC would be a better suit? It's based on Small-C, though runs through BASIC making use of the extra 64k to store the source code and comes with a Manual. For some time I have been considering looking more into that Language, which would be ideal for writing Larger projects on and just leave the small stuff for this compiler, though I have also been considering what other creations I could come up in this language based on what I have been able to produce within BASIC.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

funkheld

hello, thanks for the info.


greeting

mr.freeze

#130
Quote from: AMSDOS on 22:27, 01 November 19
Writing a Compiler is too big a project for an individual to write, it would be a full-time job just understanding the language your writing and understanding the Assembly which needs to be produced, others have tried producing Pascal Compilers unsuccessfully through Cross-Compiling avenues, though haven't been successful probably because of lack of interest or the scope of coding required. If you had a look at other Pascal compilers such as Free Pascal then it becomes more aparent that a lot of people work on that project.
Pascal-P4 (https://homepages.cwi.nl/~steven/pascal/) may be a good starting point. The compiler recognises a large subset of Pascal and generates P-code. Writing a P-code to Z80 should not be a compex task.

Powered by SMFPacks Menu Editor Mod