1. 15
  1.  

    1. 1

      Would this work for other 6502 systems like the Atari 2600? Is it possible to use this together with assembly?

      Edit: it misses some obvious optimizations. At the end there is

          ldx #0
      L1:
          inx
          bne L1
      

      But that could be simplified to just

          ldx #0
      
      1. 1

        From reading the article, It think it was implied that the code example should have been:

                ldx     #0
        L1:
                ; more code here
                inx
                bne     L1
        

        That part of the article was about optimizing loops after all.

        1. 1

          Oh yeah I missed the “this is how a loop would look”. I would probably do all this by formulating the problem as an integer program. What the author says about pruning can probably be handled by a mixed integer program solver implementing branch-and-bound.