Jump to content
IGNORED

I/O Error Reporting


Pheonix

Recommended Posts

Paraphrasing directly from the E/A manual: BLWP @ERR will switch to TI BASIC's Error handling routine and return to BASIC. The Error code to be generated needs to be placed in the MSB of R0. To have further details of I/O errors the address for the PAB needs to be placed at >831C. From the manual & addendum, ERR equ >2034 & the code for an I/O error is >24. Using these numbers, in both emulators and on my now up & running physical system, I/O errors are reported as error 00 regardless of which error is actually generated. Further information below:

 

PAB (in VDP RAM >0EF0)

 

>0500

>1000

>0000

>2000

>00FF

[REST VARIES]

 

That's at the start, byte 9 [FF] changes when a file spec is provided. I've put in the wrong device name (DKS1 instead of DSK1,) which results in a zero anyway, so no joy there, but I keep that for future testing anyway. I've put in the right (and present,) device but a file that doesn't exist (should be 2.) And I tried "LOAD"-ing a DATA file (should be 7.) In the debugger, the right numbers appear where their supposed to be, but in MAME, on real HW, and in Classic99 I only get "I/O error 00" reported.

 

So, what am I doing wrong please :)

Link to comment
Share on other sites

Based on your post, I presume you are using TI Basic and LOADing BSCSUP, the TI Basic support utilities. The utility and error code EQUates in Appendix 24.4.8 of the E/A manual are for TI Extended Basic, not TI Basic. For TI Basic, ERR is actually at >A010 and the error codes are listed on page 288 of the E/A manual.

 

Also, you say the manual says, “The Error code to be generated needs to be placed in the MSB of R0.” It actually says that the MSB of R0 is where the error is returned from the call to ERR. [EDIT: I am not actually sure I understand what ERR is supposed to do, so my comment in this paragraph may be wrong.]

 

...lee

Link to comment
Share on other sites

