Path: news.cs.au.dk!not-for-mail From: Flemming Gram Christensen Newsgroups: comp.lang.beta Subject: Re: BETA and I/O Date: Tue, 20 Apr 1999 09:12:33 +0200 Organization: University of Aarhus, Department of Computer Science (DAIMI) Lines: 66 Message-ID: <371C28E1.2188@mjolner.dk> References: <371A0D26.6270FD40@gmx.de> NNTP-Posting-Host: sleipner.mjolner.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: xinwen.cs.au.dk 924592354 1454618 255.255.255.255 (20 Apr 1999 07:12:34 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 20 Apr 1999 07:12:34 GMT X-Mailer: Mozilla 3.01 (X11; I; SunOS 5.5.1 sun4m) Xref: news.cs.au.dk comp.lang.beta:11902 Jens Krause wrote: > > Hi all there! > > I have an 8255 Multi I/O Card and I want to sent a binary value to the > Adress of this card. > In Basic it looks like: > > Port = &H200 > Out Port, 1 (* This will send a "1" to the I/O Adress 200 *) > > Now my problem is that I want use the Card with BETA and I had now idea > how. > You can not do that directly in BETA for many reasons. But the easiest way is to make a tiny C-routine that takes the Port address and data value and call that C-routine from BETA. This is easily done with the external interface. C-code: int SendToPort(int PortAdr,int Value) { int result; /* C-code here */ /* or Assembler: mov ax,portadr;mov ds,ax, out ds, ... */ }; BETA-code: SendToPort:external (# portadr,value:@integer; result:@integer; enter (portadr,value) do CallC; exit result #) Now use this SendToPort as a normal pattern. If you need help with the C-code write again. Include machinetype and C-compiler name. /gram > Any answer is welcome. > > MfG Jens K. > > -- > My Contacts > > Name: Jens Krause > ICQ: 14917191 > > Try: http://darkmans.home.pages.de -- /Flemming Gram Christensen ------------------------------------------------------------------------ Mjolner Informatics ApS Phone: +45 86 20 20 00 Science Park Aarhus Fax: +45 86 20 12 22 Gustav Wieds Vej 10 DK-8000 Aarhus C Denmark E-mail: gram@mjolner.dk ------------------------------------------------------------------------