Index/Preface | Chapter I | Chapter II | Chapter III | Chapter IV | Chapter V

Jump Table | Memory Map | Using Modules | Using ML Modules | RS232 Routines | Swapper | The Lightbar | The System Editor

Chapter III: Machine Language Subroutines

 Jump Table Routines (& Commands) - v1.2


Routine

Description:

0 - outastr

Output routine. Handles MCI.

Examples:

&

&"text"

Display A$.

Display text.


1 - inline

Input routine. Handles word wrap, MCI access, line length, and graphics. Before calling, use POKE 53252,<line length> to set the line length. W$ is the text that is wrapped, and AN$ holds the inputted text.

Usage:

&,1,x,y

x=

Bit | value

Use

    0 | 1

Graphics allowed

    1 | 2

"." on column 1 exits

    2 | 4

Disable P$ prompt

    3 | 8

Allow MCI

    4 | 16

Text wrap on

    5 | 32

Edit mode on

    6 | 64

Ignore time expired

    7 | 128

Delete on column 1 exits

y= [This part was left blank in the original document.]

Examples:

POKE 53252,10:P$="Name?":&,1
Prompts user for name, and allows up to ten characters to be entered.
POKE 53252,20:W$=NA$:P$="Handle":&,1,32:IF AN$<>"" THEN NA$=AN$
Prints prompt, then old handle, and then the prompt again, and allows the user to enter a new handle.

2 - dskin

File input routine, which will input a maximum of 80 characters into the variable A$. Also allows bytes to be read directly from a file into a variable.

Usage:

&,2,file#,0

&,2,file#,N

Normal input, stop at CHR$(13)

Input up to N bytes into A$, ignoring CHR$(13)


3 - read0

File read routine, also allows an optional speed variable for Movie Files. Using a speed of 0 uses the normal file read, whereas using any other value uses the Movie File read, with an appropriate slowdown based on the speed value.

Usage:

&,3,file#

&,3,file#,speed

Normal file read

View Movie File


4 - getmdm

Get a character from the modem. This returns the character that was received in location 780. This routine does no ASCII translation, and no high bit stripping. It gets the character directly from the RS232 routines.

Usage:

&,4:A=PEEK(780)


5 - getversn

Get the version number information that is embedded into the ML. This puts the revision number into A% and the revision date into A$.

Usage:

&,5


6 - password

Password input. Sets text length to 14 characters, and inputs a password. Mask character is printed rather than the real character that is typed. Password is returned in AN$.

Usage:

&,6


7 - prg

Loads modules into memory. The filename and drive number are in A$, and the device number is passed directly in the command.

Usage:

DR=5:GOSUB 1010:A$=DR$+"+.<filename>":&,7,DV%

Loads a +.file from the +.file disk

DR=5:GOSUB 1010:A$=DR$+"+.nm.file":&,7,DV%,1

Loads a mini-module from the +.file disk. See the section on "Using Modules" for more information.


8 - dskdir

This will read the directory from a file that was opened as a directory channel.

Usage:

DR=1:GOSUB 1010:OPEN 2,DV%,0,"$"+DR$+"*":
&,8,2:CLOSE 2

This reads the directory from the system disk.

DR=2:GOSUB 1010:OPEN 2,DV%,0,"$"+DR$+"m.*":
GET #2,A$,A$:&,8,2,1:&,8,2,1:CLOSE 2

This reads the first entry for the first E-mail file into A$.


9 - btmvar

This displays the contents of a variable at the bottom of the screen. The variable displayed can be either A$ or AN$.

Usage:

&,9

&,9,1

Display AN$

Display A$


10 - term

This is the terminal mode that is used in Image Term. To exit term mode, press the C= and CTRL keys together.

Usage:

&,10


11 - clrarr

This is used to clear the contents of an array. Any of the arrays can be cleared, except BF().

Usage:

&,11

&,11,1

&,11,2

Clear TT$().

(This was left blank in the original document.)

(This was left blank in the original document.)


12 - newusr

This is the same as the normal file read, except the file read is non-abortable, and the speed option is not supported.

Usage:

&,12,file#


13 - inchr

This is the "get character" routine. Like the MCI Get (£G), it waits for a character from either the keyboard or the modem, and returns it in AN$.

Usage:

&,13


14 - bell1

Sounds a bell

Usage:

&,14


15 - convan

Converts AN$ from an 11-byte date to text. The resulting text string is placed back into AN$.

Usage:

&,15


16 - sys49152

This does a SYS 49152 to call a protocol.

Usage:

&,16


17 - sys49155

This does a SYS 49155 to call a protocol.

Usage:

&,17


18 - setmode