Sorry, Using TI Extended BASIC... I have a bad habit of just saying BASIC instead of XB :( Sorry about that.

 

Pg 287 does say that on return WS R0 will have the error code in the MSB. But the examples I've found all have the error code to report being place into the MSB of R0. BLWP @ERR doesn't actually return to the assembly program when you branch to it. It exits out to command prompt after issuing an error beep & message. The message is the text associated with whichever value I put into the MSB of R0 of whatever WS I was in when I made the call. At one point I seem to recall getting a number (00 - 07) along with the error messages, in emulation. But when I did a rewrite, because it didn't work at all on my real HW, I seem to have lost that version of the code. I cleaned a lot out when I discovered I had put something in there that my real HW didn't like :( I had gotten rather cluttered.

 

I'm really about ready to just give up and just report generic errors. File Error for all problems with files, I/O errors only if it's a bad device, etc... Though I'd rather fix this, as XB itself will report the appropriate number. An aesthetic issue, I admit, but something I'd really like to figure out.

 

On a related note: Does the load routine (op-code 05,) report anywhere how many bytes exactly were actually loaded into the buffer? I know the lower level DSR data reading routines will report this, but I'm trying to avoid going into that level again. I may end up having to do that though for other reasons.

Link to comment
Share on other sites

...

On a related note: Does the load routine (op-code 05,) report anywhere how many bytes exactly were actually loaded into the buffer? I know the lower level DSR data reading routines will report this, but I'm trying to avoid going into that level again. I may end up having to do that though for other reasons.

 

Though I cannot find my reference at the moment, I am pretty sure the LOAD routine returns the actual number of bytes LOADed in bytes 6 – 7 4 – 5 of the PAB (with opcode in byte 0). , i.e., the same location LOAD requires the maximum number of bytes to LOAD before it executes.

 

...lee

 

[Corrected]

Link to comment
Share on other sites

Thank you :) You were a "little" off, as it turns out. The E/A manual doesn't actually say anything about data being changed (other than in an error.) But using MAME's debugger, I watched bytes 4 & 5 change to the actual number of bytes placed in the buffer. Doesn't work for cassette loads, but that goes through GPLLNK and not DSRLNK. I seem to recall coming across a DSRLNK replacement that worked with CS1, but I don't think that's the one I'm using.

 

One thing to note... in the E/A manual, it does say that Byte 5 will reflect the number of bytes placed in the buffer during a "READ" operation. I guess it could logically follow that Bytes 4 & 5 would become the total for a "LOAD" operation as well. But that actually requires making an assumption :(

 

As for the I/O error issue, guess I'm going to need to either go through a dissasembly of the ERR routine, track down the actual routines that the OS uses during a BASIC program run, or, finally, just write my own routines to display the message, scrolling the screen, cancelling the current "RUN", and return to BASIC. I was hoping it was something simple, like having to place a pointer somewhere else, or pointing to something else (instead of the beginning of the PAB.)

Link to comment
Share on other sites

Mainly by going off what BASIC uses. Of course, once I'm past error testing, and won't be going back to the calling routine, a lot of that goes out the window. During error testing, all I'm doing is pulling the status of the file, then getting the first 6 bytes. This allows me to work out what type of file it is. At this point, assuming no errors (and not counting programming bugs,) there should be no problems, and I won't be returning BASIC, so I can seize a rather large chunk of VDP for buffering :) I'm only stopped by the DSR buffers starting at >37D8 (with files set to 3,) on the upper end, and the VDP settings (Screen map, character map, etc...) on the lower end. This requires moving the PAB if I really want to maximize the buffer size, but that isn't that big a deal. It's less "moving" and more re-copying it :) Also, it's designed to load on boot-up, so XB isn't using a lot of real-estate yet.

Link to comment
Share on other sites

  • 2 weeks later...

Well, things are starting to come together :) Got a medium size program now that will either load a cassette file (program, adventure, etc...) then save it to disk or vice-versa. Nice & easy finding the size for disk based, but for cassette based it appears that I'm going to have to pre-fill the buffer with something then look for where it has stopped being replaced. Had to squeeze out every byte I could manage to get everything I currently have to test with to work right (Adventure & TOD files get quite large.) But I'm about ready to migrate to my TI and start converting my tapes :) Can't get a WAV file that converts for some of these, but they all load just fine on my real HW, so.... :)

 

So, anyone know where the cassette load routine (GPLLNK DATA >3D) reports the amount loaded (if anywhere?)

Link to comment
Share on other sites

Just in case you wanted to see the GPL ERROR coder in XB here it is:

