RAM Addresses and Routines

The following keys for DOSes apply:

T1 – Model 1 TRSDOS
T3 – Model 3 TRSDOS
N1 – Model 1 NEWDOS
N3 – Model 3 NEWDOS
L1 – Model 1 LDOS
L3 – Model 3 LDOS
M1 – Model 1 MULTIDOS
M3 – Model 3 MULTIDOS
D1 – Model 1 DOSPLUS
D3 – Model 3 DOSPLUS

All – All DOSes, Model I and Model III.

RAM Addresses and Routines:

Address
(Hex)
Address
(Decimal)
Model Code
Description
3033H
12339
3
$DATE GET THE SYSTEM DATE
3036H
12342
3
$TIME GET THE SYSTEM TIME
3042H
12354
3
$SETCAS SELECT CASSETTE BAUD RATE
37E1H
14305
1
DISK DRIVE SELECT
37E4H
14308
1
Values: 0-1
SELECT TAPE DRIVE: 0=#1 1=#2
37E8H
14312
1/3
$PRSTAT: Printer Status Byte.
  • 63=Printer On
  • 143=Printer Off.
37ECH
14316
1
DISK COMMAND/STATUS —
37EDH
14317
1
DISK TRACK SELECT
37EEH
14318
1
DISK SECTOR SELECT
37EFH
14319
1
DISK DATA
3800H-3840H
14336-14400
1/3
KEYBOARD ADDRESS MATRIX
3C00H-3FFFH
15360-16383
1/3
$VIDRAM: The beginning of video ram.
3FCDH-3FCEH
16333-16334
 
End of BASIC Program Pointer (LSB,MSB)
3FFFH
16383
3
END OF VIDEO MEMORY
4000H
16384
 
RST 08 Compare value pointed to by HL to that immediately following RST instruction.
4001H-4014H
16385-16404
Level 2
Jump vectors for RST 8 – RST 56
4003H-4005H
16387-16389
1/3
RST 10H Jump Vector.
4006H
16390
 
RST 18H Jump Vector.
4009H
16393
 
RST 20H Jump Vector.
400CH-400EH
16396-16398
1/3
This is a 3 byte break key vector. By default, it contains C9 00 00 (201 00 00) which is RET in NON-DOS BASIC. Any 3 byte instruction code put here will execute on hitting the break key.

On a Model I, to disable the break key, Radio Shack recommends filling 16396 with 23 (17H) which is RLA (which just messes with Register A), and with 201 (C9H) RET to re-enable it.

On a Model III, to disable the break key, Radio Shack recommends filling the area with AF C9 00 (175 and 201) which is XOR A / RET. Other methods include filling the area with C3 9A 0A (195 154 10) which is JP 0A9AH.
400FH
16399
 
RST 30H Jump Vector.
4012H-4015H
16402-16405
1/3
RST 38H Jump Vector.
4015H-401CH
16405-16412
1/3
Beginning of the Keyboard Device Control Block (DCB)
4016H-4017H
16406-16407
 
Two byte keyboard driver vector.
To Disable The Model I Keyboard:
N1=PEEK(16406)
N2=PEEK(16407)
POKE16406,154
POKE16407, 10
To Enable The Model I Keyboard:
POKE 16406,N1
POKE 16407,N2
4018H
16408
 
Right SHIFT toggle.
4019H
16409
3
Caps lock switch. 0=Off. Anything else, ALL CAPS. Note: A DOS driver might take over this function.
401AH
16410
 
Cursor blink count
401BH
16411
 
Cursor blink status. (0=blinks)
401CH
16412
1/3
Cursor blink switch. Set to 0 for blink, and 1 for no blink.
401DH-4024H
16413-16420
1/3
Beggining of Video Display Control Block (DCB).
401EH-401FH
16414-16415
 
Two byte video driver vector.
To send PRINT to the PRINTER:
  • Model I: 141,5
  • Model III: 194,3

To restore PRINT to VIDEO:
  • Model I: 88,5
  • Model III: 115,6

4020H-4021H
16416-16417
1/3
Cursor Position. 2 Bytes in LSB/MSB Order.
4022H
16418
 
0 = Cursor on, Not 0 = character replaced by cursor.
4023H
16419
 
Cursor Character (in ascii).
4024H
16420
 
FLAG : 0 = Space compression; Not 0 = special character.
4024H
16420
3
Character Set To Use: 0=Regular, 1=Alternate
4025H-402CH
16421-16428
1/3
Printer Control Block. 2 Bytes.
4026H
16422
1/3
Value: 141/194
1ST OF 2 TO RESTORE LPRINT (PRINTER) (M1=141 M3=194)
4026H
16422
1/3
Value: 88/15
1ST OF 2 TO SEND LPRINT TO VIDEO (M1=88 M3=115)
4027H
16423
1/3
Value: 4
2ND OF 2 TO SEND LPRINT TO VIDEO (M1 and M3)
4027H
16423
1/3
Value: 5/3
2ND OF 2 TO RESTORE LPRINT (PRINTER) (M1=5 M3=3)
4028H
16424
1/3
Maximum Number of Lines which can be Printed per Page plus 1. The default is 67.
4029H
16425
1/3
Number of lines already printed +1. To reset the counter, POKE 16425,1.
402AH
16426
 
Character counter + 1.
402BH
16427
1/3
Line printer maximum characters per line less 2. Set at 255 for no maximum.
402CH
16428
 
“R”
402DH
16429
 
EXIT: Normal program exit back to DOS. (Disk systems only).
4030H
16432
 
For all doses except TRSDOS, Jumping here is for an abnormal return to DOS ready, such as after an unsuccessful program exit.
4036H-403CH
16438-16444
Level 2
7 Byte Keyboard Buffer. This is ther work area for keyboard input routine
403DH
16445
 
Cassette port and print size flag (bit 3) copy (For Model 3, see 4210). If the value is 0, then the video is in 64 characters per line. If the value is 8, then the video is in 32 characters per line. L3: location of routine to add task to interupt chain.
403EH
16446
D1
OSVER$: Holds the DOS Version Number. Stored in DCB format.
4040H
16448
 
For L1 and M1, 25 ms heartbeat counter. For L3, used to remove task from interrupt chain.
4041H-4043H
16449-16451
L1, D1, and M1
TIME$, time of day: Seconds, Minutes, Hours
4043H
16451
L3
Change address of interupt task.
4044H-4046H
16452-16454
L1, D1, and M1
DATE$, date: Year, Day, Month. Stored in BCD.
4046H
16454
L3
Remove task from interupt chain.
4047H
16455
L1
Current day in coded form.
4049H-404AH
16457-16458
1
DOS MEMORY SIZE. Highest available memory location (On a Model III it is stored at 4411H)
4049H
16457
3
For the Model III disk is non maskable interupt vector
404BH
16459
L1
Contains image of interrupt latch.
408EH-408FH
16526-16527
Level 2
(L2 only) Entry point to USR routines
408EH
16526
3
NUMBER CHAR PRINTED PER LINE PLUS 1
4093H-4098H
16531-16536
Level 2
Input and output port routines
4099H
16537
1/3
INKEY$ storage. Most recent keyboard character, stored in ASCII.
409AH
16538
1/3
Current Error Code is stored at this address (for BASIC only)
409BH
16539
Level 2
Printer carriage position
409CH
16540
1/3
$OUTSEL. This is the device output flag. It will contain -1 (or 129) for Cassette Output, 0 for Video Output, 1 for Printer Output.
409DH
16541
Level 2
Used by PRINT#
40A0H-40A1H
16544-16545
1/3
String Storage Area: 2 Bytes point to the lowest address available for string storage.
40A2H-40A3H
16546-16547
1/3
Current Line Number in a BASIC Program in 2 Bytes (LSB/MSB)
40A4H-40A5H
16548-16549
1/3
BASIC Program Beginning Pointer in 2 bytes (LSB/MSB). It is the start of the BASIC program in RAM.

Normal values for: (L2)=42E9; (Disk BASIC)=varies with version of DOS/BASIC.

TO APPEND:
   POKE 16548,PEEK(16633)-2:POKE16549,PEEK(16634)

TO CLOAD: POKE16548,233:POKE16549,66
40A6H
16550
Level 2
Cursor’s current column number. Line cursor position, used for TAB
40A7H-40A8H
16551-16552
1/3
Input Buffer Pointer (in BASIC). The address of the basic keyboard buffer.
40A9H
16553
 
