Forum > Other OS

Serial connection on DOS

(1/1)

Pozsi:
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?

marcov:
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:
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:
Unfortunately, the result is the same with the latest compiler.

marcov:
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.

Navigation

[0] Message Index

Go to full version