Recent

Author Topic: Serial connection on DOS  (Read 2343 times)

Pozsi

  • Newbie
  • Posts: 6
    • Pozsi's homepage
Serial connection on DOS
« on: January 07, 2024, 04:13:38 pm »
Greetings to everyone!
I would like an answer to the following problem. I've run out of ideas.
Thanks!

Purpose: to send characters to a serial terminal.

OS: FreeDOS v1.2
Compiler in real mode: Turbo Pascal Compiler v7.0
Compiler in protected mode: FreePascal Compiler v3.0.0
Port: COM1, 9600 bps, 8N1

Example #1 (sendchr1.pas):
This contains assembler inserts, it works fine when compiled with tpc (real mode), but not with fpc (protected mode). The terminal shows either nothing or something else.

TX LED of the line status checker:
- Real mode: short flash
- Protected mode: long flash

Example #2 (sendchr2.pas):
This contains assembler inserts, but no value is passed to the procedures from declared constants. It works fine when compiled with tpc (real mode), but not with fpc (protected mode). The terminal shows either nothing or something else.

TX LED of the line status checker:
- Real mode: short flash
- Protected mode: short flash (The speed seems good!)

Example #3 (sendchr3.pas):
This no longer contains assembler, it can only be compiled in real mode. Works well.

TX LED of the line status checker:
- Real mode: short flash
- Protected mode: short flash

Example #4 (sendchr4.pas):
This no longer contains assembler, it can only be compiled in protected mode. Works well.

TX LED of the line status checker:
- Real mode: short flash
- Protected mode: short flash

Question: They all work the same, but what could be wrong with the first two in protected mode?
« Last Edit: January 07, 2024, 04:19:57 pm by Pozsi »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11997
  • FPC developer.
Re: Serial connection on DOS
« Reply #1 on: January 07, 2024, 10:23:33 pm »
Compile with -al and look at the generated assembler files? You can play with -A options (-ATasm or so) to avoid AT&T if you are not familiar with it.


Btw that is a 9 year old compiler.

Pozsi

  • Newbie
  • Posts: 6
    • Pozsi's homepage
Re: Serial connection on DOS
« Reply #2 on: January 07, 2024, 11:00:42 pm »
How time flies. It's really old, but the joke is, I updated 2.6 to 3.0 on Friday because it was among the FreeDOS packages. Yes, FreeDOS 1.2 is also old.

I'll replace it with v3.2.2 tomorrow and see what it does with it. Thanks!

Pozsi

  • Newbie
  • Posts: 6
    • Pozsi's homepage
Re: Serial connection on DOS
« Reply #3 on: January 08, 2024, 05:32:03 pm »
Unfortunately, the result is the same with the latest compiler.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11997
  • FPC developer.
Re: Serial connection on DOS
« Reply #4 on: January 08, 2024, 06:24:38 pm »
Note that 3.2.2 is already 2.5 years old itself, FPC isn't the fastest moving project to begin with :-)

Please provide the output generated with -al, e.g.  .s files in  a zip. It might be simply that the assembler needs to be modified for differing calling conventions.

 

TinyPortal © 2005-2018