BBC BASIC for Windows
« Using REM!Fast for alignment »
Welcome Guest. Please Login or Register. Apr 5th, 2018, 10:39pm
ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018. Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.
If you require a dump of the post on your message board, please come to the support board and request it.
Topic: Using REM!Fast for alignment (Read 427 times)
rtr2 Guest
Using REM!Fast for alignment
« Thread started on: May 23rd, 2015, 11:55am »
One of the effects of REM!Fast is to align the specified scalar variable(s) - but not arrays - onto a DWORD boundary, i.e. an address which is an exact multiple of 4. This can contribute to a speed improvement but may also be useful in its own right.
For example if a variable is accessed from assembler code the primary effect of REM!Fast is irrelevant (the variable is accessed by name only when the code is assembled, so there is no benefit in speeding up this access) however aligning the variable may nevertheless have an advantage, such as guaranteeing atomicity.
Of course in a situation when a variable must be aligned then REM!Fast is not usually a good method, because it means the program cannot be tested in the IDE. Using a conventional method of achieving alignment (e.g. putting the variable in a structure) is normally more appropriate.