{"id":3230,"date":"2025-04-17T10:21:55","date_gmt":"2025-04-17T10:21:55","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?post_type=spl_knowledgebase&#038;p=3230"},"modified":"2025-06-10T07:41:42","modified_gmt":"2025-06-10T07:41:42","slug":"splat-pc-automatic-ram-allocation","status":"publish","type":"spl_knowledgebase","link":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/splat-pc-programming-software\/splat-pc-ram-allocation-schemes\/splat-pc-automatic-ram-allocation\/","title":{"rendered":"SPLat\/PC: Automatic RAM allocation"},"content":{"rendered":"\n<p>Automatic\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o414\">RAM<\/a>\u00a0allocation was introduced in July 2005 in SPLat\/PC V7.15.2. If you have an earlier version of SPLat\/PC none of the following applies. You can download the\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/download\/splat-pc-32-bit\/\">latest version of SPLat\/PC<\/a>\u00a0from our website.<\/p>\n\n\n\n<p>The purpose of automatic RAM allocation is to free you from having to work out exactly where in RAM to locate each and every variable in your program. It is essentially the same as the capability of programming languages optimized for computing (as distinct from control applications), which allow you to declare variables without concern about where in memory they will be located. As long as there is enough memory, they exist.<\/p>\n\n\n\n<p>The new directives introduced for automatic RAM allocation are:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><code>ByteVarName: <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/defbyte-directive\/\">defBYTE<\/a> n<\/code><\/td><td>Allocate n bytes<\/td><\/tr><tr><td><code>WordVarName: <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/defword-directive\/\">defWORD<\/a> n<\/code><\/td><td>Allocate n words (2 bytes per word)<\/td><\/tr><tr><td><code>AddrVarName: <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/defaddr-directive\/\">defADDR<\/a> n<\/code><\/td><td>Allocate n x 2 bytes for\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/callback-instructions\/suspend-mm-d12-15\/\">Suspend<\/a>\/<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/callback-instructions\/resume-mm-d12-15\/\">Resume<\/a>\u00a0address(es) for\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-examples\/tutorial-multitasking-superseded\/\">multitasking<\/a>.<\/td><\/tr><tr><td><code>LongVarName: <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/deflong-directive\/\">defLONG<\/a> n<\/code><\/td><td>Allocate n longs (4 bytes each)<\/td><\/tr><tr><td><code>FloatVarName: <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/deffloat-directive\/\">defFLOAT<\/a> n<\/code><\/td><td>Allocate n floating point variables (4 bytes each).<\/td><\/tr><tr><td><code>TimeVarName: <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/deftime24-directive\/\">defTIME24<\/a> n<\/code><\/td><td>Allocate n SuperTimers (3 bytes each) (In SPLat\/PC 7.16.0 and later)<\/td><\/tr><tr><td><code>SemVarName: <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/defsem-directive\/\">defSEM<\/a> n<\/code><\/td><td>Allocate n bits for a semaphores.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>For example, the program line<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">LoopCount:       defByte    1<\/pre>\n\n\n\n<p>will reserve one byte of RAM for a variable called&nbsp;<code>LoopCount<\/code>. The colon is optional. The address of that RAM byte will be remembered by SPLat\/PC, and each time you use it in an instruction that accesses RAM, the numeric address will be substituted for the label&nbsp;<code>LoopCount<\/code>.<\/p>\n\n\n\n<p>The line<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">fPressure        defFloat   3<\/pre>\n\n\n\n<p>will reserve enough RAM for 3 floating point variables called\u00a0<code>fPressure<\/code>. That will mean 12 bytes are reserved (4 bytes per floating point variable). In effect this has declared a 3-element array. The individual values would be addressed using\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/index-register-instructions\/\">indexed<\/a>\u00a0or\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/multitrack-advanced-multi-channel-operations\/\">jndexed<\/a>\u00a0addressing.<\/p>\n\n\n\n<p><code>defFLOAT<\/code>&nbsp;and&nbsp;<code>defLONG <\/code>both have the same effect at present. It some future version they may be treated differently, so it is advisable to use the most appropriate one (which almost certainly means&nbsp;<code>defFLOAT<\/code>). Similarly for&nbsp;<code>defADDR<\/code>&nbsp;and&nbsp;<code>defWORD.<\/code><\/p>\n\n\n\n<p>Each of the above directives is detailed in the Programming Reference under\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/directives\/\">Directives<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Automatic\u00a0RAM\u00a0allocation was introduced in July 2005 in SPLat\/PC V7.15.2. If you have an earlier version of SPLat\/PC none of the following applies. You can download&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3228,"menu_order":1,"template":"","class_list":["post-3230","spl_knowledgebase","type-spl_knowledgebase","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SPLat\/PC: Automatic RAM allocation - SPLat Controls<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SPLat\/PC: Automatic RAM allocation - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"Automatic\u00a0RAM\u00a0allocation was introduced in July 2005 in SPLat\/PC V7.15.2. If you have an earlier version of SPLat\/PC none of the following applies. You can download...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/splat-pc-programming-software\/splat-pc-ram-allocation-schemes\/splat-pc-automatic-ram-allocation\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-10T07:41:42+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/splat-pc-programming-software\/splat-pc-ram-allocation-schemes\/splat-pc-automatic-ram-allocation\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/splat-pc-programming-software\/splat-pc-ram-allocation-schemes\/splat-pc-automatic-ram-allocation\/\",\"name\":\"SPLat\/PC: Automatic RAM allocation - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"datePublished\":\"2025-04-17T10:21:55+00:00\",\"dateModified\":\"2025-06-10T07:41:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/splat-pc-programming-software\/splat-pc-ram-allocation-schemes\/splat-pc-automatic-ram-allocation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/splat-pc-programming-software\/splat-pc-ram-allocation-schemes\/splat-pc-automatic-ram-allocation\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/splat-pc-programming-software\/splat-pc-ram-allocation-schemes\/splat-pc-automatic-ram-allocation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SPLat\/PC programming software\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/splat-pc-programming-software\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"SPLat\/PC: RAM allocation schemes\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/splat-pc-programming-software\/splat-pc-ram-allocation-schemes\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"SPLat\/PC: Automatic RAM allocation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\",\"name\":\"SPLat Controls\",\"description\":\"OEM Embedded Machine Controllers\",\"publisher\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization\",\"name\":\"SPLat Controls\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg\",\"contentUrl\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg\",\"caption\":\"SPLat Controls\"},\"image\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SPLat\/PC: Automatic RAM allocation - SPLat Controls","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"SPLat\/PC: Automatic RAM allocation - SPLat Controls","og_description":"Automatic\u00a0RAM\u00a0allocation was introduced in July 2005 in SPLat\/PC V7.15.2. If you have an earlier version of SPLat\/PC none of the following applies. You can download...","og_url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/splat-pc-programming-software\/splat-pc-ram-allocation-schemes\/splat-pc-automatic-ram-allocation\/","og_site_name":"SPLat Controls","article_modified_time":"2025-06-10T07:41:42+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/splat-pc-programming-software\/splat-pc-ram-allocation-schemes\/splat-pc-automatic-ram-allocation\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/splat-pc-programming-software\/splat-pc-ram-allocation-schemes\/splat-pc-automatic-ram-allocation\/","name":"SPLat\/PC: Automatic RAM allocation - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"datePublished":"2025-04-17T10:21:55+00:00","dateModified":"2025-06-10T07:41:42+00:00","breadcrumb":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/splat-pc-programming-software\/splat-pc-ram-allocation-schemes\/splat-pc-automatic-ram-allocation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/splat-pc-programming-software\/splat-pc-ram-allocation-schemes\/splat-pc-automatic-ram-allocation\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/splat-pc-programming-software\/splat-pc-ram-allocation-schemes\/splat-pc-automatic-ram-allocation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/"},{"@type":"ListItem","position":2,"name":"SPLat\/PC programming software","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/splat-pc-programming-software\/"},{"@type":"ListItem","position":3,"name":"SPLat\/PC: RAM allocation schemes","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/splat-pc-programming-software\/splat-pc-ram-allocation-schemes\/"},{"@type":"ListItem","position":4,"name":"SPLat\/PC: Automatic RAM allocation"}]},{"@type":"WebSite","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/","name":"SPLat Controls","description":"OEM Embedded Machine Controllers","publisher":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization","name":"SPLat Controls","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg","contentUrl":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg","caption":"SPLat Controls"},"image":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase\/3230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase"}],"about":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/types\/spl_knowledgebase"}],"author":[{"embeddable":true,"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/users\/1"}],"up":[{"embeddable":true,"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase\/3228"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=3230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}