Menu

Including asm code in BASIC?

Help
2008-02-04
2013-05-30
  • Nobody/Anonymous

    I'm just starting out here.  Is there a way to use a block of assembly code in the BASIC program?  I tried to include it, but that doesn't seem to be the way.  I am using Crimson Editor with GCBASIC.

    Thanks

     
    • Hugh Considine

      Hugh Considine - 2008-02-04

      How big is the block of assembly code?

      If it's only a few lines (ie. less than an entire subroutine), then you can just put the assembly code in amongst the GCBASIC code. GCBASIC will recognise it and pass it straight through to the assembler.

      If you're trying to paste in several assembly subroutines, you'll need to mark the start and end of each assembly subroutine by adding "Sub somename" before each assembly sub, and "End Sub" after each one.

      #include doesn't work the same way in GCBASIC as it does in other languages - it just tells GCBASIC to load the subroutines and constants in the included file after it's finished reading the current file.

       
    • Nobody/Anonymous

      OK so basically I need to paste the asm code directly into the BASIC code.  I thought there might be a way to link to .asm files that had a definition or subroutine structure.

      Thanks

       
      • Retlif Wen

        Retlif Wen - 2008-03-03

        ya. that would be nice to be able to link to an external .asm files

         

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.