Cassette input flag.
40A9H
16553
1
Value: 255
FOR OLD M1’S -POKE AFTER “INPUT#” FOR A “READ” TO FUNCTION
40AAH-40ACH
16554-16556
Level 2
Seed for RND
40ABH
16555
1/3
When a RANDOM is executed in BASIC, thi sis the byte that gets changed.
40AFH
16559
1/3
$SAFLAG. Contains the variable tyle flag for the software accumulator. It will contain a 2 for integer, 3 for string, 4 for single-precision, and 8 for double precision.
40B1H-40B2H
16561-16562
1/3
$MEMTOP. The last byte of memory which is available for BASIC. This is where strong storage is so it is also the upper limit for string storage, stored in LSB/MSB order. This will be set by MEMORY SIZE.
40B3H-40B4H
16563-16564
Level 2
String work area pointer
40B5H-40D5H
16565-16597
Level 2
String work area
40D3H
16585
 
Saves length ASCII representation of binary integer.
40D4H
16586
 
Two byte address. Points to buffer where ASCII decimal representation written.
40D6H
16598
1/3
String pointer. Points to the next usable byte in string space. Keeps track within CLEARed area as to where last string data was put.
40D8H-40D9H
16600-16601
Level 2
Two byte location of where Basic is currently reading program/Present BYTE Counter (LSB and MSB).
40DAH-40DBH
16602-16603
Level 2
Last DATA,READ line #
40DCH
16604
Level 2
Used by DIM
40DEH
16606
Level 2
Used by PRINT USING
40DFH-40E0H
16607-16608
1/3
Entry point for SYSTEM tapes (LSB and MSB). This is where the SYSTEM command goes if you just enter a / instead of a address.
40E1H
16609
 
AUTO on or off flag. 0=off.
40E2H-40E3H
16610-16611
Level 2
Line Number: Current line number for the AUTO command.
40E4H
16612
 
AUTO command increment value
40E6H-40E7H
16614-16615
1/3
Pointer to terminator (end of line 00H byte or “:”) of the last executed Basic statement is at this address.
40E8H-40E9H
16616-16617
Level 2
Stack pointer pointer
40E8H
16616
 
Beggining of Basic’s stack.
40EAH-40EBH
16618-16619
1/3
Line Number: The line number which generated an error. This is used for RESUME. If it is 65535, the error originated in command mode instead of in a program.
40ECH-40EDH
16620-16621
Level 2
Line Number: Current Line Number for the EDIT command.
40EEH
16622
 
Pointer to I/O buffer.
40EEH
16622
Level 2
Used during RESUME
40F0H-40F1H
16624-16625
Level 2
Line Number: ON ERROR location for ON ERROR GOTO. That means it is the line number which the error will jump to.
40F2H
16626
 
Error flag.
40F5H-40F6H
16629-16630
Level 2
Line Number: Last line number executed prior to a BREAK.
40F7H-40F8H
16631-16632
Level 2
Last statement byte counter for CONTINUE retrieval
40F9H-40FAH
16633-16634
Level 2
Starting address of the simple variables list table. This is also one higher than the end of the BASIC program area.
40FBH-40FCH
16635-16636
1/3
STARTING ADDRESS OF ARRAY VARIABLE TABLE
40FBH-40FCH
16635-16636
Level 2
Start of arrays pointer (end of simple variables)
40FBH
16635
 
Start of arrays variables pointer.
40FDH-40FEH
16637-16638
1/3
1ST BYTE OF FREE MEMORY AFTER ARRAY TABLE
40FDH-40FEH
16637-16638
Level 2
Start of free space pointer (end of arrays)
40FDH
16637-16638
 
End of arrays variables/ start of free memory pointer (LSB,MSB).
40FFH-4100H
16639-16640
1/3
‘DATA’ POINTER – TELLS YOU WHERE YOU’RE GOING TO RECORD
40FFH-4100H
16639-16640
Level 2
DATA pointer
40FFH
16639-16640
 
Two byte address. Current location of Basic’s DATA pointer (LSB,MSB).
4101H-411AH
16641-16666
1/3
VARIABLE-TYPE TABLE
4101H-411BH
16641-16667
Level 2
Variable type declaration table for each letter: 2=int, 3=stng, 4=sngl, 8=dbl
4101H
16641
 