[1437]               ***********************************************************
[1438]               ************** ERROR BRANCH TABLE FOR LINK ****************
[1439]               ***********************************************************
[1440] C4C9 8A,22    ERROR  CASE  @ERRCOD

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0025 
EQUATES ALCS-359
[1441] C4CB 44,1F           BR   NOERR
[1442] C4CD 44,1F           BR   NOERR
[1443] C4CF 45,2C           BR   ERRNO             2 Numeric Overflow
[1444] C4D1 45,33           BR   ERRSYN            3 SYNtax error
[1445] C4D3 45,37           BR   ERRIBS            4 Illegal after subprogram
[1446] C4D5 45,3B           BR   ERRNQS            5 unmatched quotes
[1447] C4D7 45,3F           BR   ERRNTL            6 Name Too Long
[1448] C4D9 45,43           BR   ERRSNM            7 String Number Mismatch
[1449] C4DB 45,47           BR   ERROBE            8 Option Base Error
[1450] C4DD 45,4B           BR   ERRMUV            9 iMproperly Used name
[1451] C4DF 45,4F           BR   ERRIM            10 IMage error
[1452] C4E1 45,56           BR   ERRMEM           11 MEMory full
[1453] C4E3 45,5A           BR   ERRSO            12 Stack Overflow
[1454] C4E5 45,5E           BR   ERRNWF           13 Next Without For
[1455] C4E7 45,62           BR   ERRFNN           14 For Next Nesting
[1456] C4E9 45,66           BR   ERRSNS           15 must be in subprogram
[1457] C4EB 45,6A           BR   ERRRSC           16 Recursive Subprogram Call
[1458] C4ED 45,6E           BR   ERRMS            17 Missing Subend
[1459] C4EF 45,72           BR   ERRRWG           18 Return Without Gosub
[1460] C4F1 45,76           BR   ERRST            19 String Truncated
[1461] C4F3 45,7A           BR   ERRBS            20 Bad Subscript
[1462] C4F5 45,7E           BR   ERRSSL           21 Speech String too Long
[1463] C4F7 45,82           BR   ERRLNF           22 Line Not Found
[1464] C4F9 45,86           BR   ERRBLN           23 Bad Line Number
[1465] C4FB 45,8A           BR   ERRLTL           24 Line Too Long
[1466] C4FD 45,8E           BR   ERRCC            25 Can't Continue
[1467] C4FF 45,92           BR   ERRCIP           26 Command Illegal in Program
[1468] C501 45,96           BR   ERROLP           27 Only Legal in a Program
[1469] C503 45,9A           BR   ERRBA            28 Bad Argument
[1470] C505 45,9E           BR   ERRNPP           29 No Program Present
[1471] C507 45,A2           BR   ERRBV            30 Bad Value
[1472] C509 45,A6           BR   ERRIAL           31 Incorrect Argument List
[1473] C50B 45,AA           BR   ERRINP           32 INPut error
[1474] C50D 45,B1           BR   ERRDAT           33 DATa error
[1475] C50F 45,B5           BR   ERRFE            34 File Error
[1476] C511 44,1F           BR   NOERR
[1477] C513 45,B9           BR   ERRIO            36 I/O error
[1478] C515 45,BD           BR   ERRSNF           37 Subprogram Not Found
[1479] C517 44,1F           BR   NOERR
[1480] C519 45,C1           BR   ERRPV            39 Protected Violation
[1481] C51B 45,C8           BR   ERRIVN           40 unrecognized Character
[1482] C51D 45,CC           BR   WRNNO            41 Numeric Number Overflow
[1483] C51F 45,D2           BR   WRNST            42 String Truncated
[1484] C521 45,D8           BR   WRNNPP           43 No Program Present
[1485] C523 45,DE           BR   WRNINP           44 INPut error
[1486] C525 45,E4           BR   WRNIO            45 I/O error
[1487] C527 45,EA           BR   WRNLNF           46 Line Not Found
[1488]               ***********************************************************
[1489]               **************** ERROR HANDLING SECTION *******************
[1490]               ***********************************************************
[1491] C529 06,C2,A4 ERRN01 CALL CLSNOE            * ENTRY FOR LOAD
[1492] C52C 06,6A,84 ERRNO  CALL ERRZZ             * Numeric Overflow
[1493] C52F 02              BYTE 2
[1494] C530 06,C2,A4 ERRSY1 CALL CLSNOE            * ENTRY FOR LOAD
[1495] C533 06,6A,84 ERRSYN CALL ERRZZ             * SYNtax error
[1496] C536 03              BYTE 3
[1497] C537 06,6A,84 ERRIBS CALL ERRZZ             * Illegal after subprogram
[1498] C53A 04              BYTE 4
[1499] C53B 06,6A,84 ERRNQS CALL ERRZZ             * uNmatched QuoteS
[1500] C53E 05              BYTE 5
[1501] C53F 06,6A,84 ERRNTL CALL ERRZZ             * Name Too Long
[1502] C542 06              BYTE 6
[1503] C543 06,6A,84 ERRSNM CALL ERRZZ             * String Number Mismatch
[1504] C546 07              BYTE 7

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0026 
EQUATES ALCS-359
[1505] C547 06,6A,84 ERROBE CALL ERRZZ             * Option Base Error
[1506] C54A 08              BYTE 8
[1507] C54B 06,6A,84 ERRMUV CALL ERRZZ             * Improperly used name
[1508] C54E 09              BYTE 9
[1509] C54F 06,6A,84 ERRIM  CALL ERRZZ             * Image Error
[1510] C552 0A              BYTE 10
[1511] C553 06,C2,A4 ERRMF1 CALL CLSNOE            * ENTRY FOR LOAD
[1512] C556 06,6A,84 ERRMEM CALL ERRZZ             * MEMory full
[1513] C559 0B              BYTE 11
[1514] C55A 06,6A,84 ERRSO  CALL ERRZZ             * Stack Overflow
[1515] C55D 0C              BYTE 12
[1516] C55E 06,6A,84 ERRNWF CALL ERRZZ             * Next Without For
[1517] C561 0D              BYTE 13
[1518] C562 06,6A,84 ERRFNN CALL ERRZZ             * For-Next Nesting
[1519] C565 0E              BYTE 14
[1520] C566 06,6A,84 ERRSNS CALL ERRZZ             * must be in subprogram
[1521] C569 0F              BYTE 15
[1522] C56A 06,6A,84 ERRRSC CALL ERRZZ             * Recursive Subprogram Call
[1523] C56D 10              BYTE 16
[1524] C56E 06,6A,84 ERRMS  CALL ERRZZ             * Missing Subend
[1525] C571 11              BYTE 17
[1526] C572 06,6A,84 ERRRWG CALL ERRZZ             * Return Without Gosub
[1527] C575 12              BYTE 18
[1528] C576 06,6A,84 ERRST  CALL ERRZZ             * String Truncated
[1529] C579 13              BYTE 19
[1530] C57A 06,6A,84 ERRBS  CALL ERRZZ             * Bad Subscript
[1531] C57D 14              BYTE 20
[1532] C57E 06,6A,84 ERRSSL CALL ERRZZ             * Speech String too Long
[1533] C581 15              BYTE 21
[1534] C582 06,6A,84 ERRLNF CALL ERRZZ             * Line Not Found
[1535] C585 16              BYTE 22
[1536] C586 06,6A,84 ERRBLN CALL ERRZZ             * Bad Line Number
[1537] C589 17              BYTE 23
[1538] C58A 06,6A,84 ERRLTL CALL ERRZZ             * Line Too Long
[1539] C58D 18              BYTE 24
[1540] C58E 06,6A,84 ERRCC  CALL ERRZZ             * Can't Continue
[1541] C591 19              BYTE 25
[1542] C592 06,6A,84 ERRCIP CALL ERRZZ             * Command Illegal in Program
[1543] C595 1A              BYTE 26
[1544] C596 06,6A,84 ERROLP CALL ERRZZ             * Only Legal in a Program
[1545] C599 1B              BYTE 27
[1546] C59A 06,6A,84 ERRBA  CALL ERRZZ             * Bad Argument
[1547] C59D 1C              BYTE 28
[1548] C59E 06,6A,84 ERRNPP CALL ERRZZ             * No Program Present
[1549] C5A1 1D              BYTE 29
[1550] C5A2 06,6A,84 ERRBV  CALL ERRZZ             * Bad Value
[1551] C5A5 1E              BYTE 30
[1552] C5A6 06,6A,84 ERRIAL CALL ERRZZ             * Incorrect Argument List
[1553] C5A9 1F              BYTE 31
[1554] C5AA 06,6A,84 ERRINP CALL ERRZZ             * INPut error
[1555] C5AD 29              BYTE 41
[1556] C5AE 06,C2,A4 ERRDE1 CALL CLSNOE            * ENTRY FOR LOAD
[1557] C5B1 06,6A,84 ERRDAT CALL ERRZZ             * DATa error / Checksum error
[1558] C5B4 21              BYTE 33
[1559] C5B5 06,6A,84 ERRFE  CALL ERRZZ             * File Error
[1560] C5B8 22              BYTE 34
[1561] C5B9 06,6A,84 ERRIO  CALL ERRZZ             * I/O error
[1562] C5BC 24              BYTE 36
[1563] C5BD 06,6A,84 ERRSNF CALL ERRZZ             * Subprogram Not Found
[1564] C5C0 25              BYTE 37
[1565] C5C1 06,6A,84 ERRPV  CALL ERRZZ             * Protection Violation
[1566] C5C4 27              BYTE 39
[1567] C5C5 06,C2,A4 ERRUC1 CALL CLSNOE            * ENTRY FOR LOAD
[1568] C5C8 06,6A,84 ERRIVN CALL ERRZZ             * Unrecognized character / il

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0027 
EQUATES ALCS-359
[1569] C5CB 28              BYTE 40
[1570] C5CC 06,6A,82 WRNNO  CALL WARNZZ            * Numeric Overflow
[1571] C5CF 02              BYTE 2
[1572] C5D0 44,1F           BR   NOERR
[1573] C5D2 06,6A,82 WRNST  CALL WARNZZ            * String Truncated
[1574] C5D5 13              BYTE 19
[1575] C5D6 44,1F           BR   NOERR
[1576] C5D8 06,6A,82 WRNNPP CALL WARNZZ            * No Program Present
[1577] C5DB 1D              BYTE 29
[1578] C5DC 44,1F           BR   NOERR
[1579] C5DE 06,6A,82 WRNINP CALL WARNZZ            * INPut Error
[1580] C5E1 20              BYTE 32
[1581] C5E2 44,1F           BR   NOERR
[1582] C5E4 06,6A,82 WRNIO  CALL WARNZZ            * I/O error
[1583] C5E7 23              BYTE 35
[1584] C5E8 44,1F           BR   NOERR
[1585] C5EA 06,6A,82 WRNLNF CALL WARNZZ            * Line Not Found
[1586] C5ED 26              BYTE 38
[1587] C5EE 44,1F           BR   NOERR
[1588]               ***********************************************************
  • Like 1
