Jump to content


Night Stalker - In Progress (XB256 compiled)

53 replies to this topic

#51 majestyx OFFLINE  


    Chopper Commander

  • 194 posts
  • Location:Port Carbon, Pennsylvania

Posted Thu Mar 15, 2018 11:08 AM

because program size is equated both pre-RUN and post-RUN.

Once you run the program, the variable space is reserved for whatever you decide to call the variable... rather than having an integer value repeated a hundred times.

All thats left is a single, 1 byte reference to the integer. I could see how this might increase speed of the program as well. Write a simple test program and try it out. :D


Will definitely keep this in mind for any future programming projects I may attempt. Been far too busy recently to work on anything, but would love to get back to it soon.

#52 LASooner OFFLINE  


    Chopper Commander

  • Topic Starter
  • 206 posts

Posted Thu Mar 15, 2018 12:02 PM

I tried replacing all values of 1-4 with variables, it made no difference once compiled as Falcon suspected.

#53 Opry99er OFFLINE  



  • 8,982 posts
  • Location:Hustisford, WI

Posted Thu Mar 15, 2018 12:17 PM

I would guess that larger integers would work... any integers with two or more digits, which have 4 or more iterations.

Then again, perhaps not. Interesting test...

#54 InsaneMultitasker OFFLINE  



  • 1,902 posts

Posted Thu Mar 15, 2018 12:57 PM

The 'integer' values in a non-compiled XB program are floating point values.  Consumption is 8 (9?) bytes per variable.  You take a double hit since the value is stored in the program and the variable is allocated during prescan.  Are the compiled values represented as 16-bit integers?  I guess that's a question for Senior Falcon. 


If you have a lot of numeric variables to set, and they are 8 bit (0-255), you can save space by converting them into characters and storing them into a string.  You can also use strings as "numeric arrays" by using the SEG$, VAL, and CHR$ statements.  The message pointers for my BBS software are all stored in this fashion.  127 message pointers require 254 bytes of stack memory; a numeric array would cost 9*127 bytes of program space.  

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users