Skip to content

Instantly share code, notes, and snippets.

@thinkyhead
Last active December 31, 2016 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thinkyhead/b95e2424a6d63c2f3301bbd08b5ec168 to your computer and use it in GitHub Desktop.
Save thinkyhead/b95e2424a6d63c2f3301bbd08b5ec168 to your computer and use it in GitHub Desktop.
Line renumber in Atari BASIC
.
. AtariBASIC RENUM.BAS
. Renumbers lines only, not GOSUB/GOTO.
.
. Corrected version of
. http://www.atarimagazines.com/compute/issue10/042_1_ATARI_BASIC_A_LINE_RENUMBERING_UTILITY.php
.
. To save: L."D:RENUM.LST"
. To run: E."D:RENUM.LST":G.9000
.
9000 ? "RENUM UTILITY ACTIVE"
9010 ADDR=PEEK(136)+PEEK(137)*256
9020 ? "INPUT STARTING NUMBER AND"
9030 ? "INCREMENT (FORMAT X, Y)"
9040 INPUT START,INCR
9050 LNUM=PEEK(ADDR)+PEEK(ADDR+1)*256
9060 NADR=ADDR+PEEK(ADDR+2)
9070 IF LNUM=32768 OR LNUM=9000 THEN 9110
9080 LO=INT(START/256):HI=INT(START-(LO*256))
9090 POKE ADDR,HI:POKE ADDR+1,LO
9100 START=START+INCR:ADDR=NADR:G.9050
9110 ? "RENUMBERING ENDED AT";START-INCR
9120 END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment