Author Topic: Hisoft Pascal 4T  (Read 18407 times)

0 Members and 1 Guest are viewing this topic.

Offline funkheld

  • CPC664
  • ***
  • Posts: 117
  • Liked: 7
  • Likes Given: 0
Re: Hisoft Pascal 4T
« Reply #125 on: 10:06, 08 September 19 »


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


Code: [Select]

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.
« Last Edit: 23:48, 08 September 19 by funkheld »

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.721
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 957
  • Likes Given: 1676
Re: Hisoft Pascal 4T
« Reply #126 on: 01:26, 30 October 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.




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:


Code: [Select]
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.




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.

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



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

Offline funkheld

  • CPC664
  • ***
  • Posts: 117
  • Liked: 7
  • Likes Given: 0
Re: Hisoft Pascal 4T
« Reply #127 on: 16:37, 30 October 19 »

Hello thanks for the information.


the hisoft pascal 4t can not be changed?


thanks.
greeting

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.721
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 957
  • Likes Given: 1676
Re: Hisoft Pascal 4T
« Reply #128 on: 23:27, 01 November 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

Offline funkheld

  • CPC664
  • ***
  • Posts: 117
  • Liked: 7
  • Likes Given: 0
Re: Hisoft Pascal 4T
« Reply #129 on: 22:31, 19 November 19 »
hello, thanks for the info.


greeting

Offline mr.freeze

  • CPC464
  • **
  • Posts: 13
  • Country: be
  • Liked: 10
  • Likes Given: 6
Re: Hisoft Pascal 4T
« Reply #130 on: 20:00, 23 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.
« Last Edit: 20:05, 23 November 19 by mr.freeze »