receive data from comm port

how to receive data from comm port ?? (RS 232/RS 485)


Comments

  • to receive a char or byte i use the function $02 from interrupt $14h



    var error_code, in_byte:byte;



    procedure get_com;

    begin

    asm

    mov error_code,0

    mov ah,02h

    mov dx,00h <---0=com1, 1=com2, ... <br>
    int 14h

    test ah,128

    je @ok

    mov error_code,ah

    @ok

    mov in_byte,al

    end;

    end;



    begin

    get_com;

    if error_code>0 then writeln('Error!') else

    writeln('From COM1:',in_byte);

    end.



    i think this will work






Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories