A Comparative ROM Atlas: From Spectrum to TS2068

See all articles from SINCUS v6 n4

The Abandonment of the computer scene by the Timex Corp. have caused us, the users, to fall on hard days because of lack of software and hardware support. The only avenue of support for our computers is either through conversion of Spectrum software, or through the use of the Spectrum emulator in conjunction with the TS2068.

In order to facilitate the software conversion process, it is essential to be equipped with an atlas of the memory maps, establishing the correspondence of addresses between the two computers. Such an atlas should also benefit MC programmers in effectively utilizing the ROM routines. Finally, it is hoped that the Atlas will help all the PEEKers, the curious, and the explorers of TS-Land in using the supplied addresses as beacons to find their path in the ROM maze.

The organization of the Atlas is based on ascending addresses of the Spectrum ROM. The labels and names are those used by Ian Logan and Frank O’Hara in their excellent book, “The Complete Spectrum ROM Disassembly”, available from Melbourne House and Zebra Systems. As such, the book is indispensable for the purpose of efficient MC programming and for software conversion.

The Atlas then provides the corresponding ROM addresses for the TS2068, and all the names and labels I could find in Corcoran and Branigin’s “Timex 2068 Technical Manual”.

To obtain the disassembly of the TS2068 16K Home ROM as well as the 8K Extension ROM (EXROM), one needs a good disassembler. Ray Kingsley’s HOT Z-2068 assembler-disassembler is very highly recommended (see SYNTAX May issue). The HOT Z has a large NAMES file which can be loaded with the program, providing subroutine names and some labels for the disassembly. The HOT Z self starts in the disassembly mode, displaying the 16k Home ROM from address 0000H.

The 8K EXROM overlays the first 8K chunk of the 16K Home ROM. In order to either disassemble or use the routines in the EXROM the bank-switching logic should be activated, the desired task performed, and then the EXPROM is to de-activated.

To illustrate, in the following example the content of the EXROM is copied to the RAM starting at location 8000H, where it can be disassembled and displayed.

DI                    LD BC,2000
LD A,01 LDIR
OUT (F4),A XOR A
IN A,(FF) OUT (FF), A
SET 7,A OUT (F4),A
OUT (FF),A EI
LD HL,0000 RET
LD DE,8000

The use of the EXROM subroutines is illustrated in the next example. The routine is for reading the “header” on TS2068 tapes. The “header” constitutes of 17 bytes of information on program name, whether it is Basic, MC, Data, etc., and whether it is auto-starting and from what line, the # of bytes, etc. (See chart on P. 112 of TS Tech. Manual). The routine jumps to the EXROM, and uses the R-TAPE subroutine at 00FCH. The 17 bytes of “header” information is stored in the RAM starting at location 8000H.

SCF                   LD, A,01
LD A,00 OUT (F4),A
LD IX,8000 POP AF
LD DE,0011 CALL R-TAPE
DI LD A,(5C81)
PUSH AF OUT (F4),A
IN A,(FF) IN A,(FF)
SET 7,A RES 7,A
OUT (FF),A OUT (FF),A
IN A,(F4) EI
LD (5C81),A RET

The use of the above routine with a suitable Basic program, greatly facilitates the conversion process by identifying the various parts of a program, storage requirements, starting addresses, etc.

A final note concerning the EXROM disassembly for TS2068, and a comparison to Logan’s Spectrum disassembly is in order. The Atlas shows that all cassette handling routines in the TS2068 are located in the EXROM. These routines depend on subroutines and RST’s in the Home ROM. Thus whenever a RST or a call to the Home ROM is necessary, bank switching has to be performed. To achieve this, corresponding to every CALL or RST in the Spectrum cassette handling routines, there exists a 23 byte code segment in the TS2068 EXROM, which starts with a PUSH IX and terminates with POP IX. The purpose of the code is preserving, and setting up of some registers, as well as a call to a service routine at 0F99H in the EXROM. The service routine transfers the calls to the bank switching code in the RAM, which in turn completes the call to the Home ROM.

Copy Right , N.A. Pashtoon Aug. 1984
Published in Nov. ’84 SYNTAX

CROSS REFERENCE TABLES TS2068 TO SPECTRUM

In the following tables the routines in TS 2068 are provided in alphabetical order, as supplied in the TS2068 Technical Manual. The Address for the corresponding Spectrum routine is then provided. Thus if you are in possession of the TS2068 disassembly, you may check the following cross reference tables, you will obtain the address of the Spectrum routine. Then you can consult your copy of Logan and O’Hara’s Spectrum ROM Disassembly, and obtain the necessary information for programming your TS2068 properly. N.A. Pashtoon

CROSS REFERENCE TABLES. TS2068 to SPECTRUM

LOAD MAP
MODULE      ORIGIN   LENGTH

BLOCK        0000     0000
BASIC        0000     0227
KSCAN        0227     02D9
IO_1         0500     0502
IO_2         0A02     031B
EDIT         0D1D     0682
CHANS        139F     0142
LIST         14E1     02D4
AROS         17B5     0190
SYNTAX       1945     080A
SYNTWO       214F     04B4
GRAPHS       2603     0251
EXPRN        2854     041C
IDENT        2C70     03E9
INOUT        3059     0301
SUMS         335A     032A
CALC         3684     0437
FUNCTS       3ABB     01CE
TAPEMSG      3C89     0053
CH_SET       3D00     0300

GLOBAL      ADDRESS  MODULE    Speccy
                               addr.
ACS          3C5E    FUNCTS
ADD          33D3    SUMS      3014
ALNUM?       3046    IDENT     2C88
ALPHA?       304B    IDENT     2C8D
ANGLE        3B9E    FUNCTS    3783
AROS         18C6    AROS      ----
ARRAY        37C5    CALC      3406
AR_LN        17EA    AROS      ----
AR_NXT       17FF    AROS      ----
ASN          3C4E    FUNCTS    3833
ATN          3BFD    FUNCTS    3762
ATTBYT       0710    IO_1      0BDB
BEEP         0436    KSCAN     03F8
BORDER       243E    SYNTWO    2294
BREAK?       2009    SYNTAX    1F54
CAT          25C8    SYNTWO    1793
CHCODE       0371    KSCAN     0333
CHINIT       11AA    EDIT      15AF
CHK_SZ       1FBB    SYNTAX    1F05
CIRCLE       2679    GRAPHS    2320
CLCHAN       13BE    CHANS     1701
CLEAR        1F36    SYNTAX    1EAC
CLEL         133F    EDIT      1680
CLLHS        08A9    IO_1      0D6E
CLOSE        139F    CHANS     16E5
CLPR         0A35    IO_2      0EDF
CLR_BC       1F39    SYNTAX    1EAF
CLS          08EA    IO_1      0DAF
CLS_B        097F    IO_1      0E44
COLITM       23A6    SYNTWO    21FC
COLOUR       23DE    SYNTWO    2234
CONT         1EE4    SYNTAX    1E5F
COS          3BC5    FUNCTS    37AA
CP_BC        16E8    LIST      1980
CTRO         371A    CALC      335B
DATA         1E82    SYNTAX    1E27
DEF          201D    SYNTAX    1F60
DELREC       1750    LIST      19E8
DELSYM       087B    IO_2      1015
DEL_DE       174D    LIST      19E5
DEL_K        0BFE    IO_2      1097
DESLUG       0D0D    IO_2      11A7
DE_HL        1668    LIST      191C
DIGIT?       30D9    INOUT     2D1B
DIM          2FC0    IDENT     2C02
DIVIDE       356E    SUMS      31AF
DRAW         26DB    GRAPHS    2382
DRAWLN       2813    GRAPHS    24BA
DRAW_L       2810    GRAPHS    24B7
DUMPPR       0A23    IO_2      0ECD
DYADIC       1BDC    SYNTAX    1C79
ECHO         0C83    IO_2      111D
EDIT_K       0A82    IO_2      0F2C
END?         1B44    SYNTAX    1BEE
ENDSTT       1AB9    SYNTAX    1B76
ENDTEM       1B4A    SYNTAX    1BF4
ERASE        25D4    SYNTWO    1793
ERR2         1B91    SYNTAX    1C2E
ERR4         1FCF    SYNTAX    1F15
ERR5         07C1    IO_1      0C86
ERR6         356C    SUMS      31AD
ERRB         1F29    SYNTAX    1E9F
ERRH         237E    SYNTWO    21D4
ERRO         123D    EDIT      160E
EXCUTE       1AD8    SYNTAX    1B8A
EXP          3ADF    FUNCTS    36C4
EXPRN        2854    EXPRN     24FB
FIND_L       16D6    LIST      196E
FIND_N       2C70    IDENT     28B2
FIX_U        1F23    SYNTAX    1E99
FIX_U1       1F1E    SYNTAX    1E94
FLASHA       160D    LIST      18C1
FLOAT        3656    SUMS      3297
FOR          1C78    SYNTAX    1D03
FORMAT       25CC    SYNTWO    1793
FP2A         3193    INOUT     2DD5
FP2BC        3160    INOUT     2DA2
F_ATTR       28D7    EXPRN     2580
F_INKY       29F2    EXPRN     2634
F_PI         29E5    EXPRN     2627
F_PNT        2624    GRAPHS    22CB
F_SCRN       288E    EXPRN     2535
GETAL        17CF    AROS      ----
GET_EL       2D54    IDENT     2996
GET_LN       1324    EDIT      1695
GET_XY       2660    GRAPHS    2307
GO_SUB       1F99    SYNTAX    1EED
GR_COL       238C    SYNTWO    21E2
HIFLSH       241D    SYNTWO    2273
INCH         11E1    EDIT      15E6
ININT        30F9    INOUT     2D3B
INIT         0D31    EDIT      11CB
INPUT        222B    SYNTWO    2089
INSi         12B8    EDIT      1652
INSA         0AE7    IO_2      0F81
INSERT       12BB    EDIT      1655
INT          3ACA    FUNCTS    36AF
INTDIV       3ABB    FUNCTS    36A0
INTPT?       2889    EXPRN     2530
IN_K         0C0E    IO_2      10A8
I_SEQ        226B    SYNTWO    20C1
JUMP         1EF1    SYNTAX    1E67
K_BASE       035C    KSCAN     031E
K_CLS        08A6    IO_1      0D6B
K_DUMP       0A02    IO_2      0EAC
K_LIST       1545    LIST      17F9
K_LLST       1541    LIST      17F5
K_LPR        2155    SYNTWO    1FC9
K_NEW        0D1D    EDIT      11B7
K_PRIN       2159    SYNTWO    1FCD
K_SCAN       02B0    KSCAN     028E
LCU2         132D    EDIT      169E
LDDE         313D    INOUT     2D7F
LDMES        3CA8    TAPEMSG   ----
LDTVCU       061A    IO_1      0B03
LE3          0055    BASIC     0055
LED18        0E2F    EDIT      12A9
LED4         0E8D    EDIT      1303?
LET          2EBD    IDENT     2AFF
LINENO       1768    LIST      198F
LIST         14E1    LIST      1795
LN           3B2E    FUNCTS    3713
LPO          15AC    LIST      1860
LS4          1A44    SYNTAX    1828
LT22         1BBC    SYNTAX    1C59
MOVE         25D0    SYNTWO    1793
MULT         3468    SUMS      30A9
NC_HL        0077    BASIC     0077
NEGATE       382D    CALC      346E
NEW          0D7F    EDIT      1219
NEWDEV       24D2    SYNTWO    ----
NEXT         1D55    SYNTAX    1DAB
NEXTCH       0074    BASIC     0074
NEXT_L       165B    LIST      190F
NOTKB?       2380    SYNTWO    21D6
NXT_HL       2C69    EXPRN     28AB
OPCHAN       1465    CHANS     175D
OPEN         142A    CHANS     1736
OPTNO        1C49    SYNTAX    1CDE
OUTPUT       31A1    INOUT     2DE3
PAEDCB       2E74    IDENT     2A86
PARP         03F3    KSCAN     0385
PASSEM       25B9    SYNTWO    ----
PAUSE        1FEF    SYNTAX    1F3A
PHLAF        004F    BASIC     ?
PLOT         2635    GRAPHS    22DC
PLOTBC       263E    GRAPHS    22E5
PLUGIN       0000    BASIC     0000
POPSTR       2FAF    IDENT     2BF1
PRSCAN       0A4A    IO_2      0EF4
PR_CUR       162D    LIST      18E1
PR_TV2       0776    IO_1      0C3B
PSHSTR       2E70    IDENT     2AB2
PUT          15C9    LIST      187D
PUTDIG       11EA    EDIT      15EF
PUTMES       073F    IO_1      0C0A
PUT_BC       1788    LIST      1A1B
PUT_LN       1795    LIST      1A28
PUT_SR       15A1    LIST      1855
P_LFT        053A    IO_1      0A23
P_NL         0566    IO_1      0A4F
P_RT         0554    IO_1      0A3D
P_$EQ        217E    SYNTWO    1FDF
RAMNO        377F    CALC      33C0
RAND         1ED4    SYNTAX    1E4F
RDCH         11CF    EDIT      15D4
READ         1D96    SYNTAX    1DEC
RECLEN       1720    LIST      19B8
REMGSZ       12CA    EDIT      1664
RESET        1354    EDIT      16C5
RESTBC       1ECA    SYNTAX    1E45
RETURN       1FD4    SYNTAX    1F23
RND          29B6    EXPRN     25F8
ROOM?        3768    CALC      33A9
ROOT         3C65    FUNCTS    384A
RSET         2454    SYNTWO    ----
RSTSTR       13A8    CHANS     16EB
R_ATTS       0888    IO_1      0D4D
SCRL         0939    IO_1      0DFE
SCRMBL       2603    GRAPHS    22AA
SEARCH       136B    EDIT      16DC
SELECT       1230    EDIT      1601
SEL_HL       1248    EDIT      1615
SENDCH       11ED    EDIT      15F2
SENDTV       0500    IO_1      09F4
SEPRMT       3C89    TAPEMSG   ----
SETCUR       0914    IO_1      0DD9
SETTVC       0914    IO_1      0DD9
SET_AT       05B2    IO_1      0A9B
SHIFT        339C    SUMS      2FDD
SIN          3BD0    FUNCTS    37B5
SKIP         1D28    SYNTAX    1D86
SKIPIT       2569    SYNTWO    ----
SLICER       2E10    IDENT     2A52
SMINIT       11C1    EDIT      15C6
SOUND        2128    SYNTAX    ----
SRCHSC       1374    EDIT      ----
STBOOL       3926    CALC      350B
STDE_S       314C    INOUT     2D8E
STDE_U       314A    INOUT     2D8C
STKUSN       3059    INOUT     2C9B
STK_O        1C51    SYNTAX    1CE6
STK_A        30E6    INOUT     2D28
STK_BC       30E9    INOUT     2D2B
STK_M        3773    CALC      33B4
STOP         1C59    SYNTAX    1CEE
STRITO       220F    SYNTWO    2070
STTVCU       05F3    IO_1      0ADC
SUB          33CE    SUMS      300F
SUBLIN       16F0    LIST      1988
SUBLN1       16F3    LIST      198B
SUMSLD       3379    SUMS      2FBA
SYNERR       1BED    SYNTAX    1C8A
SYNTAX       1A27    SYNTAX    1B17
TAN          3BF5    FUNCTS    37DA
TC_HL        0078    BASIC     0078
TEM1         1B82    SYNTAX    1C1F
TEM10        1BEF    SYNTAX    1C8C
TEM6         1BE5    SYNTAX    1C82
TEMP38       19E0    SYNTAX    1ADF
TEMP39       19E1    SYNTAX    1AE0
TERM?        21E7    SYNTWO    2048
TESTO        3904    CALC      34E9
TIMES        3489    SUMS      30CA
TOKENS       0098    BASIC     0095
TO_THE       3C6C    FUNCTS    3851
TRUNC        35D3    SUMS      3214
TVFUL?       0790    IO_1      0C55
TV_COL       23BB    SYNTWO    2211
UPD_K        02E1    KSCAN     028F
USRRET       3882    CALC      ----
WRCH         0010    BASIC     0010
XEY          310D    INOUT     2D4F
X_CALC       134E    EDIT      168E
X_T_HL       1363    EDIT      1604

PROGRAM BLOCK -- 4000 BYTES
ENTRY: 0000

@ N.A. Pashtoon, Aug. 1984