<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Array auf feste Speicherstelle]]></title><description><![CDATA[<p>Hi,</p>
<p>ich brauche ein array, welches an einer fixen Adressebeginnt.<br />
Hab mir das wie folgt vorgestellt:</p>
<pre><code>#define VIDEO (*( uint8 volatile *)(0x0008000))

typedef uint8 volatile ui8arr_10_video_t[10];
 uint8 volatile *test=&amp;VIDEO;

ui8arr_10_video_t &amp;ui8arr_10_video=reinterpret_cast&lt;ui8arr_10_video_t &gt;( &amp;VIDEO );
</code></pre>
<p>Leider funktioniert das so nicht in der letzten Zeile....<br />
Über einen Funktionsaufruf möchte ich eigentlich nicht gehen...</p>
<p>Gruß Alex</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/318752/array-auf-feste-speicherstelle</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Jul 2026 22:02:10 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/318752.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 25 Jul 2013 09:45:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Array auf feste Speicherstelle on Thu, 25 Jul 2013 11:07:28 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich brauche ein array, welches an einer fixen Adressebeginnt.<br />
Hab mir das wie folgt vorgestellt:</p>
<pre><code>#define VIDEO (*( uint8 volatile *)(0x0008000))

typedef uint8 volatile ui8arr_10_video_t[10];
 uint8 volatile *test=&amp;VIDEO;

ui8arr_10_video_t &amp;ui8arr_10_video=reinterpret_cast&lt;ui8arr_10_video_t &gt;( &amp;VIDEO );
</code></pre>
<p>Leider funktioniert das so nicht in der letzten Zeile....<br />
Über einen Funktionsaufruf möchte ich eigentlich nicht gehen...</p>
<p>Gruß Alex</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2341080</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2341080</guid><dc:creator><![CDATA[AlexanderKiebler]]></dc:creator><pubDate>Thu, 25 Jul 2013 11:07:28 GMT</pubDate></item><item><title><![CDATA[Reply to Array auf feste Speicherstelle on Thu, 25 Jul 2013 09:59:07 GMT]]></title><description><![CDATA[<p>Wozu meinst du das zu brauchen? Du schreibst nicht an feste Adressen, indem du Datenstrukturen dahin packst (was nicht möglich ist), sondern indem du, nun ja, dahin schreibst. Also über Pointer und so.</p>
<p>Ich bin mir aber ziemlich sicher, dass es auch damit nicht funktionieren wird, da du einerseits keinen Plan von den Grundlagen zu haben scheinst (tut mir leid, aber ist einfach so, wenn man deinen Versuch ansieht), andererseits aber anscheinend etwas versuchst, was einiges an Expertenwissen voraussetzt, wann und wie das überhaupt geht. Könntest du, ohne in Wikipedia zu gucken, erklären, was protected mode ist?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2341084</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2341084</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Thu, 25 Jul 2013 09:59:07 GMT</pubDate></item><item><title><![CDATA[Reply to Array auf feste Speicherstelle on Thu, 25 Jul 2013 10:05:38 GMT]]></title><description><![CDATA[<p>Hi SeppJ,</p>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title="=)"
      alt="🙂"
    /> danke für die freundliche Unterstützung *ggg*</p>
<p>Na ja ich bekomme es schon hin... das ist kein Problem, aber ich suche gerade nach einer schönen Lösung. Ich behandle arrays immer auf die selbe Weise, weil das wenn man sich dran hält superschönen code abgibt.</p>
<p>Leider funktioniert das auf der hardware nicht, oder ich bekomms grad nicht hin.</p>
<pre><code>char*       video = (char*) 0xb8000;

    // C-Strings haben ein Nullbyte als Abschluss
    for (i = 0; hw[i] != '\0'; i++)
	{
     .....
        video[i * 2] = hw[i];
...
</code></pre>
<p>In der Form gehts natürlich, ist aber weniger schön...</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2341088</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2341088</guid><dc:creator><![CDATA[AlexanderKiebler]]></dc:creator><pubDate>Thu, 25 Jul 2013 10:05:38 GMT</pubDate></item><item><title><![CDATA[Reply to Array auf feste Speicherstelle on Thu, 25 Jul 2013 10:07:22 GMT]]></title><description><![CDATA[<p>uhm du weisst schon dass reinterpert_cast einen zeiger zurückgibt und der zieltyp (das templateargument) auch ein zeiger sein soll? das ist ja der &quot;sinn&quot; des reinterpret_casts.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2341090</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2341090</guid><dc:creator><![CDATA[flabahz]]></dc:creator><pubDate>Thu, 25 Jul 2013 10:07:22 GMT</pubDate></item><item><title><![CDATA[Reply to Array auf feste Speicherstelle on Thu, 25 Jul 2013 10:09:08 GMT]]></title><description><![CDATA[<p>^ ups vergiss das da oben, hab mich verlesen beim eröffnungspost</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2341092</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2341092</guid><dc:creator><![CDATA[flabahz]]></dc:creator><pubDate>Thu, 25 Jul 2013 10:09:08 GMT</pubDate></item><item><title><![CDATA[Reply to Array auf feste Speicherstelle on Thu, 25 Jul 2013 10:10:56 GMT]]></title><description><![CDATA[<p>Passt schon, das ist ja ne Diskussionsrunde =)...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2341093</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2341093</guid><dc:creator><![CDATA[AlexanderKiebler]]></dc:creator><pubDate>Thu, 25 Jul 2013 10:10:56 GMT</pubDate></item><item><title><![CDATA[Reply to Array auf feste Speicherstelle on Thu, 25 Jul 2013 10:45:06 GMT]]></title><description><![CDATA[<p>AlexanderKiebler schrieb:</p>
<blockquote>
<pre><code>char*       video = (char*) 0xb8000;
</code></pre>
<p>In der Form gehts natürlich, ist aber weniger schön...</p>
</blockquote>
<p>Das ist aber die kanonische Lösung. was stellst du dir schöneres vor? Danach kannst du schließlich mit video (fast) so arbeiten, als wäre es ein Array.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2341102</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2341102</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Thu, 25 Jul 2013 10:45:06 GMT</pubDate></item><item><title><![CDATA[Reply to Array auf feste Speicherstelle on Thu, 25 Jul 2013 11:19:16 GMT]]></title><description><![CDATA[<p>Ich hatte gehofft, das es eine Lösung gibt, welche im Typen die info der Array größe hat.</p>
<pre><code>#define VIDEO (*( uint8 volatile *)(0x0008000))

typedef uint8 volatile ui8arr_10_video_t[10];
struct test2_t
{
    uint8 volatile ui8arr_10_video[10];
};

 //uint8 volatile *test=&amp;VIDEO;
//volatile uint8 (&amp;atest)[10]=reinterpret_cast&lt;volatile uint8 [10]&gt;(test);
//ui8arr_10_video_t &amp;ui8arr_10_video=reinterpret_cast&lt;ui8arr_10_video_t &gt;( &amp;VIDEO );
test2_t volatile &amp;test=*reinterpret_cast&lt;test2_t volatile *&gt;( &amp;VIDEO );
</code></pre>
<p>Schau grad mal in der ISO nach, ob das so erlaubt ist...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2341106</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2341106</guid><dc:creator><![CDATA[AlexanderKiebler]]></dc:creator><pubDate>Thu, 25 Jul 2013 11:19:16 GMT</pubDate></item><item><title><![CDATA[Reply to Array auf feste Speicherstelle on Thu, 25 Jul 2013 11:08:27 GMT]]></title><description><![CDATA[<p>AlexanderKiebler schrieb:</p>
<blockquote>
<p>Ich hatte gehofft, das es eine Lösung gibt, welche im Typen die info der Array größe hat.</p>
</blockquote>
<p>Ne, gibts nicht. Darum nutzen wir rohe Arrays ja auch nicht. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2341107</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2341107</guid><dc:creator><![CDATA[out]]></dc:creator><pubDate>Thu, 25 Jul 2013 11:08:27 GMT</pubDate></item><item><title><![CDATA[Reply to Array auf feste Speicherstelle on Thu, 25 Jul 2013 11:11:02 GMT]]></title><description><![CDATA[<p>AlexanderKiebler schrieb:</p>
<blockquote>
<p>Ich hatte gehofft, das es eine Lösung gibt, welche im Typen die info der Array größe hat.</p>
</blockquote>
<p>Bau dir doch eine, ist doch nicht so schwierig. Du kapselst deinen Pointer in einer Klasse, baust ein paar Komfortfunktionen dazu und fertig.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2341109</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2341109</guid><dc:creator><![CDATA[DocShoe]]></dc:creator><pubDate>Thu, 25 Jul 2013 11:11:02 GMT</pubDate></item><item><title><![CDATA[Reply to Array auf feste Speicherstelle on Thu, 25 Jul 2013 11:31:55 GMT]]></title><description><![CDATA[<p>Du kannst doch eine Referenz auf ein Array nehmen.</p>
<pre><code class="language-cpp">uint8_t (&amp;screen)[N] = *(uint8_t (*)[N])0xb8000;
</code></pre>
<p>Auch wenn mir der Sinn nicht großartig einleuchtet, ich würde einfach einen Pointer nehmen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2341111</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2341111</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Thu, 25 Jul 2013 11:31:55 GMT</pubDate></item><item><title><![CDATA[Reply to Array auf feste Speicherstelle on Thu, 25 Jul 2013 12:05:25 GMT]]></title><description><![CDATA[<p>cool danke, danach habe ich gesucht.<br />
Das müßte das Selbe sein wie:</p>
<pre><code>typedef uint8 ui8arr_10_video_t[10];
ui8arr_10_video_t &amp;ui8arr_10_video=*reinterpret_cast&lt;ui8arr_10_video_t *&gt;( &amp;VIDEO );
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2341117</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2341117</guid><dc:creator><![CDATA[AlexanderKiebler]]></dc:creator><pubDate>Thu, 25 Jul 2013 12:05:25 GMT</pubDate></item></channel></rss>