Link to comment
Share on other sites

Do you happen to have (or know where t find,) the actual code itself? A disassembly of code at ERRZZ primarily. That seems to be the heart of things. Though, considering the trailing byte, it may be yet another jump table.

ERRZZ :

[1942]               ***********************************************************
[1943]               * ERRZZ - Sets up an error stack entry based upon the
[1944]               * information passed to it by the caller and what it can
[1945]               * gather from the error table. It then either prints the
[1946]               * error message and aborts or goes to the line specified by
[1947]               * a previously executed ON ERROR statement. The stack enrry
[1948]               * looks like:
[1949]               * ---------------------------------------------------------
[1950]               * | Error code | Severity | >69 | Luno # | EXTRAM | PGMPTR
[1951]               * | ^          | ^        | ^   | ^      | ^      | ^
[1952]               * | FAC        | FAC1     | FAC2| FAC3   | FAC4   | FAC6
[1953]               *----------------------------------------------------------
[1954]               * ERROR CODE - the error number
[1955]               * SEVERITY   - Severity of the error
[1956]               *      1     - Warning
[1957]               *      5     - Possibly recoverable
[1958]               *      9     - Fatal, unrecoverable
[1959]               * >69  ERROR STACK ENTRY ID
[1960]               * LUNO #     - Luno # if file error or -1 if non-file error
[1961]               * EXTRAM, PGMPTR - Information to indicate the line # of
[1962]               *                  the error
[1963]               ***********************************************************
[1964]               *----------------------------------------------------------
[1965]               * In order to fix MEMORY FULL error occurring during MERGE
[1966]               * execution will leave the file open to disk DSR bug,
[1967]               * following lines should be added,
[1968]               * This note for the reshipment of FLMGR after 6/10/81
[1969]               * IOCALL routine are copied from FLMGR here, becuase FLMGR
[1970]               * is not in the branch table in FLMGR.
[1971]               * ERRZZ DST  V@MRGPAB,@PABPTR
[1972]               *       DCZ  @PABPTR          Error must occur in EDITLN
[1973]               *                              routine during MERGEing
[1974]               *       BS   HERE
[1975]               *       CALL IOCALL           Close all files
[1976]               *       DATA CZCLOS
[1977]               * HERE  ...........program continues
[1978]               * A statement BR IOCALL needs to be added in FLMGRS, which
[1979]               * is not going to be reshipped at this time 6/10/81
[1980]               * Therefore, the following patch is used
[1981] 6D4E C1,04,A3 ERRZZ  DEX  V@MRGPAB,@PABPTR
       6D51 9E
