Image Map Image Map
Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Turbo Pascal - what are the differences between v1 - v2 - v3

  1. #1

    Default Turbo Pascal - what are the differences between v1 - v2 - v3

    They look the same...

  2. #2
    Join Date
    May 2009
    Location
    Connecticut
    Posts
    4,559
    Blog Entries
    1

    Default

    https://community.embarcadero.com/bl...se-dates-39142 gives an idea. Embarcadero leaves out the addition of Turtle Graphics to the TP3 set. The differences were minor until TP4 when EXE files and easily getting more than 64k were available to use.

  3. #3
    Join Date
    Nov 2008
    Location
    Penticton, B.C.
    Posts
    191

    Default

    Yes, I believe that in order to maintain compatibility with CP/M, versions 1-3 had some pretty interesting limitations. Up until TP4, there was hardly any support for graphics or sound, and 64Kb limits were a problem, too. They also improved inline assembly language support, too (if I remember correctly).

  4. #4
    Join Date
    Aug 2006
    Location
    Chicagoland, Illinois, USA
    Posts
    6,287
    Blog Entries
    1

    Default

    Direct inline() of x86 opcodes were supported from TP3 onward, but it wasn't until TP6 that you could inline actual intel syntax mnemonic assembly (within reason).
    Offering a bounty for:
    - A working Sanyo MBC-775, Olivetti M24, or Logabax 1600
    - Music Construction Set, IBM Music Feature edition (has red sticker on front stating IBM Music Feature)

  5. #5

    Default

    Any examples of reading a key from the keyboard? I tried BIOS(2) which I think is ConIn according to the manual, but it seems to think about working after you press a key multiple times.

  6. #6
    Join Date
    Aug 2006
    Location
    Chicagoland, Illinois, USA
    Posts
    6,287
    Blog Entries
    1

    Default

    Quote Originally Posted by alank2 View Post
    Any examples of reading a key from the keyboard? I tried BIOS(2) which I think is ConIn according to the manual, but it seems to think about working after you press a key multiple times.
    What operating system? If CPM, I think it's BIOS(3)? For a PC, it's BIOS($16).

    What version of Turbo Pascal? If on a PC and > 3, use readkey() (in the CRT unit, so beware). If 6 or greater, use something like this:

    Code:
    Function ReadKeyChar:Char; Assembler;
    Asm
            mov     ah, 00h
            int     16h
            cmp     al,0
            jne     @endit
            mov     al,ah
    @endit:
    end;
    Offering a bounty for:
    - A working Sanyo MBC-775, Olivetti M24, or Logabax 1600
    - Music Construction Set, IBM Music Feature edition (has red sticker on front stating IBM Music Feature)

  7. #7
    Join Date
    May 2009
    Location
    Connecticut
    Posts
    4,559
    Blog Entries
    1

    Default

    Quote Originally Posted by alank2 View Post
    Any examples of reading a key from the keyboard? I tried BIOS(2) which I think is ConIn according to the manual, but it seems to think about working after you press a key multiple times.
    Page 341 of TP3 has a generic read character loop designed to handle the multi-char escapes for function keys but also handles all other characters. Basically, loop with Keypressed and then do a READ(keyb, ch) for each character but do a second READ(keyb, ch) if the first character is an escape and there was a second keypress. IIRC, later versions of TP include a direct keyboard reading function effectively wrapping this loop so the programmer doesn't have to.

  8. #8

    Default

    Sorry guys, I should have specified. CP/M-80 running TP 3.01A. The manual has a CP/M-80 area showing the use of the BIOS function, it says:

    The Bios procedure is used to invoke BI,OS routines. Func and Param
    are integer expressions. Func denotes the number of the called
    routine, with 0 meaning the WBOOT routine, 1 the CONST routine,
    etc. That is, the address of the called routine is Func*3 plus the
    WBOOT address contained in addresses 1 and 2. Param is optional
    and denotes a parameter which is loaded into the Be register pair
    before the call.

    This page calls WBOOT function 1 though its address is 0.
    https://www.seasip.info/Cpm/bios.html

  9. #9
    Join Date
    May 2003
    Location
    Back of Burke (Guday!), Australia
    Posts
    2,919

    Default

    I think from memory it's possible to use Exit; to exit a current block in TP3 onwards, in earlier versions you would have to use Goto label with a Label pointing to the end of the block to get the same result.

    Quote Originally Posted by lotonah View Post
    Yes, I believe that in order to maintain compatibility with CP/M, versions 1-3 had some pretty interesting limitations. Up until TP4, there was hardly any support for graphics or sound, and 64Kb limits were a problem, too. They also improved inline assembly language support, too (if I remember correctly).
    TP3 exists across a broad range of systems with the PC-DOS version offering some additional routines to handle CGA graphics, though limited to the 4 colour graphics modes. I recall playing around with other 3rd party routines to EGA and I was suprised what I could dig up from the SWAG archives and port into TP3 which resulted in a number of VGA demos running under CP/M-86 v1.1 for the IBM PC/XT. TP 3 was slow though, I had a 386 running at 16Mhz and TP3 lacked things like INC() and DEC() which worked in its favor in later versions, otherwise it needed a 486.

    I don't know how well those early Turbo Pascal versions went on other 8bit systems, on the Amstrad CPC range it seems it's main competitor was Hisoft Pascal, which was cheaper and usable, around the time TP3 was released, Hisoft released their latest Pascal offering, Pascal 80 which operated in CP/M. Other Z80 based 8bit systems had Hisoft Pascal, which probably functioned probably better than what Turbo Pascal did for the fraction of the cost probably due to knowing how to make good use of the machines capabilities.

  10. #10

    Default

    Ok, so if I write something between checking for an incoming char and reading it, the incoming char is lost.

    Code:
    program test2;
    
    var i,i2 : integer;
    
    begin
      while (i<>97) do
        begin
          write('<');
          while (bios(1)=0) do
            ;
          i:=bios(2);
    
          write('>');
          write(i);
    
        end;
    end.
    If the write('>') is BEFORE the i:=bios(2); instruction, then the key that was typed is lost and it waits for a second key at the i:=bios(2); command. Does TP check/read the keyboard buffer each time a write is done and I am bypassing it when I use the write? In this case is there a better function to read the key? It seems like I tried read(kbd,i) and it didn't work, but I'll try that again.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •