Menu

Input/Output question

Help
2010-02-23
2013-05-30
  • FireAndForget

    FireAndForget - 2010-02-23

    Okay, so in assembly, for certain tasks, it's really convenient when you've got a port setup as all outputs, to be able to send an 8bit number to the PORT register and do all your output in one command. In GCBASIC I can use the Set command but that only allows me to set a bit at a time, which means many repeated commands. Is there a way to shift a byte straight to a PORT register? the DIR command can be used to do this in entire port mode for the tristate register but what if we want to do it to output more efficiently? Is this possible?

     
  • FireAndForget

    FireAndForget - 2010-02-23

    I also notice that there's no way to use DIR in Entire Port Mode unless you switch to text editing.

     
  • FireAndForget

    FireAndForget - 2010-02-23

    Ah. I see the POKE command can be used but there's no way to do this at a higher level. You can't just specify "PORTB" to poke, you have to know the exact memory position for the chip.

     
  • Hugh Considine

    Hugh Considine - 2010-02-23

    You can treat the ports like variables. Try this:

    PORTB = 255
    
     
  • FireAndForget

    FireAndForget - 2010-02-23

    Ah, thanks!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.