BBC BASIC
« Assembler use of static variables »

Welcome Guest. Please Login or Register.
Mar 31st, 2018, 10:38pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Cross-platform BBC BASIC (Windows, Linux x86, Mac OS-X, Android, iOS, Raspberry Pi)
BBC BASIC Resources
BBC BASIC Help Documentation
BBC BASIC for Windows Home Page
BBC BASIC Programmers' Reference
BBC BASIC Beginners' Tutorial
BBC BASIC for SDL 2.0 Home Page
BBC BASIC Discussion Group

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Assembler use of static variables  (Read 34 times)
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 803
xx Assembler use of static variables
« Thread started on: Mar 26th, 2018, 11:12am »

A proposal has been made at the discussion group that the BBC BASIC assembler be adapted for 64-bit addressing as follows:
  • The 'program counter', which is P% in all previous versions, will become P% (low 32-bits) + Q% (high 32-bits).

  • The 'code limit', which is L% in all previous versions, will become L% (low 32-bits) + M% (high 32-bits).
(The 'code origin', O%, is virtually never used so is not considered here; see the group for more details).

The implication of this proposal is that allocation of memory for the assembler would need to be done like this, or similar:

Code:
      DIM limit -1, mcode size%, limit -1
      FOR pass% = 8 TO 10 STEP 2
        P% = !^mcode : Q% = mcode>>32
        L% = !^limit : M% = limit>>32
        [OPT pass%
        ....
        ]
      NEXT pass% 

An alternative approach, using the 64-bit indirection operator in the 64-bit versions of BBC BASIC, would be as follows:

Code:
      DIM limit -1, mcode size%, limit -1
      FOR pass% = 8 TO 10 STEP 2
        ]^P% = mcode 
        ]^L% = limit
        [OPT pass%
        ....
        ]
      NEXT pass% 

If anybody has any comments on, or objections to, these proposals speak now or forever hold your peace!

Note that there is currently no 64-bit assembler to take advantage of these changes; I am relying on both the x86-64 and aarch64 assemblers being contributed by users, and to date nobody has offered to do so.

Richard.
« Last Edit: Mar 26th, 2018, 11:16am by Richard Russell » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls