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?