CircuitGizmos

Electronic Products for Creative Minds

  • Home
  • Gizmo Store/Products
  • Documentation/Datasheets
  • Projects/Libraries
  • GizmoBlog
  • Services/Contact
    • Design
    • Contact Gizmo!
  • Your Gizmo Cart
    • Your Account
You are here: Home / GizmoBlog / MMBasic Language / Programming, and Debugging / CHAIN

CHAIN

CHAIN file$

Clear the current program from memory and run the new program (‘file$’) starting with the first line.

Unlike the RUN command this command retains the current state of the program (ie, the value of variables, open files, loaded fonts, open COM ports, etc). The only exception is that any open interrupts will be automatically closed.

One program can CHAIN to another which can then chain to another (or back to the original) an unlimited number of times.

The CHAIN command automatically runs the RESTORE command (reset the DATA pointer) following the successful chain to a new program.

As long as a program can be broken down into modules this command allows programs of almost unlimited size to be run, even with limited memory. Communication between the modules can be accomplished by assigning values to one or more variables which then can be examined by the new chained program.
Note that another way of squeezing a large program into limited memory is to use the LIBRARY command.

See also:
LOAD
NEW
RUN
SAVE
WATCHDOG

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

A Ton of Documentation

Open all | Close all

Projects made by Gizmo, Friends, and Members

open all | close all

Recent GizmoBlog Musings

  • Altair 8800 using a ColorMax!
  • Re-energizing the ColorMax, Pt. 3

Visit us!

  • Facebook

Electronic Products for Creative Minds

CircuitGizmos is your source for electronic products that help you create your embedded projects. Here at CircuitGizmos.com you will find a friendly store filled with creative products and all of the documentation that you need to use these gizmos.

We create devices that we believe make electronics fun, but we also know that our products are used for professional designs. For decades we have designed products for commercial, military, and medical industries. Our gizmos here are great for engineers and hobbyists alike.

Copyright © 2008+ CircuitGizmos, L.L.C. All rights reserved

Image already added

Recently Viewed Products

Copyright © 2025 · Generate Pro Theme on Genesis Framework · WordPress · Log in