[1982] 6D52 8F,04           DCZ  @PABPTR           Error must occur in EDITLN
[1983]               *                              routine during MERGEing
[1984] 6D54 6D,74           BS   G6D74
[1985] 6D56 35,00,1E        MOVE 30,@FAC,V@>03C0   Save FAC area
       6D59 A3,C0,4A
[1986] 6D5C BD,56,04        DST  @PABPTR,@FAC12    Get the PAB pointer in FAC
[1987] 6D5F A3,56,00        DADD NLEN,@FAC12       Compute name length entry
       6D62 0D
[1988] 6D63 BE,E0,04        ST   1,V@4(@PABPTR)    * Select name length entry
       6D66 04,01
[1989] 6D68 06,00,10        CALL CALDSR            Call actual DSR line routine
[1990] 6D6B 08              BYTE 8
[1991] 6D6C 35,00,1E        MOVE 30,V@>03C0,@FAC
       6D6F 4A,A3,C0
[1992]                
[1993]               * Ignore the error coming back from DSR
[1994] 6D72 87,04           DCLR @PABPTR           Clear V@MRGPAB in case
[1995]               *                              any kind of I/O operation
[1996]               *                              following MERGE
[1997]               *                              (Also for the DEX statement)
[1998] 6D74 C1,04,A3 G6D74  DEX  V@MRGPAB,@PABPTR  Get the PABPTR back
       6D77 9E