Beginning of variable type table.
411AH
16666
 
End of variable type table.
411BH
16667
 
Trace flag.
411BH
16667
Level 2
TRON flag: 0=off (TROFF), 175=on (TRON)
411DH-4124H
16669-16676
1/3
SOFTWARE ACCUMULATOR (SA)
411DH-4124H
16669-16676
Level 2
Arithmetic accumulator
411DH
16669
 
First byte of SA.
4124H
16673
 
Last byte of SA.
4127H-412EH
16679-16686
1/3
ALTERNATE SOFTWARE ACCUMULATOR (SA)
4127H-412EH
16679-16686
Level 2
Hex arithmetic accumulator
4127H
16679
 
First byte of SA1.
412EH
16686
 
Last byte of SA1.
4130H-4131H
16688-16689
Level 2
Line # work area pointer
4152H-41A6H
16722-16806
Level 2
DOS entry points
4152H-41AFH
16722-16815
1/3
DISK BASIC INTERFACE
4152H
16722
 
CVI vector (3 byte jump command to handler)
4155H
16725
 
FN vector (3 byte jump command to handler)
4158H
16728
 
CVS vector (3 byte jump command to handler)
415BH
16731
 
DEF vector (3 byte jump command to handler)
415EH
16734
 
CVD vector (3 byte jump command to handler)
4161H
16737
 
EOF vector (3 byte jump command to handler)
4164H
16740
 
LOC vector (3 byte jump command to handler)
4167H
16743
 
LOF vector (3 byte jump command to handler)
416AH
16746
 
MKI$ vector (3 byte jump command to handler)
416DH
16749
 
MKS$ vector (3 byte jump command to handler)
4170H
16752
 
MKD$ vector (3 byte jump command to handler)
4173H
16755
 
CMD vector (3 byte jump command to handler)
4179H
16761
 
OPEN vector (3 byte jump command to handler)
417CH
16764
 
FIELD vector (3 byte jump command to handler)
417FH
16767
 
GET vector (3 byte jump command to handler)
4182H
16770
 
PUT vector (3 byte jump command to handler)
4185H
16773
 
CLOSE vector (3 byte jump command to handler)
4188H
16776
 
LOAD vector (3 byte jump command to handler)
418BH
16779
 
MERGE vector (3 byte jump command to handler)
418EH
16782
 
NAME vector (3 byte jump command to handler)
4191H
16785
 
KILL vector (3 byte jump command to handler)
4194H
16788
 
& vector (3 byte jump command to handler)
4197H
16791
 
LSET vector (3 byte jump command to handler)
419AH
16794
 
RSET vector (3 byte jump command to handler)
419DH
16797
 
INSTR vector (3 byte jump command to handler)
41A0H
16800
 
SAVE vector (3 byte jump command to handler)
41A3H
16803
 
LINE vector (3 byte jump command to handler)
41A6H-41E4H
16806-16868
1/3
DOS INTERFACE AREA
41A6H
16806
 
ERROR Error processing jumps to this three byte vector. In cassette Basic it contains RET instruction, in Disk Basic, contains a jump (through RST) to long error message
41A9H
16809
 
USR 3 byter vector.
41ACH
16812
 
Ready prompt
41AFH
16815
 
Called from 0368H to input line from keyboard to I/O buffer.
41B2H
16818
 
Called from 1AA1H immediately after BASIC line is tokenized. HL points to tokenized line.
41B5H
16821
 
Called from 1AECH immediately after BASIC’s table of prg lines are updated. After call to 41B5H, BASIC calls CLEAR routine at 1B5DH then calls this dos exit from 1AF2H
41BBH
16827
 
