Find the answer to your Linux question:
Results 1 to 1 of 1
My experience with Pascal has (almost) been thankfully little. BUT I am trying to convert a Pascal program to TCL. This is a program to capture voltages from a A/D ...
  1. #1
    Linux User
    Join Date
    Mar 2008
    Posts
    287

    pascal 2 tcl

    My experience with Pascal has (almost) been thankfully little. BUT I am trying to convert a Pascal program to TCL. This is a program to capture voltages from a A/D chip. I have written a program for another situations in C that employed an AD0831 very successfully.
    I note that in Pascal the program sets up the registers by assigning values to a variable, e.g. port[MCR]:=3;
    In C I wrote to registers using: outb(0xff, CTRL);
    I am trying to do output and input to port via TCL and finding myself confused. Does Pascal somehow write to mem location by assigning values to variables? The Pascal program I am translating uses NO write/read to "port" or port[xxx] it does use writeln to output the value it reads from the chip. I am a bit perplexed and wonder if someone could assist.
    Here is a snipit from the code (LCR & MSR are assigned addresses of 2F8Hex + 3 & 6):
    For count:=0 to 7 Do Begin
    value:=value SHL 1;
    Port[LCR]:=64;
    If (port[MSR] and $10)=$10 Then Inc(value);
    Port[LCR]:=0;
    End;
    I see in TCL I can write to port after the usual opening (like writing to a file) for a file handle and using puts/gets similarly to what I did in C but am not sure if this is the correct equivalent to assigning a value to a variable like is done (apparently) in Pascal. Explain the process of writing to registers in Pascal too if you would please.
    Thanks in advance
    Last edited by clickit; 12-20-2008 at 12:45 AM. Reason: clearify

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...