[1999]               *----------------------------------------------------------

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0038 
EDIT-359
[2000] 6D78 87,22           DCLR @ERRCOD           Clear error code if from 9900
[2001] 6D7A A5,14,0E        DSUB @CURINC,@CURLIN   Just in case in autonum mode
[2002] 6D7D D7,3E,08        DCEQ CRNBUF,@SYMTAB    If prescanning r.h.
       6D80 20
[2003] 6D81 4D,87           BR   G6D87              of UDF and parameter in
[2004] 6D83 BD,3E,A8        DST  V@CRNBUF+2,@SYMTAB crunch buffer, fix SYMTAB
       6D86 22
[2005] 6D87 86,76    G6D87  CLR  @EXPZ             Get index into error table
[2006] 6D89 88,77           FETCH @EXPZ+1          Get index into error table
[2007] 6D8B E3,76,00        DSLL 2,@EXPZ           Multiply index by 4
       6D8E 02
[2008] 6D8F A3,76,CD        DADD ERRTAB,@EXPZ      Address of table entry
       6D92 77
[2009] 6D93 33,00,04        MOVE 4,G@0(@EXPZ),@FAC10  Get table entry
       6D96 54,00,00
       6D99 76
[2010] 6D9A BE,73,8A        ST   RSTK+2,@SUBSTK    Init subroutine stack but all
[2011]               *                              for GROM return address
[2012] 6D9D 8E,57           CZ   @FAC13            If message only
[2013] 6D9F 4D,AF           BR   G6DAF
[2014] 6DA1 06,6E,0E ERRZZR CALL ERPRNT            Display the error message
[2015]               * RXB PATCH FIX CODE ****************    * RXB *    *******
[2016] 6DA4 D7,54,60        DCEQ MSGFST,@FAC10     If * READY * (* RXB *)
       6DA7 40
