[fpc-pascal] Access to RS232 ports with fpc
Gustavo Enrique Jimenez
gejimenez at gmail.com
Mon Nov 2 15:55:08 CET 2009
> No, the "1000" means the size of a buffer, not a part address. The port
> address I try to use is 0xEC00, which is the base address for an UART on a
> PCI card. Linux sees this UART as /dev/ttyS2. Accessing the registers
> direcly should be easy, because 3 lines of assembler code should do this
> job:
>
> function readport (portaddress: word): byte;
> begin
> asm
> mov %dx, portaddress
> inb %al,%dx
> mov readport, %al
> end
> end;
>
> As long as the pascal syntax and the assembler syntax (instruction
> destination source) are both correct for fpc, this function should return
> the value of the selected port. This is all, what I try to do.
>
>
> Best regards, Holger
>
Just user synaser, http://www.synapse.ararat.cz/ . When you get the
thing working, go back to the serial unit. I do SCADA with Modbus
through serial port. Never had a problem.
You can't write programs in linux (or windows) like in DOS.
Gustavo
More information about the fpc-pascal
mailing list