{"id":1997,"date":"2016-09-29T10:01:23","date_gmt":"2016-09-29T17:01:23","guid":{"rendered":"http:\/\/visualgdb.com\/w\/?p=1997"},"modified":"2016-09-29T10:07:32","modified_gmt":"2016-09-29T17:07:32","slug":"embedding-binary-resources-into-embedded-projects","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/tutorials\/arm\/resources\/","title":{"rendered":"Embedding Binary Resources into Embedded Projects"},"content":{"rendered":"<p>This tutorial shows how to easily embed binary files into your Embedded VisualGDB projects and access them from your code. We will modify the basic STM32F7Discovery LCD example to display 3 custom icons on top of the background image and will show how to easily embed them in your project. Before you begin, install VisualGDB 5.2 Beta 2 or later.<\/p>\n<ol>\n<li>Start Visual Studio and open VisualGDB Embedded Project Wizard:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/01-prjname.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1998\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/01-prjname.png\" alt=\"01-prjname\" width=\"786\" height=\"511\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/01-prjname.png 786w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/01-prjname-300x195.png 300w\" sizes=\"(max-width: 786px) 100vw, 786px\" \/><\/a><\/li>\n<li>On the first page select &#8220;Create a new project&#8221; and ensure that the MSBuild system is selected:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/02-msbuild.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1999\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/02-msbuild.png\" alt=\"02-msbuild\" width=\"738\" height=\"565\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/02-msbuild.png 738w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/02-msbuild-300x230.png 300w\" sizes=\"(max-width: 738px) 100vw, 738px\" \/><\/a><\/li>\n<li>On the next page of the wizard select your device. In this example we will use STM32F746NG that is installed on the STM32F7Discovery board:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/03-device1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2000\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/03-device1.png\" alt=\"03-device\" width=\"747\" height=\"612\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/03-device1.png 747w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/03-device1-300x246.png 300w\" sizes=\"(max-width: 747px) 100vw, 747px\" \/><\/a><\/li>\n<li>On the Sample Selection page choose the LCD Demo sample and proceed with the default sample configuration:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/04-lcd.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2001\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/04-lcd.png\" alt=\"04-lcd\" width=\"747\" height=\"612\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/04-lcd.png 747w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/04-lcd-300x246.png 300w\" sizes=\"(max-width: 747px) 100vw, 747px\" \/><\/a><\/li>\n<li>Finally select your debug method on the Debug Method page. We recommend using OpenOCD or Segger J-Link:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/05-stlink.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2002\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/05-stlink.png\" alt=\"05-stlink\" width=\"747\" height=\"612\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/05-stlink.png 747w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/05-stlink-300x246.png 300w\" sizes=\"(max-width: 747px) 100vw, 747px\" \/><\/a><\/li>\n<li>Modify the main() function to use LCD_FB_START_ADDRESS as the layer address and copy the background image (s_Logo) to it:\n<pre class=\"\">\u00a0\u00a0\u00a0 BSP_LCD_LayerRgb565Init(0, LCD_FB_START_ADDRESS);\r\n\u00a0\u00a0\u00a0 memcpy((void *)LCD_FB_START_ADDRESS, s_Logo, sizeof(s_Logo));<\/pre>\n<p>Then build your project:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/06-build.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2003\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/06-build.png\" alt=\"06-build\" width=\"924\" height=\"681\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/06-build.png 924w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/06-build-300x221.png 300w\" sizes=\"(max-width: 924px) 100vw, 924px\" \/><\/a><\/li>\n<li>If you run it now, the board will show the VisualGDB logo taken from s_Logo:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/background.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2007\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/background.jpg\" alt=\"background\" width=\"800\" height=\"577\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/background.jpg 800w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/background-300x216.jpg 300w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/li>\n<li>Now we will modify the program to display 3 icons from the <a href=\"http:\/\/www.iconarchive.com\/show\/oxygen-icons-by-oxygen-icons.org.html\">Oxygen icon theme<\/a> on top of the background image. To avoid decompressing the png format on the device, we will convert the PNG files into a simple binary format. You can do that with a simple C# tool:\n<pre class=\"\">using System.Collections.Generic;\r\nusing System.Drawing;\r\nusing System.IO;\r\n\r\nnamespace ImageConverter\r\n{\r\n\u00a0\u00a0\u00a0 class Program\r\n\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 static void Main(string[] args)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Bitmap bmp = new Bitmap(args[0]);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 List&lt;byte&gt; data = new List&lt;byte&gt;();\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 for (int y = 0; y &lt; bmp.Height; y++)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 for (int x = 0; x &lt; bmp.Width; x++)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Color pixel = bmp.GetPixel(x, y);\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 data.Add(pixel.A);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 data.Add(pixel.R);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 data.Add(pixel.G);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 data.Add(pixel.B);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 File.WriteAllBytes(Path.ChangeExtension(args[0], \".dat\"), data.ToArray());\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }\r\n\u00a0\u00a0\u00a0 }\r\n}<\/pre>\n<p>You can download an archive with the original .png files and the converted .dat files <a href=\"http:\/\/sysprogs.com\/files\/visualgdb\/tutorials\/icons.7z\">here<\/a>.<\/li>\n<li>Add the following functions to your main file to draw the raw images on the screen:\n<pre class=\"\">void DrawLineWithTransparency(uint16_t *pDst, const uint32_t *pSrc, int pixels)\r\n{\r\n\u00a0\u00a0\u00a0 for (int i = 0; i &lt; pixels; i++)\r\n\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 uint16_t oldPixel = pDst[i];\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 uint32_t value = pSrc[i];\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 int oldR = ((oldPixel &gt;&gt; (5 + 6)) &amp; 0x1F) &lt;&lt; 3;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 int oldG = ((oldPixel &gt;&gt; 5) &amp; 0x3F) &lt;&lt; 2;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 int oldB = (oldPixel &amp; 0x1F) &lt;&lt; 3;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 int picWeight = value &amp; 0xFF;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 int oldWeight = 256 - picWeight;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 int picR = (value &gt;&gt; 8) &amp; 0xFF;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 int picG = (value &gt;&gt; 16) &amp; 0xFF;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 int picB = (value &gt;&gt; 24) &amp; 0xFF;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 int newR = (oldR * oldWeight + picR * picWeight) \/ 256;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 int newG = (oldG * oldWeight + picG * picWeight) \/ 256;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 int newB = (oldB * oldWeight + picB * picWeight) \/ 256;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 newR &gt;&gt;= 3;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 newG &gt;&gt;= 2;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 newB &gt;&gt;= 3;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 uint16_t rgb565 = (ushort)(newB | (newG &lt;&lt; 5) | (newR &lt;&lt; (5 + 6)));\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 pDst[i] = rgb565;\r\n\u00a0\u00a0\u00a0 }\r\n}\r\n\r\n\r\nvoid DrawImageWithTransparency(const uint32_t *pImage, int X, int Y, int width, int height)\r\n{\r\n\u00a0\u00a0\u00a0 const int ScreenWidth = 480;\r\n\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0\u00a0 uint16_t *pStartAddr = (uint16_t*)LCD_FB_START_ADDRESS + Y * ScreenWidth + X;\r\n\u00a0\u00a0\u00a0 for (int i = 0; i &lt; height; i++)\r\n\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 DrawLineWithTransparency(pStartAddr + i * ScreenWidth, pImage + i * width, width);\r\n\u00a0\u00a0\u00a0 }\r\n}<\/pre>\n<\/li>\n<li>Copy the .dat files into a subdirectory inside your project directory and add them to Solution Explorer. Ensure that the Item Type for those files is set to &#8220;Embedded Binary File&#8221; (default for .dat files):<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/07-binary.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2004\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/07-binary.png\" alt=\"07-binary\" width=\"1271\" height=\"677\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/07-binary.png 1271w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/07-binary-300x160.png 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/07-binary-1024x545.png 1024w\" sizes=\"(max-width: 1271px) 100vw, 1271px\" \/><\/a><\/li>\n<li>Build your project. VisualGDB will automatically convert the binary files to object files, link them together with your program and generate a file called <strong>EmbeddedResources.h<\/strong> with a list of resource names. Include the EmbeddedResources.h file from your main file and use IntelliSense to check the contents of the EmbeddedResources namespace:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/sense.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2008\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/sense.png\" alt=\"sense\" width=\"924\" height=\"772\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/sense.png 924w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/sense-300x251.png 300w\" sizes=\"(max-width: 924px) 100vw, 924px\" \/><\/a>If these were the first resources added to your project, you will need to reopen it in order for IntelliSense to locate the generated header file.<\/li>\n<li>Add the following lines to your main() function to draw the resources:\n<pre class=\"\">\u00a0\u00a0\u00a0 int left = 24;\r\n\u00a0\u00a0\u00a0 DrawImageWithTransparency((uint32_t*)icons_Actions_dialog_ok_apply_128_dat.data(), left, 72, 128, 128);\r\n\u00a0\u00a0\u00a0 left += 128 + 24;\r\n\u00a0\u00a0\u00a0 DrawImageWithTransparency((uint32_t*)icons_Actions_edit_delete_128_dat.data(), left, 72, 128, 128);\r\n\u00a0\u00a0\u00a0 left += 128 + 24;\r\n\u00a0\u00a0\u00a0 DrawImageWithTransparency((uint32_t*)icons_Actions_dialog_cancel_128_dat.data(), left, 72, 128, 128);\r\n\r\n<\/pre>\n<\/li>\n<li>Build your project and note how the FLASH utilization increased considerably after adding the large icons:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/08-images.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2005\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/08-images.png\" alt=\"08-images\" width=\"924\" height=\"681\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/08-images.png 924w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/08-images-300x221.png 300w\" sizes=\"(max-width: 924px) 100vw, 924px\" \/><\/a><\/li>\n<li>Build the program and run it. You will see the new icons drawn on top of the background image:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/icons.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2009\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/icons.jpg\" alt=\"icons\" width=\"800\" height=\"547\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/icons.jpg 800w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/icons-300x205.jpg 300w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/icons-130x90.jpg 130w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/li>\n<li>The generated EmbeddedResources.h file will look similar to this:\n<pre class=\"\">#pragma once\r\n\r\nextern void *_binary_icons_Actions_dialog_cancel_128_dat_start, *_binary_icons_Actions_dialog_cancel_128_dat_end, *_binary_icons_Actions_dialog_cancel_128_dat_size;\r\nextern void *_binary_icons_Actions_dialog_ok_apply_128_dat_start, *_binary_icons_Actions_dialog_ok_apply_128_dat_end, *_binary_icons_Actions_dialog_ok_apply_128_dat_size;\r\nextern void *_binary_icons_Actions_edit_delete_128_dat_start, *_binary_icons_Actions_edit_delete_128_dat_end, *_binary_icons_Actions_edit_delete_128_dat_size;\r\n\r\n#ifdef __cplusplus\r\n#ifndef CUSTOM_EMBEDDED_RESOURCE_CLASS\r\ntemplate &lt;void **_Start, void **_End, void **_Size&gt; class EmbeddedResource\r\n{\r\npublic:\r\n\u00a0\u00a0 \u00a0void *data() { return _Start; }\r\n\u00a0\u00a0 \u00a0void *end() { return _End; }\r\n\u00a0\u00a0 \u00a0unsigned size()\u00a0 { return (unsigned)_Size; }\r\n};\r\n#endif\r\n\r\nnamespace EmbeddedResources\r\n{\r\n\u00a0\u00a0 \u00a0static EmbeddedResource&lt;&amp;_binary_icons_Actions_dialog_cancel_128_dat_start, &amp;_binary_icons_Actions_dialog_cancel_128_dat_end, &amp;_binary_icons_Actions_dialog_cancel_128_dat_size&gt; icons_Actions_dialog_cancel_128_dat;\r\n\u00a0\u00a0 \u00a0static EmbeddedResource&lt;&amp;_binary_icons_Actions_dialog_ok_apply_128_dat_start, &amp;_binary_icons_Actions_dialog_ok_apply_128_dat_end, &amp;_binary_icons_Actions_dialog_ok_apply_128_dat_size&gt; icons_Actions_dialog_ok_apply_128_dat;\r\n\u00a0\u00a0 \u00a0static EmbeddedResource&lt;&amp;_binary_icons_Actions_edit_delete_128_dat_start, &amp;_binary_icons_Actions_edit_delete_128_dat_end, &amp;_binary_icons_Actions_edit_delete_128_dat_size&gt; icons_Actions_edit_delete_128_dat;\r\n}\r\n#endif<\/pre>\n<p>The lines starting with &#8220;extern&#8221; declare the symbols like <strong>_binary_&lt;name&gt;_start<\/strong> that are automatically generated by GNU linker when linking binary files into your program. You can use those from your plain C code. The EmbeddedResource class provides a convenient C++ wrapper that can be used to access the resource from C++ code. You can use the <strong>resource_name.data()<\/strong> syntax to get a pointer to the beginning of an embedded resource and the <strong>resource_name.size()<\/strong> syntax to get the size of a resource.<\/li>\n<li>If you want to add more functionality to the EmbeddedResource class, you can redefine it in your own header file and define the CUSTOM_EMBEDDED_RESOURCE_CLASS macro there:\n<pre class=\"\">#define CUSTOM_EMBEDDED_RESOURCE_CLASS\r\ntemplate &lt;void **_Start, void **_End, void **_Size&gt; class EmbeddedResource\r\n{\r\npublic:\r\n\u00a0\u00a0\u00a0 void *data() { return _Start; }\r\n\u00a0\u00a0\u00a0 void *end() { return _End; }\r\n\u00a0\u00a0\u00a0 unsigned size()\u00a0 { return (unsigned)_Size; }\r\n\u00a0\u00a0\u00a0 template&lt;class _Type&gt; _Type *get() {return (_Type*)_Start;}\r\n};<\/pre>\n<p>As long as the class still accepts 3 template arguments corresponding to the start, end and size of the block, you can use it instead of the original one:<\/p>\n<pre class=\"\">\u00a0\u00a0\u00a0 DrawImageWithTransparency(icons_Actions_dialog_ok_apply_128_dat.get&lt;uint32_t&gt;(), left, 72, 128, 128);<\/pre>\n<\/li>\n<li>The template-based implementation does not result in any extra overhead compared to the plain C version. If you compile your program in the release mode and look into disassembly, you will see that the call to <strong>data()<\/strong> or the newly added <strong>get()<\/strong> method gets inlined into a single &#8220;load constant&#8221; instruction:<a href=\"http:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/disasm.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2011\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/disasm.png\" alt=\"disasm\" width=\"924\" height=\"772\" srcset=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/disasm.png 924w, https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2016\/09\/disasm-300x251.png 300w\" sizes=\"(max-width: 924px) 100vw, 924px\" \/><\/a><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to easily embed binary files into your Embedded VisualGDB projects and access them from your code.<\/p>\n","protected":false},"author":1,"featured_media":2010,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[53,99,131],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/1997"}],"collection":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/comments?post=1997"}],"version-history":[{"count":1,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/1997\/revisions"}],"predecessor-version":[{"id":2012,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/1997\/revisions\/2012"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media\/2010"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=1997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=1997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=1997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}