[2017] 6DA8 4D,AD           BR   G6DAD
[2018] 6DAA 06,80,12        CALL CLSALL            Close all files
[2019] 6DAD 4D,44    G6DAD  BR   ERRZZ4             and clean up
[2020] 6DAF 8E,44    G6DAF  CZ   @PRGFLG           If imperative-default
[2021] 6DB1 6D,B8           BS   ERRZ1
[2022] 6DB3 8F,A3,8A        DCZ  V@ERRLN           If error turned off
[2023] 6DB6 4D,BF           BR   G6DBF
[2024] 6DB8 06,CE,1F ERRZ1  CALL TRACBK            Check for UDF
[2025] 6DBB 6D,44           BS   ERRZZ4            Was UDF, message already out
[2026] 6DBD 4D,A1           BR   ERRZZR            Assume normal error
[2027]               *
[2028]               * Error turned on. Now build the error entry
[2029]               *
[2030] 6DBF 06,76,7F G6DBF  CALL CLEAN             Clean up the stack
[2031] 6DC2 BD,4A,56        DST  @FAC12,@FAC       Put in error & severity
[2032] 6DC5 BE,4C,69        ST   >69,@FAC2         Error stack ID
[2033] 6DC8 D7,54,62        DCEQ MSG130,@FAC10     If I/O error
       6DCB A6
[2034] 6DCC 4D,D6           BR   G6DD6
[2035] 6DCE BC,4D,E0        ST   V@2(@PABPTR),@FAC3  *  Put in LUNO #
       6DD1 02,04
[2036] 6DD3 B6,4B,80        OR   >80,@FAC1         And indicate an I/O error
[2037] 6DD6 BD,50,2E G6DD6  DST  @EXTRAM,@FAC6     Save line pointer
[2038] 6DD9 BD,4E,1E        DST  @SMTSRT,@FAC4     Save pointer to beginning of
[2039]               *                              statement
[2040] 6DDC BD,5C,6E        DST  @VSPTR,@ARG       Must check for room on stack
[2041] 6DDF A3,5C,00        DADD 24,@ARG           Need 24 to help out VPUSH
       6DE2 18
[2042] 6DE3 C5,1A,5C        DCH  @ARG,@STREND      If not room
[2043] 6DE6 6D,FD           BS   G6DFD
[2044] 6DE8 06,6E,0E        CALL ERPRNT            Put out the message anyway
[2045] 6DEB BF,54,61        DST  MSG39,@FAC10      Memory full message
       6DEE 1C
[2046] 6DEF 86,44           CLR  @PRGFLG           Don't print a line #
[2047] 6DF1 06,6E,0E        CALL ERPRNT            Print it too
[2048] 6DF4 31,00,08        MOVE 8,G@MSGERR,V@NLNADD-18
       6DF7 A2,D0,60
       6DFA 38
[2049] 6DFB 4D,47           BR   ERRZZ5            And give up
[2050] 6DFD 0F,77    G6DFD  XML  VPUSH             Push the error entry

99/4 GPL-ASSEMBLER (Pass 3) correct                                   PAGE 0039 
EDIT-359
[2051] 6DFF 87,2E           DCLR @EXTRAM           Clear on-error entry
[2052] 6E01 C1,2E,A3        DEX  V@ERRLN,@EXTRAM   Set line pointer & clear on-e
       6E04 8A
[2053] 6E05 06,80,2C        CALL GRSUB2            Read the line text pointer VD
[2054]               *                              ERAM (use GREAD1) or VDP
[2055] 6E08 2E              BYTE EXTRAM          * @EXTRAM : Source address
[2056]               *                              in ERAM/VDP
[2057] 6E09 BD,2C,58        DST  @EEE1,@PGMPTR     Put the result in @PGMPTR
[2058] 6E0C 0F,81           XML  CONTIN            And go to the line
Link to comment
Share on other sites

