Splitting the Atom back exit forward page 67-70

Appendix 1. Specification for the DISATOM SUPER ROM

The DISATOM is contained in a 4K ROM that is fitted in the utility socket (address A000). It contains two major areas: Machine Level with Memory Handling, and Additions to BASIC. It is permanently resident, does not require a LINK command, and does not use any addresses (such as zero page) you are likely to use. Most words may be abbreviated, and used in BASIC programs.

I. Additions to the BASIC language

A?68 AULD XX where XX is a hex number. This allows recovery of text from any text space that you wish (Celtic OLD!).
It executes ?#12=XX then OLD (See command PAGE XX).
A5A5 AUTO X,Y (or A.X,Y) produces automatic line numbering for writing programs, beginning at X in steps of Y.
Default is 100,10. RETURN or ESC exits.
A?BD COPY X,Y,Z copies everything from X to Y inclusive to the new location starting at Z. It takes account of the direction so the copy won't overwrite the source. COPY uses the same syntax as PLOT, so X, Y Z may be numbers, variable or arbitrarily complex functions enclosed in brackets. AVOID addresses that encompass 0000 or FFFF!
ABEA CURSOR X,Y places the cursor where you wish. X is horizontal, Y is vertical, and defaults are the current position, but either X or Y MUST be given. Thus CURSOR X will operate as a screen TAB(X). 0,0 is top left of screen. Does not operate after a NAK.
AB82 DELETE X,Y deletes all BASIC lines from X to Y inclusive. If X and Y are not specified DELETE will not operate.
A9CB DUMP prints out all simple BASIC variables which have currently been used, and their values.
AFCE DIR directory, to list all the functions of DISATOM.
AEDF ERUN runs a program with error check. If one is found the line is displayed with the cursor over the probable error.
AC39 EXEC$X where X is a string variable, results in the string being executed as a function. So for example
10 $A="Y=3*2+20/10"
20 EXEC$A

results in Y being set equal to 8. Any arbitrarily complex function or command is allowed in the string.
A699 FIND .A.T.O.M returns hex address of all locations containing the ASCII code for ATOM
  FIND [LDA@ 0;STA #80] returns hex address of all locations containing machine code A9 00 85 80
  FIND "PRINT X" displays all BASIC lines containing the words PRINT X.
  FIND 20 30 7F returns hex address of all locations containing machine code sequence 20 30 7F
A970
A9CB
HEADER X where X = 0 through 6, causes X lines at the top of the screen to NOT scroll, so anything can be used as a header. LOW or HEADER 0 cancels.
AF47 HELP makes anything coming in from a tap visible via the cursor. If the tape is faulty and a SUM ERROR occurs, an automatic *FLOAD is executed, so you can rewind a bit and continue loading any number of times. Syntax is:
HELP "filename"
Note - cannot be used to relocate!
A154 HIGH causes all cassette tape read or write operations to be performed at 1200 baud, and made visible in the cursor. The cursor symbol is forbidden in tape filenames. LOW returns rates to normal.
AE86 INKEY X,T where X is a variable, captures the key pushed in the variable. T is the time allowed to pushe the key, in units of 50 msec (defualt 0, max 128). if no key was pushed in the time allowed, the variable will contain an FF (255).
A12C up arrow as for HIGH, but for this one time only. E.g. up_arrow *LOAD"TEST" or up_arrow LOAD"MYTAPE" or up_arrow *SAVE 2900 3C00.
AC9A LOW causes all cassette tape read or write operations to be performed at 300 baud (normal Atom speed). This also returns all vectors in page 2 to normal values.
AFB6 NUKE the really thorough NEW. It punches FF into all RAM up to A000, then BREAKs.
AE78 ON ERROR (any valid command or function) will accomplish the command or function (usually a GOTO) when an error occurs instead of BREAKing.
A753 OUT X,Y causes output from the tape socket in RS232 format, with handshake. X=baud rate, Y=number of line feeds (default=1) per emitted line feed. Values of X are:
1 = 2400 baud
2 = 1200
4 = 600
8 = 300 etc. Default - 1200 baud.
Pin connections are:
6 = serial output
2 = earth
4 = handshake, which must have a 1K resistor to the printer's 5V handshake. If there is no handshake then connect this pin to 5V via a 1K resistor.
AC62 PAGE XX where XX are two hex digits. This has the effect of
?#12 = XX
NEW

This enable you to establish a new text space without fuss.
AE4D PULL N or U or R The Atom allows only a certain number of nests for FOR...NEXT, DO...UNTIL, and GOSUB...RETURN loops. PULL allows you to leave loops at any time by pulling the NEXT or UNTIL or RETURN from the memory.
ADDD-
C575-
A85D
READ-DATA-RESTORE This combinatio is used as in standard BASIC. However, this version is much more powerful. RESTORE can be used to:
  1. restore to the beginning of data
  2. restore a line number
  3. restore to a label
  4. restore to the line number arrived at by the solution of an equation
  5. restore to the next highest line number if the solution does not point to a line number

The DATA list can contain strings (in quotes), decimal and/or hex numerics, variables or arbitrarily compxe functions. The READ statement will accept ANYTHING that can be placed on the left of an equals sign! (e.g. READ$A+LEN A)). You can READ into bytes, words, arrays, variables, etc. E.g:

 5 C=15; DIM XX(1), Y(15),S(4)
