From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6e0a529082576354 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!h11g2000prf.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: updating a hardware cursor with assembly and ada Date: Thu, 6 Mar 2008 13:31:27 -0800 (PST) Organization: http://groups.google.com Message-ID: <98f7b81c-a874-466e-8d60-ab2c4e59bb0a@h11g2000prf.googlegroups.com> References: <47d0293c$0$21937$9b4e6d93@newsspool2.arcor-online.net> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1204839087 4539 127.0.0.1 (6 Mar 2008 21:31:27 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 6 Mar 2008 21:31:27 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: h11g2000prf.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:20205 Date: 2008-03-06T13:31:27-08:00 List-Id: On Mar 6, 9:51 am, cl1 wrote: > On Mar 6, 11:26 am, Georg Bauhaus > bauh...@maps.futureapps.de> wrote: > > cl1 schrieb: > > > > unsigned char outportb (unsigned short _port, unsigned char _data) > > > { > > > __asm__ __volatile__ ("outb %1, %0" : : "dN" (_port), "a" (_data)); > > > } > > > ----------------------------------------------------------------------= -----=AD-- > > > procedure Update_Cursor (Console : Video_Console) is > > > procedure OutportB (Port : Natural; Data : Natural); > > > Does type Natural match C type unsigned short on your system? > > If it didn't, what problem would this pose? Assuming Natural is 32 bits (I don't really know): If the code generated for your Ada program thinks it's passing two 32-bit integers as parameters, but the runtime code is expecting a 16-bit integer and an 8-bit integer as parameters, the runtime code may not use correct values for the parameters. > > (Just a guess.) Maybe Interfaces.Unsigned_N is better choice. > > I have no runtime (this is os development code). I don't know if i can > use the Interfaces packages in gnat with out it. I tried to implement > Unsigned_16 with out the operations and the compiler complained about > not having primitive operations defined on the part where i was doing > Data : Unsigned_16 :=3D Console.Column * 80 + Console.Row; even when > Column and Row were of type Unsigned_16; The operations "*" and "+" aren't automatically available, unless you do something to make them visible. Try "use type Interfaces.Unsigned_16;". -- Adam