OK, thanks for that :) Going to have to learn a new language to figure it out though. Reading a GPL book now (OK, a PDF of a GPL book.)

 

As for my side project mentioned earlier. I think it's rather finished. Had to give up and just calculate the buffer size manually every time :( The DSR doesn't consistently report the data transferred in bytes 4 & 5 of the PAB on my physical HW. Resulted in trying to save endlessly... Figured it out after about 7 minutes of the tape recording on me. Using my calculation method seems to be working, and really only causes an issue if a file ends with FF bytes. Only way to guard against that would be to load the data, scan for where the FF bytes begin. Fill the FF's with something else and load the file again t see if any of the new bytes are missing. Not really viable with cassette loads.

 

Anyways, in case anyone wants to check out my admittedly amateurish program, I've attached a .dsk image with the E/A code & executeables below (or that's the plan.) On the image will be the source code, the primary object code from assembly, and the final loader ("COPYTAPE"). Which is the code designed to be loaded with the TI Extended Basic OLD or RUN command :) It loads so much faster that way. In my source code, you'll also find a builder routine (labeled "MAKE") that preps your code for you, if you want to use it yourself. Shouldn't be too hard to figure it out.

 

As for using this, it's fairly straight forward. Type in the device & name of the disk file. If the file already exists you are asked if you want to overwrite the file or use it as the source file (making CS1 the destination instead of the source.) If the file doesn't exist, or if you chose overwrite, it then goes through the cassette loading routing, loading the cassette program into the buffer. Once that is done, it saves it to the specified file on disk. If you have made the disk file the source, it reverses this. Loading the disk file into the buffer, then going through the cassette save routine to put it on tape (with verify if you chose.) To end, just enter a blank line for the file name.

 

Because of the size of some of the programs I have on tape (TOD files for a prime example,) I've done a major restructure of VDP RAM, making a return to TI Extended BASIC problematical at best. So, when it ends, it just does a reset. For the curious, I've moved everything down as low as it can go in VDP RAM and dropped "FILES" down to 1. I'd move that last open file buffer somewhere else if I knew how. It puts a break between the data buffer and the last >0217 (535) bytes of VDP RAM. I currently have >23 (35) bytes of RAM for my PAB at >0628, with a buffer running from >064B through >3BE2 for a buffer that is >3598 (13720) bytes long. Should be enough, but the Scott Adams adventure (Knight Ironheart,) on my tape here comes pretty close to using all of it.

 

I'm currently doing this with my tape library as the majority of them didn't want to be read on my PC (tape player attached through line in or microphone in on my sound card.) They're reading just fine through my physical HW though :) Haven't run out of buffer space again (yet,) so maybe I won't need to worry about freeing up more.

 

Copy Tape.zip

  • Like 1
Link to comment
Share on other sites

I posted that, then I turn around and tweak it even more. Also, put something back in, correctly this time. Turns out I was occasionally bypassing the code that pulled the loaded length from the PAB in VDP :( That's why the length was sometimes being reported as >0000. So I put that back in, and it's working correctly now. Now, if there was only a way to get the size loaded from cassette to be reported. Can't find it, but I'm not really finished looking at the cassette code. I do know that the load size seems to be reported at the beginning, because it will error out first off if the buffer isn't large enough. But there doesn't seem to be a lot of documentation on using the cassette with assembly. All I've found, so far, is "this is how you do it," with little to no details.

 

That being said, all my testing has also finished off reading my entire tape collection. I might tweak it some more, but this is probably the last version. Though anyone else that wants to, can feel free to alter it themselves if they want. I could probably squeeze out another 26 bytes into the buffer by shrinking things down even farther, but not going to worry about it right now.

 

 

 

Copy Tape.zip

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...