10 x DATA "help", 10, 32, C+7
15 RESTORE 10 (or RESTORE C*/3 or RESTORE x or RESTORE)
20 READ $S; READ XX(1); READ Y(C); READ Z; END

Results in $S="help", XX(1)=10, Y(15)=32, Z=22.
ALWAYS RESTORE before attempting the first READ in the program (to set the data pointer)

  REN X,Y renumbers all BASIC lines to start at X and finish at Y (Default is 100,10) and then lists results.
AFE4 TAPE XXXX where XXX is a hex address. This captures anything on tape, including the header, and places it direct into memory starting at XXXX. Especially useful to recover badly damaged tapes.
ADB6 TONE X,$Y to create music and sounds.
A8D1 ZERO Sets all BASIC variables to zero.

II. Machine level functions

A56F
D xxxx
disassembles starting at location hex xxxx, and waits for the REPEAT key. Otherwise Dxxxx,yyyy doesn't wait. This will appear on the screen as:
ADDRESS OBJECT CODE SOURCE CODE ASCII EQUIVALENT

The # is not needed, and all xx's need not be used. For example, D80 disassembles at hex 80. REPEAT key continues, and ESC gets out of the mode. To edit, see instructions below.

A57A
H xxxx
hex dump starting at hex xxxx. This may be used to edit the memory as given below.Pushing REPEAT will continue the dump, and ESC exits the mode. Hxxxx,yyyy will dump without waiting for the REPEAT key.
A5??
A xxxx
ASCII dump of memory starting at hex xxxx. The contents of memory are displayed on screen as their ASCII equivalents. These may also be edited as given below. If there is no ASCII equivalent the hex is shown. Axxxx,yyyy will dump without waiting.
    Editing memory using the above routines
All the above modes will display memory contents as either a two-digit hex number (one byte), or its ASCII equivalent, in which case it will appear with a full stop in front (e.g. 41 will appear as .A in an ASCII dump). To change the memory contents, hit ESC, and the prompt > will return. Move the cursor over the line you want to edit, then COPY to the point on the line where you want to make the change. You may then type in EITHER the ASCII equivalent with a dot in front OR the two-digit hex number, and this may be done as may times as you wish along the line. At the end of the line hit RETURN and ESC. You need not go to the end of the line before hitting RETURN - the rest of the line will copyu automatically. This method of editing is used in all three of the above modes.
 
? xxxx A Y Y Sp S
Machine code trace function, where xxxx is the hex address of a machine code program. A X Y Sp S can be set before entry. A = Accumulator, ; X, Y = X and Y stack Sp = Stack pointer (always FF), S = Status register. Default is all zeros except Sp = FF. Type in the command and hit <CR>, then <SHIFT> executes the next instruction, but JSR without displaying the subroutine, while <REPT> shows the actions in the subroutine (these may be tortuous!). The top of the screen displays the contents of all the registers and all of the flags, plus the ASCII equivalent of the Accumulator contents.
A151
X xxxx
runs the machine code routine pointed to by location hex 180. On its own this has the effect of LINK (?180,180) or JMP(180). Your machine code routine MUST end in JMP #C55B. however, the real strength is that it is possible to put various parameters after the X, and then capture them using the 5,Y pointer. This function then becomes an invaluable development tool for machine code routines.

back exit forward