Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6568581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:29:48+00:00 2026-05-25T14:29:48+00:00

The title is basically it. I have lights that i need to switch on

  • 0

The title is basically it.

I have lights that i need to switch on and off. There is a button that dictates which light it should be. So when the button is pressed or not pressed, i modify a variable that contains the PORT address of that light. To turn a light on i have to store $00 at that address. For instance:

;**********************************************************
;LED1on subroutine
;
;   This will turn LED 1 on, and then return.

LED1on
        LDAA        #$00        ; Load $00 into accumulator a (the value to turn the light on)
        STAA        $PORTA      ; Store the loaded value into PORTA, PORTA is a MACRO that =$0000

        RTS                     ; Return to sender

So what i want to do is have a variable, PoSelect=$0000. And use it instead.

;**********************************************************
;LED1on subroutine
;
;   This will turn LED 1 on, and then return.

LED1on
        LDAA        #$00        ; Load $00 into accumulator a (the value to turn the light on)
        STAA        PoSelect    ; PoSelect is a variable that contains a port address

        RTS

This however just stores the contents of ‘accumulator a’ into the variable PoSelect. What i want to do, is store the contents of ‘accumulator a’ into the address that is stored at the variable PoSelect. Essentially using the variable PoSelect like a pointer.

How do i do that???

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:29:49+00:00Added an answer on May 25, 2026 at 2:29 pm

    Assuming this is HC11, you might want to use indexed addressing, something like:

    LDX         PoSelect      ; load address from PoSelect to IX register
    STAA        0,X           ; store contents of A register to the address in IX
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically what the title says... I need to have an image that when clicked,
The title basically spells it out. What interfaces have you written that makes you
The title of this question should be self explanatory, but basically I have this
Amazingly, the title basically explains it. We have a page that our client made
The title basically says it all. Suppose I have an element which I want
I'm not really sure how to title this question but basically I have an
Sorry if the title doesn't make sense. Basically I have a series of strings
I'm not sure if the title is very clear, but basically what I have
The title basically says it all. I have a hexadecimal string representing a private
Sorry about the title — wasn’t sure how to word it. Basically I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.