Call 71 – rom/ram to rom program transfer, Call 72 – ram/rom return, Purpose – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 105: Syntax, Example

Advertising
background image

Publication 1746-RM001A-US-P

Execution Control and Interrupt Support Functions 8-9

CALL 71 – ROM/RAM to
ROM Program Transfer

Purpose

Use CALL 71 to transfer from a running ROM or RAM program to the beginning
of any available ROM program. One argument is PUSHed (which ROM
program). None are POPped. An invalid program error displays and you enter the
Command mode if the ROM number does not exist.

Syntax

PUSH [ROM program number]
CALL 71

Example

>1

REM EXAMPLE PROGRAM

>10 REM THIS ROUTINE WILL CALL AND EXECUTE A ROM ROUTINE

>20 INPUT “ENTER ROM ROUTINE TO EXECUTE”,N

>30 PUSH N

>40 CALL 71

>50 END

>RUN

ENTER ROM ROUTINE TO EXECUTE 4

You are now executing ROM 4, if it exists. If the ROM routine requested does not
exist the result is:

PROGRAM NOT FOUND.

READY

>

CALL 72 – RAM/ROM
Return

Purpose

Use CALL 72 to return to the ROM or RAM routine that called this ROM or
RAM routine. Execution begins on the line following the line that CALLed the
routine. No arguments are PUSHed or POPped. This routine works one layer
deep. Program control reverts to the line following the CALL in the previous
program.

IMPORTANT

The first line of the ROM program is not executed. We
recommend that you make it a remark.

IMPORTANT

There must be a next line in the ROM or RAM routine,
otherwise unpredictable events could occur that may destroy the
contents of RAM. For this reason, always be sure that at least one
END statement exists following a CALL 70 or 71.

Advertising