Set the screen mode (1=split, 0=full)

Usage:

&,18,0

&,18,1

Set full screen mode

Set split screen mode


19 - disp1

Display top of screen for user online. This loads the appropriate scn.* files.

Usage:

&,19,device#,drive#


20 - disp2

Display top of screen for system idle. This loads the appropriate scn.* files.

Usage:

&,20,device#,drive#


21 - disp3

Display bottom of screen.

Usage:

&,21,device#,drive#


22 - tenwait

Time delay. This will wait for any interval between .1 second to 25.5 seconds, in 1/10 second steps.

Usage:

&,22,tenths


23 - xgetin

This is the get character routine that should be used when writing ML routines that need to get a character from the user. The character is returned in location $FE.


24 - xchrout

This is an output character routine that should be used when writing ML routines that need to output a character to the user.


25 - sound

Makes various sounds.

Usage:

&,25

&,25,1

&,25,2

Beep

Siren

Bell


26 - getmdm

Same as &,4.


27 - arraysav

Save variable pointers. This saves the pointers that tell where BASIC variables start and end, so they can be later restored to erase unnecessary variables.

&,27


28 - arrayres

Restore array pointers.

&,28


29 - usevar

Get contents of a variable. This is the routine to call to read the value of a variable from machine language. The X register holds the variable # to access (see variable table). The contents of the variable is read into the buffer at $61.


30 - putvar

Put value into a variable. This stores the contents of the buffer at $61 into a variable. The routine is meant only to be called from ML routines. The X register holds the variable # (see variable table).


31 - zero

Set value to floating point 0. This stores the floating point equivalent of 0 into the buffer at $61.


32 - minusone

Set value to floating point -1. This stores the floating point equivalent of -1 into the buffer at $61.


33 - getarr

Get descriptor for TT$(X). This get the descriptor (length and pointer) of an element of the TT$ array. The element # is in the X register. The descriptor is stored in the buffer at $61.


34 - putarr

Put descriptor for TT$(X). This stores the buffer at $61 as an element of the TT$ array. The element # is passed in the X register.


35 - getln

Get string for TT$(X) into buffer. This gets the descriptor for an element of TT$() into the buffer at $61 and gets the corresponding string into the general text buffer at $CE77.


36 - putln

Put string in buffer to TT$(X). Used in protocols.


37 - trapon

Turn error trap on

Usage:

&,37


38 - trapoff

Turn error trap off

Usage:

&,38


39 - prtln

Print TT$(X). Used in protocols.


40 - forcegc

This routine will force a fast garbage collect. This can be useful when you need to find out exactly how much memory is available.


41 - setbaud

This sets the baud rate that IMAGE will use. Note that you should not change the baud rate while someone is connected, since this only changes the rate at which IMAGE sends/receives, and the modem will not follow.

Usage:

&,41,x

x=0

300 BPS

x=1

Not used

x=2

1200 BPS

x=3

2400 BPS


42 - reserved

Internal usage


43 - reserved

Internal usage


44 - chatchk

Checks for the presence of the Cht check mark.


45 - prtvar

Will print a variable.


46 - prtvar0

Will print a variable with MCI forced off.


47 - carchk

Will check for presence of a carrier.


48 - getkbd

Gets a character from the keyboard.


49 - getmod

Gets a character from the modem, using ASCII translation.


50 - outscn

Outputs a character to the IMAGE window.


51 - outmod

Outputs a character to the modem with ASCII translation.


52 - chkflags

This is the BASIC interface to the Lightbar.

Usage:

Described in the section "The Lightbar."


53 - disp4

Loads the display for the IMAGE Terminal menu.


54 - editor

This is the BASIC interface to the Editor.

Usage:

Described in the section "The Editor."


The flags that can be used for the input routine are in the form of bits. Each value turns one option on or off:

1

Allow graphics characters

2

Disable "." on column 1

4

Disable P$ (prompt)

8

Disable £ key

16

Word wrap on

32

Edit mode on

64

Ignore timeout


Variable Table:

0 AN$    5 D2$   10 TT$   15 LP$   20 NL    25 EF    30 A%    35 C2$
1 A$     6 D3$   11 NA$   16 PL    21 UL    26 LF    31 B%    36 CO$
2 B$     7 D4$   12 RN$   17 RC    22 QE    27 W$    32 DV%   37 CH$
3 TR$    8 D5$   13 PH$   18 SH    23 RQ    28 P$    33 DR$   38 KP%
4 D1$    9 LD$   14 AK$   19 MW    24 AC%   29 TR%   34 C1$         

[ Ryan's Web Page | Index/Preface | Chapter I | Chapter II | Chapter III | Chapter IV | Chapter V