Called from 1B8CH and 1DB0H during NEW and END processing to allow Disk Basic to close any open files.
41BEH-41C0H
16830-16832
Level 2
(L2 only( Jumps here on RESET button hit. You can put your own 3 byte instrtction here to jump to your own routine.
41BEH
16830
 
PRINT# processing called from 2174H
41C1H
16833
 
Byte output to any device. Called from 032CH so output to disk can be handled as to other devices.
41C4H
16836
 
ROM KB scan (0358H) calls this exit. BASIC processes INKEY$ here and also after each command when system searches for break or shift @.
41C7H
16839
 
Called from 1EA6H when RUN is followed by filename or line number
41CAH
16842
 
Related to 41BEH above. Called at beggining of print processing from 206FH to check for possible disk output.
41CDH
16845
 
Called from 20C6H. Call is made during print processing after number is in ASCII and just before printing. Could be used for Hex and Binary printing.
41D0H
16848
 
Called from 2103H (from PRINT routine after code that send CR.) Could be used for screen wrap-around.
41D3H
16851
 
Called from 2108H and 2141H. First is for printing with comma tabs, second is for printing with TAB statement. Could be used to increase length of original tabs from 63 or 127 up to 255.
41D6H
16854
 
INPUT# processing. Called from 219EH to check for INPUT# command and to provide input from disk.
41D9H
16857
 
Left side of MID$ processing. Only DOS exit BASIC jumps to instead of calls. Used to allow MID$ on left side of equals sign.
41DCH
16860
 
Variables assignment. During processing of READ and INPUT statements, after computer recieves value and before assigned to variable, BASIC calls this exit from 222DH.
41DFH
16863
 
Called twice from BASIC: From 2278H after BASIC assigns input value to variable and just before BASIC searches for extra data that will generate “Extra ignored” message, and from 2B44H from the midst of list processing. Could be used to alter list command.
41E2H
16866
 
SYSTEM command processing. Called from 02B2 just before “*?” prompt. A system tape will automatically start if a jump to its starting address is placed here. Keep in mind this is a 3 byte location. The first byte should be C3H which is the code for “JP” and should be followed by the starting address of your program.
41E8H
16872
1/3
$RSRCV: Input Buffer Area (1 byte)
41EBH, 41ECH, and 41F3H
16875, 16876 and 16883
4
M4 IN M3 MODE: ASCII VALUES OF F1,2,3 KEYS
41F0H
16880
1/3
$RSTX: Output Buffer Area (1 byte)
41F4H
16884
1/3
Value 103
1st of 2 to Change LINE keyword to act as LPRINT
41F5H
16885
1/3
Value 32
2nd of 2 to Change LINE keyword to act as LPRINT
41F8H
16888
1/3
$RSINIT: Baud Rate Code. TX code = most sig. nibble, RCV code = least sig. nib.
41F9H
16889
1/3
$RSINIT: Parity/Word Length/Stop-Bit code
41FAH
16890
1/3
$RSINIT: Wait Switch (0 = wait, Not 0 = wait)
4200H-51FFH
16896-20991
Level 2
TRSDOS
4209H
16905
L3
Checks for drive and mounted disk.
4210H
16912
 
Various controls: See port EC
4210H
16912
3
Value: 0/8
0=CHR$( 28 ):64 CHAR LINE. 8=CHR$(23):32 CHAR LINE
4210H
16912
4/3
Value: 64,0
SPEEDUP IN III MODE, 0=RETURN TO 2MHZ
4211H
16913
3
Cassette baud rate switch (0 = 500 baud, Not 0 = 1500 baud)
4214H
16916
3
Video display scroll protect. Can protect 0-7 lines.
4217H
16919
3
Time – Seconds (Value: 00-59)
4218H
16920
3
Time – Minutes (Value: 00-59)
4219H
16921
3
Time – Hours (Value: 00-23)
421AH
16922
3
Date – Years (Value: 00-99)
421BH
16923
3
Date – Day (Value: 01-31)
421CH
16924
3
Date – Month (Value: 01-12)
4220H-4221H
16928-16929
1/3
$ROUTE: Destination Device for Route. 2 Bytes
4225H
16933
T3, L3, D3
Dos command buffer.
4288H
17032
L3
33.33 ms heartbeat counter.
428AH
17034
L3
Send message to Job Log and CRT.
428DH
17037
T3, D3
Find drive and file number for open file. For L3, send message to Job Log.
4290H
17040
T3, L3, D3
Copy directory to RAM buffer.
4293H
17043
 
Get file name from directory.
4296H
17046
L3
Execute Dos command and return to DOS ready.
4299H
17049
T3
Do DOS command and return to DOS ready. L3: returns to caller is @EXIT and @ABORT vectors change to jump to return address.
429CH
17052
T3
Do DOS command and return to caller.
42ADH
17069
D3
Contains address of break key routine.
42E9H
17129
Level 2
Start of user RAM for program storage
4312H
17170
ND1, D1
Break Key Vector: (195=Off, 201=On).
4318H
17176
T1, L1, D1
DOS command buffer. Contains the last DOS command entered. Maximum of 64 Characters.
4396H
17302
L1
Read directory into memory.
43E9H-
17385–
3
RAM – BASIC PROGRAM IN A CASSETTE SYSTEM
4400H
17408
 
CMD is a routine that accepts a new command to be evaluated. To Use:
CALL    4400H
4400H
17408
L1, D1, D3, N1, N3, M1, M3
Same as 402D: return to DOS ready.
4402H
17410
 
Send text to file or device.
4405H
17413
 
CMNDI is the entry into the command interpreter. To use, the following 3 lines are necessary only if this is called at the end of BASIC program.
LD      HL,402D   ;DOS return address
LD (41FAH),HL
LD SP,41FAH ;reset stack pointer for DOS
Your ASCII DOS command should be in the command buffer terminated by a carriage return. To Use:
LD      HL,4318H  ;DOS command buffer
JP 4405H ;if from BASIC
CALL 4405H ;else this way
4405H
17413
L1, D1, D3, N1, N3, M1, M3
Do DOS command and return to DOS ready.
4409H
17417
 
Display error message on CRT.
440DH
17421
L1, L3, D1, D3, N1, N3, M1, M3
Enter Debug.
4410H
17424
L1, D1, N1, M1
Add task to interrupt chain.
4411H-4412H
17425-17426
3
MEMORY SIZE M3 DISK BASIC
4411H
17425
 
Address of highest available memory location (Mod III disk only – Mod 1 disk = 4049H)
4413H
17427
L1, D1, N1, N3, M1
Remove task from interrupt chain. For D3, add task to interrup chain.
4415H
17429
T3 (undocumented)
Second copy of high memory address. Copied to 4411H in case of I/O error during DO processing.
4416H
17430
L1, M1
Change entry address of task in interrupt chain. D3: Remove task from interrupt chain. N1, N3: Keep drives rotating and reselect current drive.
4417H
17431
L3
Contains current day in coded format.
4419H
17433
T3, L3
Write disk directory to screen or buffer. N1, N3: Execute DOS command and return to caller.
441CH
17436
 
FSPEC fetches a file specification in TRSDOS standard format. To Use:
CALL    441CH
441CH
17436
T3, L1, L3, D1, D3, N1, N3, M1, M3
Move filespec to FCB.
4420H
17440
 
INIT creates a new file in the directory and opens the DCB for this file. If the filespec name is found then the file is simply opened for use, else a new file is created first. To Use:
LD      HL,BUFFER
LD DE,DCB
LD B,LRL
CALL 4420H
JP Z,OK ;no error
JP C,NEWFIL ;no error, but new file was created
;A= TRSDOS error code
4420H
17440
All
Open or create a file.
4424H
17444
 
OPEN opens the DCB of an existing file. To Use:
LD      HL,BUFFER
LD DE,DCB
LD B,LRL
CALL 4424H
JP Z,OK ;no error
JP NZ,NOFILE ;file does not exist
;A= TRSDOS error code
4424H
17444
All
Open existing file.
4428H
17448
All
CLOSE: Closes a file. Updates the directory and then closes the file from any more processing. To Use:
LD      DE,DCB
CALL 4428H
JP Z,OK ;no error
;A= TRSDOS error code
442CH
17452
All
KILL: Remove a file from a directory. Deletes the directory for an open file and then closes the DCB. To Use:
LD      DE,DCB
CALL 442CH
JP Z,OK ;no error
;A= TRSDOS error code
4430H
17456
All
(undocumented in T1) Load and Execute a Model I Program into Memory. Call be used with CALL 4430H.
4433H
17459
All
(undocumented in T1) Load and Execute a Model I Program. Can be used with JP 4433H.
4436H
17462
All
Read logical record into memory. This will transfer one logical or physical disk record into memory. To access:
LD     HL,urec
LD DE,dcb
CALL 4436H
JP Z,ok ;No error
If there is an error, Register A will contain the TRSDOS Error Code.
4439H
17465
All
Write logical record to disk. This will transfer one logical or physical disk record from memory. To access:
LD      HL,UREC
LD DE,DCB
CALL 4439H
JP Z,ok ;No error
If there is an error, Register A will contain the TRSDOS Error Code.
443CH
17468
 
VERF is the same as WRITE except that it verifies what was written to disk. To use:
LD      HL,UREC
LD DE,DCB
CALL 443C
BP Z,OK ;No error
If there is an error, Register A will contain the TRSDOS Error Code.
443CH
17468
All
Write record and verify.
443FH
17471
T3, L1, L3, D1, D3, N1, N3, M1, M3
Point to first record in file.
4442H
17474
 
POSN positions a file to READ or WRITE a randomly selected logical record. To use:
LD      DE,DCB
LD BC,nnnn ;logical rec'd # to position for
CALL 4442H
JP Z,OK ;no error
;A= TRSDOS error code
4442H
17474
All
Position file to specified record.
4445H
17477
T3, L1, L3, D1, D3, N1, N3, M1, M3
Backspace file one record.
4448H
17480
T3, L1, L3, D1, D3, N1, N3, M1, M3
Position to end of file.
444BH
17483
T3, L3, D3, M3
Add extension to filespec in FCB (see also 4473). L1: Check for end of file. D1: Multiply 16 bit by 8 bit integer. N1, N3: Allocate disk space to file.
444EH
17486
T3, L3, D3
Multiply 16 bit by 8 bit integer. L1: Update directory with current record as end of file. D1: Divide 16 bit by 8 bit integer. N1, N3: Position file to specified byte record.
4451H
17489
T3, L3, D3
Divide 16 bit by 8 bit integer. D1: Check for end of file. N1, N3: Update directory with record as end of file.
4454H
17492
L1
Read current sector. L3, D3, M3: Parse parameters in command line. D1: Find drive and file number of a file.
4457H
17495
L1
Rewrite current sector. D3: Check for end of file. D1: Read directory to user buffer.
4458H
17496
L3
Check for end of file.
445AH
17498
L1
Calculate current logical record number. D1, D3: Display directory on CRT.
445BH
17499
L3
Update directory with current record as end of file. N1, N3: Select and power up specified drive.
445DH
17501
L1
Calculate EOF record number.
445EH
17502
L3
Reread current sector. N1, N3: Test drive and disk.
4460H
17504
L1
Skip next logical record.
4461H
17505
L3
Rewrite current sector. N1, N3: Add user routine to DOS library chain.
4462H
17506
D1, D3
Send text to printer.
4463H
17507
L1
Read directory to buffer or CRT.
4464H
17508
L3
Skip next logical record. N1, N3: Remove user routine from DOS library chain.
4467H
17511
L1, L3, D1, D3, N1, N3, M1, M3
Display text on CRT.
446AH
17514
L1, L3, N1, N3, M1, M3
Send text to printer.
446DH
17517
 
TIME will return the current time in ASCII. To use:
LD      HL,nnnn   ;address of 8 byte buffer
CALL 446DH ;put time in buffer
446DH
17517
T1, L1, D1, D3, N1, N3, M1
Get time in ASCII format. L3: Calculate current logical record number.
4470H
17520
 
DATE will return the current date in ASCII. To use:
LD      HL,nnnn   ;address of 8 byte buffer
CALL 4470H ;put date in buffer
4470H
17520
L3
Calculate end of file record number.
4473H
17523
L3
Holds image of interrupt latch. T1, L1, D1, D3, N1, N3, M1, M3: Add default extension to filespec in FCB. (See also 444BH)
4476H
17526
L1, D1, M1, M3
Parse parameters in command line.
4478H
17528
 
NewDOS/80 v2.0 for Model 3 Break Vector (195=Off, 201=On).
4478H
17528
1
MODEL 3 NEWDOS/80 V2.0 BREAK VECTOR
195=OFF, 201=ON
447BH
17531
L1
Send text to job log and CRT. N3: Add task interrupt chain.
447CH
17532
D1, D3
Compare filespec to wildcard mask.
447EH
17534
L1
Send text to joblog.
447FH
17535
D1, D3
Get device number for file or I/O device.
4482H
17538
D1, D3
Sort block of memory.
4485H
17541
D1
10 disk I/O functions depending on value in A.
4488H
17544
D3
10 disk I/O functions depending on value in A. D1: Locate device control block for any device.
448BH
17547
D1
Locate drive control table for any drive.
44A0H
17568
D3
Locate device control block for any device.
44A3H
17571
D3
Locate drive control table for any drive.
44B8H
17592
L1
Check drive and disk.
44BBH
17595
L1
Get file name from directory.
44C1H
17601
L1
Multiply 16 bit by 8 bit integer.
44C4H
17604
L1
Divide 16 bit by 8 bit integer.
44D2H
17618
M3
Add task to interrupt chain.
44D5H
17621
M3
Remove task from interrupt chain.
44D8H
17624
M3
Change execution address of task in interrupt chain.
44DBH
17627
M3
Set task pointer to default of RET.
44DEH
17630
M1, M3
Verify a sector without reading to RAM.
44E1H
17633
M1, M3
Read sector.
44E4H
17636
M1, M3
Write sector.
44E8H
17640
M1, M3
Read directory sector.
44EBH
17643
M1, M3
Write directory sector.
44EEH
17646
M1, M3
Read director.
44F1H
17649
M1, M3
Write directory.
44F4H
17652
M1, M3
User function.
44F7H
17655
M1, M3
Get directory track number.
4500H-4517H
17664-17687
Level 2
DOS interrupt table contains address pairs for interrupt routines (ie. CLOCK, TRACE, etc.). You can place your own routine addresses in this table. An example is below:
DI             ;disable interrupts
LD HL,4510H ;address of table link
LD (HL),myrout ;address of interrupt rtn
EI ;enable interrupts
46DDH
18141
 
RDSECT. On Model I, allows you to read a disk sector. Register C contains the drive selcted, D contains the track, E contains the sector number, HL points at data buffer. On return, Z is set if successful; otherwise A contains error code.
46E6H
18150
 
WTSECT. On Model I, allows you to write a disk sector. Same conditions as RDSECT at 46DDH.
4754H
18260
L1, L3
Select drive.
4759H
18265
L1, L3
Continually reselect drive until it is ready.
475EH
18270
L1, L3
Seek specified cylinder (track).
4763H
18275
L1, L3
Write sector to disk.
4768H
18280
L1, L3
Write system (directory) sector.
476DH
18285
L1, L3
Write track to disk (used for formatting).
4772H
18290
L1, L3
Verify sector without transfering data to memory.
4777H
18295
L1, L3
Read sector to buffer.
4779H
17529
L1
Send text to file or device. D1, D3: Scan and evaluate command line.
478FH
18319
L1, L3
Get address of drive code table for specifed drive.
479CH
18332
L1, L3
Get byte field from drive code table.
4AC1H
19137
 
This routine will read sectors 2 – 9 of the disk directory track (11H) into your designated buffer. It is just like the DOS routine at 5CC8 which is overlayed by BASIC/CMD. ( not for Newdos 80). To Use:
         LD      B,0
LD DE,BUFFER ;256*8 bytds
READ CALL 4AC1H ;read sector
LD L,0
PUSH BC
LD BB,256
LDIR
POP BC
INC B
LD A,B
CP 8
JR NZ,READ
RET
4B10H
19216
L1, L3
Read directory sector with specified entry code.
4B1FH
19231
L1, L3
Write system buffer to specified directory sector.
4B45H
19269
L1, L3
Read directory sector to user buffer.
4B64H
19300
L3
Get cylinder (track) number of directory.
4B65H
19301
L1
Get cylinder (track) number of directory.
4B6BH
19307
L3
Multiply 8 bit by 8 bit integers.
4B6CH
19308
L1
Multiply 8 bit by 8 bit integers.
4B7AH
19322
L3
Divide 8 bit by 8 bit integers.
4B7BH
19323
L1
Divide 8 bit by 8 bit integers.
5200H-6FFFH
20992-28671
Level 2
Disk BASIC or DOS utilities when loaded, or user memory
57F0H
22512
Level 2
61 character ASCII copyright notice (DOS)
68D9H-
26841-
3
RAM – BASIC PROGRAM IN TRS-DOS 1.3
7FFFH
32767
1/3
16K SYSTEM TOP OF PHYSICAL MEMORY
BFFFH
49151
3
32K System Top of Memory
FFFFH
65535
3
48K System Top of Memory