Browse Source

reindented BASIC_CBM2_[AB], KERNAL_CBM2_[AB] and EDITOR_CBM2 to approximate the LST output of the assembler

master
Michael Steil 2 years ago
parent
commit
2ee5a84192
100 changed files with 22048 additions and 22048 deletions
  1. +7
    -7
      BASIC_CBM2_A/basdoc
  2. +56
    -56
      BASIC_CBM2_A/basic
  3. +203
    -203
      BASIC_CBM2_A/bdefine
  4. +382
    -382
      BASIC_CBM2_A/butes1
  5. +380
    -380
      BASIC_CBM2_A/butes2
  6. +654
    -654
      BASIC_CBM2_A/bverbs1
  7. +520
    -520
      BASIC_CBM2_A/bverbs2
  8. +321
    -321
      BASIC_CBM2_A/bverbs3
  9. +4
    -4
      BASIC_CBM2_A/cbm128
  10. +4
    -4
      BASIC_CBM2_A/cbm256
  11. +630
    -630
      BASIC_CBM2_A/contrl
  12. +70
    -70
      BASIC_CBM2_A/delete
  13. +183
    -183
      BASIC_CBM2_A/init
  14. +734
    -734
      BASIC_CBM2_A/math1
  15. +702
    -702
      BASIC_CBM2_A/math2
  16. +354
    -354
      BASIC_CBM2_A/math3
  17. +611
    -611
      BASIC_CBM2_A/math4
  18. +305
    -305
      BASIC_CBM2_A/renumber
  19. +389
    -389
      BASIC_CBM2_A/strng1
  20. +800
    -800
      BASIC_CBM2_A/strng2
  21. +41
    -41
      BASIC_CBM2_A/syscal
  22. +43
    -43
      BASIC_CBM2_A/sysvec
  23. +391
    -391
      BASIC_CBM2_A/tokens
  24. +544
    -544
      BASIC_CBM2_A/using
  25. +7
    -7
      BASIC_CBM2_B/basdoc
  26. +56
    -56
      BASIC_CBM2_B/basic
  27. +203
    -203
      BASIC_CBM2_B/bdefine
  28. +382
    -382
      BASIC_CBM2_B/butes1
  29. +380
    -380
      BASIC_CBM2_B/butes2
  30. +654
    -654
      BASIC_CBM2_B/bverbs1
  31. +520
    -520
      BASIC_CBM2_B/bverbs2
  32. +321
    -321
      BASIC_CBM2_B/bverbs3
  33. +4
    -4
      BASIC_CBM2_B/cbm128
  34. +4
    -4
      BASIC_CBM2_B/cbm128no
  35. +4
    -4
      BASIC_CBM2_B/cbm192
  36. +4
    -4
      BASIC_CBM2_B/cbm192no
  37. +4
    -4
      BASIC_CBM2_B/cbm256
  38. +4
    -4
      BASIC_CBM2_B/cbm256no
  39. +4
    -4
      BASIC_CBM2_B/cbm64
  40. +4
    -4
      BASIC_CBM2_B/cbm64no
  41. +630
    -630
      BASIC_CBM2_B/contrl
  42. +70
    -70
      BASIC_CBM2_B/delete
  43. +356
    -356
      BASIC_CBM2_B/indir
  44. +183
    -183
      BASIC_CBM2_B/init
  45. +734
    -734
      BASIC_CBM2_B/math1
  46. +702
    -702
      BASIC_CBM2_B/math2
  47. +354
    -354
      BASIC_CBM2_B/math3
  48. +611
    -611
      BASIC_CBM2_B/math4
  49. +20
    -20
      BASIC_CBM2_B/patches
  50. +4
    -4
      BASIC_CBM2_B/pet128
  51. +4
    -4
      BASIC_CBM2_B/pet192
  52. +4
    -4
      BASIC_CBM2_B/pet192no
  53. +4
    -4
      BASIC_CBM2_B/pet256
  54. +4
    -4
      BASIC_CBM2_B/pet256no
  55. +4
    -4
      BASIC_CBM2_B/pet64
  56. +4
    -4
      BASIC_CBM2_B/pet64no
  57. +305
    -305
      BASIC_CBM2_B/renumber
  58. +388
    -388
      BASIC_CBM2_B/strng1
  59. +787
    -787
      BASIC_CBM2_B/strng2
  60. +41
    -41
      BASIC_CBM2_B/syscal
  61. +43
    -43
      BASIC_CBM2_B/sysvec
  62. +391
    -391
      BASIC_CBM2_B/tokens
  63. +545
    -545
      BASIC_CBM2_B/using
  64. +71
    -71
      EDITOR_CBM2/bwdisp
  65. +313
    -313
      EDITOR_CBM2/bwfun1
  66. +271
    -271
      EDITOR_CBM2/bwfun2
  67. +270
    -270
      EDITOR_CBM2/bwinit
  68. +142
    -142
      EDITOR_CBM2/bwkybd
  69. +176
    -176
      EDITOR_CBM2/bwsubs
  70. +168
    -168
      EDITOR_CBM2/bwsubs.old
  71. +217
    -217
      EDITOR_CBM2/bwtabs
  72. +88
    -88
      EDITOR_CBM2/declare
  73. +95
    -95
      EDITOR_CBM2/equate
  74. +106
    -106
      EDITOR_CBM2/escape
  75. +193
    -193
      KERNAL_CBM2_A/channelio
  76. +29
    -29
      KERNAL_CBM2_A/clall
  77. +97
    -97
      KERNAL_CBM2_A/close
  78. +187
    -187
      KERNAL_CBM2_A/declare
  79. +101
    -101
      KERNAL_CBM2_A/equate
  80. +52
    -52
      KERNAL_CBM2_A/errorhandler
  81. +174
    -174
      KERNAL_CBM2_A/ieee
  82. +283
    -283
      KERNAL_CBM2_A/init
  83. +197
    -197
      KERNAL_CBM2_A/ipcom
  84. +104
    -104
      KERNAL_CBM2_A/irq
  85. +7
    -7
      KERNAL_CBM2_A/kernal
  86. +47
    -47
      KERNAL_CBM2_A/ktemp
  87. +190
    -190
      KERNAL_CBM2_A/load
  88. +22
    -22
      KERNAL_CBM2_A/messages
  89. +487
    -487
      KERNAL_CBM2_A/monitor
  90. +94
    -94
      KERNAL_CBM2_A/open
  91. +85
    -85
      KERNAL_CBM2_A/openchannel
  92. +94
    -94
      KERNAL_CBM2_A/rs232
  93. +89
    -89
      KERNAL_CBM2_A/save
  94. +49
    -49
      KERNAL_CBM2_A/time
  95. +107
    -107
      KERNAL_CBM2_A/transx
  96. +53
    -53
      KERNAL_CBM2_A/vectors
  97. +193
    -193
      KERNAL_CBM2_B/channelio
  98. +29
    -29
      KERNAL_CBM2_B/clall
  99. +97
    -97
      KERNAL_CBM2_B/close
  100. +0
    -0
      KERNAL_CBM2_B/crossover

+ 7
- 7
BASIC_CBM2_A/basdoc View File

@@ -1,4 +1,4 @@
.PAGE 'DEFINTION OF BASIC AND PARAMETERS'
.PAGE 'DEFINTION OF BASIC AND PARAMETERS'
; PAGE ZERO ----------------------
; STARTUP:
; INITIALLY A JMP TO INITIALIZATION CODE BUT CHANGED TO
@@ -21,10 +21,10 @@
; SUBROUTINE. IT IS HERE SO [TXTPTR] CAN BE THE
; EXTENDED ADDRESS OF A LOAD INSTRUCTION.
; THIS SAVES HAVING TO BOTHER ANY REGISTERS.
.SKIP 4
.SKIP 4
; PAGE ONE -----------------------
; THE STACK
.PAGE
.PAGE
; STORAGE, PAGE TWO AND ON--------
; IN RAM VERSIONS THESE DATA STRUCTURES COME AT THE END
; OF BASIC. IN ROM VERSION THEY ARE AT RAMLOC WHICH CAN
@@ -59,7 +59,7 @@
; MEMSIZ:
; HIGHEST MACHINE LOCATION. UNUSED EXCEPT BY THE VAL
; FUNCTION.
.PAGE
.PAGE
; ROM CONSTANTS AND CODE.
; FUNCTION DISPATCH ADDRESSES (AT ROMLOC)
; FUNSP CONTAINS THE ADDRESSES OF THE FUNCTION ROUTINES
@@ -268,7 +268,7 @@
; PARENTESIS FOR A SUBSCRIPTED VAR WILL NOT BE SCANNED
; BY PTRGET, AND PTRGET WILL RETURN WITH A TEXT POINTER
; TO THE '(', IF THERE WAS ONE.
.SKIP 4
.SKIP 4
; STRINGS
; IN THE VARIABLE TABLES STRINGS ARE STORED JUST LIKE
; NUMERIC VARIABLES. SIMPLE STRINGS HAVE THREE VALUE BYTES
@@ -297,14 +297,14 @@
; VALUE IS COPIED INTO STRING SPACE SING BUF IS
; ALWAYS CHANGING.
; ---MORE---
.SKIP 4
.SKIP 4
; MATH PACKAGE
; THE MATH PACKAGE CONTAINS FLOATING INPUT FIN, OUTPUT
; FOUT, COMPARE FCOMP...AND ALL THE NUMERIC OPERATORS
; AND FUNCTIONS. THE FORMATS, CONVENTIONS AND ENTRY
; POINTS ARE ALL DESCRIBED IN THE MATH PACKAGE ITSELF.
; (HA,HA...)
.SKIP 4
.SKIP 4
; INIT - THE INITIALIZATION ROUTINE.
; THE AMOUNT OF MEMORY, THE TERMINAL WIDTH, AND WHICH
; FUNCTIONS TO BE RETAINED ARE ASCERTAINED FROM THE

+ 56
- 56
BASIC_CBM2_A/basic View File

@@ -64,74 +64,74 @@
; VERSION 4.75 - JANUARY 7,1982
; 1) EXTENSIONS FOR 64K,128K,192K,256K
.PAG
CODFWA =$8000 ;SAVE CODE FIRST WORD ADDRESS
FALSE =0
TRUE =255
ROMLOC =$8000 ;START OF ROM
ROMC =TRUE
DEBUG =TRUE
GDEBUG =FALSE ;GARBAGE DEBUG
NKRNL =TRUE ;USING NEW KERNEL
CODFWA =$8000 ;SAVE CODE FIRST WORD ADDRESS
FALSE =0
TRUE =255
ROMLOC =$8000 ;START OF ROM
ROMC =TRUE
DEBUG =TRUE
GDEBUG =FALSE ;GARBAGE DEBUG
NKRNL =TRUE ;USING NEW KERNEL
.PAG
; ASSEMBLY CONSTANTS AND PARAMETERS
;
PGMKEY =$FF75 ;PROGRAM FUNCTION KEYS
VECORG =$FF7B ;JUMP VECTOR
PGMKEY =$FF75 ;PROGRAM FUNCTION KEYS
VECORG =$FF7B ;JUMP VECTOR
.SKI 4
CR =$D ;CARRIAGE RETURN
LF =$A ;LINE FEED
CLRSCR =147 ;CLEAR PET SCREEN
HOME =197 ;HOME PET SCREEN
EOM =$80 ;INDICATE END OF MESSAGE
CR =$D ;CARRIAGE RETURN
LF =$A ;LINE FEED
CLRSCR =147 ;CLEAR PET SCREEN
HOME =197 ;HOME PET SCREEN
EOM =$80 ;INDICATE END OF MESSAGE
.SKI 4
FORSIZ =19
NUMLEV =26 ;MAXIMUM NUMBER OF CALLS TO GETSTK
BUFSIZ =161
ADDPRC =1
ADDPR2 =ADDPRC+ADDPRC
ADDPR4 =ADDPR2+ADDPR2
ADDPR8 =ADDPR4+ADDPR4
STKEND =$1FB ;FIRST BYTE USED FOR STACK
CLMWID =10
PI =$FF
STRSIZ =4 ;# OF LOCS PER STR DESCRIPTOR
PTRSIZ =3 ;# OF LOCS PER POINTER
NUMTMP =3 ;# OF STRING TEMPORARIES
FORSIZ =19
NUMLEV =26 ;MAXIMUM NUMBER OF CALLS TO GETSTK
BUFSIZ =161
ADDPRC =1
ADDPR2 =ADDPRC+ADDPRC
ADDPR4 =ADDPR2+ADDPR2
ADDPR8 =ADDPR4+ADDPR4
STKEND =$1FB ;FIRST BYTE USED FOR STACK
CLMWID =10
PI =$FF
STRSIZ =4 ;# OF LOCS PER STR DESCRIPTOR
PTRSIZ =3 ;# OF LOCS PER POINTER
NUMTMP =3 ;# OF STRING TEMPORARIES
.SKI 3
; BANK EQUATES
SYSBNK =$0F ;SYSTEM BANK#
MXBANK =SYSBNK+1 ;1ST BANK OUT OF RANGE
.IFN CC1 <
TXTBNK =0+BF ;TEXT BANK *ONE*
VARBNK =0+BF ;SIMPLE VARIABLE BANK
ARYBNK =0+BF ;ARRAY BANK
STRBNK =0+BF ;STRING BANK
SYSBNK =$0F ;SYSTEM BANK#
MXBANK =SYSBNK+1 ;1ST BANK OUT OF RANGE
.IFN CC1 <
TXTBNK =0+BF ;TEXT BANK *ONE*
VARBNK =0+BF ;SIMPLE VARIABLE BANK
ARYBNK =0+BF ;ARRAY BANK
STRBNK =0+BF ;STRING BANK
>
.IFN CC2 <
TXTBNK =0+BF ;TEXT BANK *TWO*
VARBNK =1+BF ;SIMPLE VARIABLE BANK
ARYBNK =1+BF ;ARRAY BANK
STRBNK =1+BF ;STRING BANK
.IFN CC2 <
TXTBNK =0+BF ;TEXT BANK *TWO*
VARBNK =1+BF ;SIMPLE VARIABLE BANK
ARYBNK =1+BF ;ARRAY BANK
STRBNK =1+BF ;STRING BANK
>
.IFN CC3 <
TXTBNK =0+BF ;TEXT BANK *THREE*
VARBNK =2+BF+BF ;SIMPLE VARIABLE BANK
ARYBNK =1+BF ;ARRAY BANK
STRBNK =2+BF+BF ;STRING BANK
.IFN CC3 <
TXTBNK =0+BF ;TEXT BANK *THREE*
VARBNK =2+BF+BF ;SIMPLE VARIABLE BANK
ARYBNK =1+BF ;ARRAY BANK
STRBNK =2+BF+BF ;STRING BANK
>
.IFN CC4 <
TXTBNK =0+BF ;TEXT BANK *FOUR*
VARBNK =3 ;SIMPLE VARIABLE BANK
ARYBNK =1+BF ;ARRAY BANK
STRBNK =2+BF+BF ;STRING BANK
.IFN CC4 <
TXTBNK =0+BF ;TEXT BANK *FOUR*
VARBNK =3 ;SIMPLE VARIABLE BANK
ARYBNK =1+BF ;ARRAY BANK
STRBNK =2+BF+BF ;STRING BANK
>
.SKI 4
; DOS INTERFACE EQUATES.
DOSFNL =16+2 ;FILENAME LENGTH
DOSDSK =8 ;DISK DEVICE #
DOSLFN =14 ;DOS INTERNAL LOGICAL FILE NUMBER
DOSCTL =21 ;DOS DIRECTORY LINES BEFORE PROMPT
DOSLST =DOSFNL+DOSFNL+DOSFNL+16 ;(DOSFNL+2)*3+10 --TRANSMIT BUFFER LENGTH
DOSFNL =16+2 ;FILENAME LENGTH
DOSDSK =8 ;DISK DEVICE #
DOSLFN =14 ;DOS INTERNAL LOGICAL FILE NUMBER
DOSCTL =21 ;DOS DIRECTORY LINES BEFORE PROMPT
DOSLST =DOSFNL+DOSFNL+DOSFNL+16 ;(DOSFNL+2)*3+10 --TRANSMIT BUFFER LENGTH
;.LIB BASDOC
.LIB BDEFINE
.LIB TOKENS
@@ -147,7 +147,7 @@ DOSLST =DOSFNL+DOSFNL+DOSFNL+16 ;(DOSFNL+2)*3+10 --TRANSMIT BUFFER LENGTH
.LIB STRNG2
;.LIB RENUMBER
.LIB DELETE
.IFN CC2+CC3+CC4 <
.IFN CC2+CC3+CC4 <
.LIB USING
>
.LIB BUTES1

+ 203
- 203
BASIC_CBM2_A/bdefine View File

@@ -1,70 +1,70 @@
.PAG 'BDEFINE'
; PAGE ZERO STORAGE DEFINITIONS
*=0
*=0
;
E6509 *=*+1 ;EXECUTION BANK
I6509 *=*+1 ;INDIRECTION BANK
E6509 *=*+1 ;EXECUTION BANK
I6509 *=*+1 ;INDIRECTION BANK
;
USRPOK *=*+3 ;SET UP ORGIN BY INIT
TMHOUR *=*+1 ;FOR TI$ CALCULATIONS
TMMIN *=*+1
TMSEC *=*+1
TMTEN *=*+1
USRPOK *=*+3 ;SET UP ORGIN BY INIT
TMHOUR *=*+1 ;FOR TI$ CALCULATIONS
TMMIN *=*+1
TMSEC *=*+1
TMTEN *=*+1
;
FORM *=*+PTRSIZ ;FORMAT POINTER
FORM *=*+PTRSIZ ;FORMAT POINTER
;
INTEGR ;ONE-BYTE INTEGER FROM QINT
CHARAC *=*+1 ;A DELIMITING CHAR
ENDCHR *=*+1 ;OTHER DELIMITING CHAR
COUNT *=*+1 ;GENERAL COUNTER
XCNT *=*+1 ;DOS LOOP COUNTER
INTEGR ;ONE-BYTE INTEGER FROM QINT
CHARAC *=*+1 ;A DELIMITING CHAR
ENDCHR *=*+1 ;OTHER DELIMITING CHAR
COUNT *=*+1 ;GENERAL COUNTER
XCNT *=*+1 ;DOS LOOP COUNTER
.SKI 4
; FLAGS
; DIMFLG, VALTYP AND INTFLG MUST BE
; CONSECUTIVE LOCATIONS.
DIMFLG *=*+1 ;IN GETTING A POINTER TO A VARIABLE
DIMFLG *=*+1 ;IN GETTING A POINTER TO A VARIABLE
; IT IS IMPORTANT TO REMEMBER WHETHER
; IT IS BEING DONE FOR DIM OR NOT.
VALTYP *=*+1 ;THE TYPE INDICATOR 0=NUMERIC, 1=STRING
INTFLG *=*+1 ;TELLS IF INTEGER
VALTYP *=*+1 ;THE TYPE INDICATOR 0=NUMERIC, 1=STRING
INTFLG *=*+1 ;TELLS IF INTEGER
;
GARBFL ;WHETHER TO DO GARBAGE COLLECTION
DORES *=*+1 ;WHETHER CAN OR CAN'T CRUNCH RES'D WORD.
GARBFL ;WHETHER TO DO GARBAGE COLLECTION
DORES *=*+1 ;WHETHER CAN OR CAN'T CRUNCH RES'D WORD.
; TURNED ON WHEN DATA BEING SCANNED BY
; CRUNCH SO UNQUOTED STRS WON'T BE CRUNCHED.
;
SUBFLG *=*+1 ;FLAG WHETHER SUB'D VARIABLE ALLOWED.
SUBFLG *=*+1 ;FLAG WHETHER SUB'D VARIABLE ALLOWED.
; FOR AND USER-DEFINED FUNCTION POINTER
; FETCHING TURN THIS ON BEFORE CALLING
; PTRGET SO ARRAYS WON'T BE DETECTED.
; STKINI AND PTRGET CLEAR IT.
; ALSO DISALLOWS INTEGERS THERE.
;
INPFLG *=*+1 ;FLAGS WHETHER WE ARE DOING INPUT OR READ.
INPFLG *=*+1 ;FLAGS WHETHER WE ARE DOING INPUT OR READ.
;
DSDESC *=*+STRSIZ ;DISK STATUS STRING
CHANNL *=*+1 ;HOLDS CHANNEL NUMBER
DSDESC *=*+STRSIZ ;DISK STATUS STRING
CHANNL *=*+1 ;HOLDS CHANNEL NUMBER
POKER
LINNUM *=*+2 ;LOCATION TO STORE LINE #
LINNUM *=*+2 ;LOCATION TO STORE LINE #
.SKI 4
; POINTERS TO TEMPORARY STRING DESCRIPTORS.
; TEMP DESCRIPTORS ARE LOCATED IN THE STRING BANK
; HENCE, BANK OF STRBNK IS ASSUMED FOR TEMPPT,LASTPT
TEMPPT *=*+1 ;TEMPPST RELATIVE OFFSET TO 1ST FREE TEMP DESCR
LASTPT *=*+2 ;POINTER TO LAST-USED STR TEMPORARY
TEMPST *=*+2 ;POINTER TO STORAGE FOR 3 TEMPORARY DESCRIPTORS.
TEMPPT *=*+1 ;TEMPPST RELATIVE OFFSET TO 1ST FREE TEMP DESCR
LASTPT *=*+2 ;POINTER TO LAST-USED STR TEMPORARY
TEMPST *=*+2 ;POINTER TO STORAGE FOR 3 TEMPORARY DESCRIPTORS.
;
INDEX
INDEX1 *=*+PTRSIZ ;DIRECT CELLS FOR 1ST INDEXING USAGE
INDEX2 *=*+PTRSIZ ;DIRECT CELLS FOR 2ND INDEXING USAGE
INDEX1 *=*+PTRSIZ ;DIRECT CELLS FOR 1ST INDEXING USAGE
INDEX2 *=*+PTRSIZ ;DIRECT CELLS FOR 2ND INDEXING USAGE
;
;
RESHO *=*+1 ;RESULT OF MULTIPLIER AND DIVIDER
RESMOH *=*+1
ADDEND ;TEMP USED BY UMULT
RESMO *=*+1
RESLO *=*+1
*=*+1 ;OVERFLOW PREVIOUS CELLS
RESHO *=*+1 ;RESULT OF MULTIPLIER AND DIVIDER
RESMOH *=*+1
ADDEND ;TEMP USED BY UMULT
RESMO *=*+1
RESLO *=*+1
*=*+1 ;OVERFLOW PREVIOUS CELLS
.SKI 4
; POINTERS INTO DYNAMIC DATA STRUCTURES
; ALL ARE 2-BYTE OFFSETS INTO FIXED BANKS
@@ -97,68 +97,68 @@ RESLO *=*+1
; HIGHST (ARRAYS)
; MEMTOP (STRS)
;
TXTTAB *=*+2 ;POINTER TO BEGINNING OF TEXT AND
TXTTAB *=*+2 ;POINTER TO BEGINNING OF TEXT AND
; DOESN'T CHANGE AFTER BEING SETUP
; BY INIT
;
TXTEND *=*+2 ;POINTER TO END OF TEXT (EXCEPT 64K)
TXTEND *=*+2 ;POINTER TO END OF TEXT (EXCEPT 64K)
;
VARTAB *=*+2 ;POINTER TO START OF SIMPLE VARIABLE SPACE.
VARTAB *=*+2 ;POINTER TO START OF SIMPLE VARIABLE SPACE.
;
VAREND *=*+2 ;POINTER TO END OF SIMPLE VARS (256K ONLY)
VAREND *=*+2 ;POINTER TO END OF SIMPLE VARS (256K ONLY)
;
ARYTAB *=*+2 ;POINTER TO START OF ARRAY TABLE
ARYTAB *=*+2 ;POINTER TO START OF ARRAY TABLE
;
ARYEND *=*+2 ;POINTER END OF ARRAYS (192K, 256K ONLY)
ARYEND *=*+2 ;POINTER END OF ARRAYS (192K, 256K ONLY)
;
STREND *=*+2 ;END OF STORAGE IN USE.
STREND *=*+2 ;END OF STORAGE IN USE.
;
FRETOP *=*+2 ;TOP OF STR FREE SPACE
FRESPC *=*+2 ;POINTER TO NEW STR
MEMTOP *=*+PTRSIZ ;HIGHEST LOCATION IN MEMORY
FRETOP *=*+2 ;TOP OF STR FREE SPACE
FRESPC *=*+2 ;POINTER TO NEW STR
MEMTOP *=*+PTRSIZ ;HIGHEST LOCATION IN MEMORY
.SKI 4
; LINE NUMBERS AND TEXTUAL POINTERS
CURLIN *=*+2 ;CURRENT LINE NUMBER
OLDLIN *=*+2 ;OLD LINE NUMBER (SETUP BY STOP OR
CURLIN *=*+2 ;CURRENT LINE NUMBER
OLDLIN *=*+2 ;OLD LINE NUMBER (SETUP BY STOP OR
; END IN A PROGRAM)
OLDTXT *=*+PTRSIZ ;OLD TEXT POINTER
OLDTXT *=*+PTRSIZ ;OLD TEXT POINTER
;
DATLIN *=*+2 ;DATA LINE NUMBER
DATPTR *=*+2 ;POINTER TO DATA. INITIALIZED TO POINT
DATLIN *=*+2 ;DATA LINE NUMBER
DATPTR *=*+2 ;POINTER TO DATA. INITIALIZED TO POINT
; AT THE ZERO INFRONT OF (TXTTAB) BY
; CLR COMMAND.
; UPDATED BY EXECUTION OF A READ.
INPPTR *=*+2 ;REMEMBERS WHERE INPUT IS COMING FROM.
INPPTR *=*+2 ;REMEMBERS WHERE INPUT IS COMING FROM.
.SKI 4
; STUFF USED IN EVALUATIONS
;
VARNAM *=*+2 ;VARIABLE'S NAME
VARNAM *=*+2 ;VARIABLE'S NAME
;
FDECPT ;POINTER INTO POWER OF TENS TABLE.
VARPNT *=*+PTRSIZ ;POINTER TO VARIABLE IN MEMORY
FDECPT ;POINTER INTO POWER OF TENS TABLE.
VARPNT *=*+PTRSIZ ;POINTER TO VARIABLE IN MEMORY
;
FORPNT ;A VARIABLE'S POINTER FOR FOR LOOPS
FORPNT ;A VARIABLE'S POINTER FOR FOR LOOPS
; AND LET STATEMENTS (3 BYTES).
LSTPNT *=*+PTRSIZ ;POINTER TO LIST STRING (3 BYTES).
LSTPNT *=*+PTRSIZ ;POINTER TO LIST STRING (3 BYTES).
;
VARTXT ;SAVE CURRENT TXTPTR ON READ.
OPPTR *=*+PTRSIZ ;POINTER TO CURRENT OP'S ENTRY IN OPTAB.
VARTXT ;SAVE CURRENT TXTPTR ON READ.
OPPTR *=*+PTRSIZ ;POINTER TO CURRENT OP'S ENTRY IN OPTAB.
;
OPMASK *=*+1 ;MASK CREATED BY CURRENT OPERATION.
OPMASK *=*+1 ;MASK CREATED BY CURRENT OPERATION.
.SKIP 2
; TEMPORARY FLOATING RESULT REGISTERS (5BYTES EACH):
; TEMPF1,TEMPF2,TEMPF3
;
TEMPF3 ;TEMP FLOAT REG
GRBPNT ;POINTER USED IN GARBAGE COLLECTION.
DEFPNT *=*+PTRSIZ ;POINTER USED IN FUNCTION DEFINITION.
TEMPF3 ;TEMP FLOAT REG
GRBPNT ;POINTER USED IN GARBAGE COLLECTION.
DEFPNT *=*+PTRSIZ ;POINTER USED IN FUNCTION DEFINITION.
;
DSCPNT *=*+PTRSIZ ;POINTER TO A STRING DESCRIPTOR.
DSCPNT *=*+PTRSIZ ;POINTER TO A STRING DESCRIPTOR.
;
JMPER *=*+2 ;THREE BYTES LONG
OLDOV *=*+1 ;THE OLD OVERFLOW.
JMPER *=*+2 ;THREE BYTES LONG
OLDOV *=*+1 ;THE OLD OVERFLOW.
;
TEMPF1 ;TEMP FLOAT REG
TEMPF1 ;TEMP FLOAT REG
PTARG1=TEMPF1 ;MULTIPLY DEF'D FOR USE BY INSTR$
PTARG2=TEMPF1+3
STR1=TEMPF1+6
@@ -166,34 +166,34 @@ STR2=TEMPF1+10
TMPPOS=TEMPF1+14
POSITN=TEMPF1+15
MATCH=TEMPF1+16
ARYPNT ;POINTER USED IN ARRAY BUILDING.
HIGHDS *=*+PTRSIZ ;DESTINATION OF HIGHEST ELEMENT IN BLT.
HIGHTR *=*+PTRSIZ ;SOURCE OF HIGHEST ELEMENT TO MOVE.
;
TEMPF2 ;TEMP FLOAT REG (5BYTES)
LOWDS *=*+1 ;LOCATION OF LAST BYTE TRANSFERED (3 BYTES).
DECCNT *=*+1 ;NUMBER OF PLACES BEFORE DECIMAL POINT.
TENEXP *=*+1 ;BASE TEN EXPONENT
;
GRBTOP ;POINTER USED IN GARBAGE COLLECTION.(3 BYTES)
LOWTR *=*+1 ;LAST THING TO MOVE IN BLT (3 BYTES).
DPTFLG *=*+1 ;HAS A DPT BEEN INPUT
EXPSGN *=*+1 ;SIGN OF EXPONENT
ARYPNT ;POINTER USED IN ARRAY BUILDING.
HIGHDS *=*+PTRSIZ ;DESTINATION OF HIGHEST ELEMENT IN BLT.
HIGHTR *=*+PTRSIZ ;SOURCE OF HIGHEST ELEMENT TO MOVE.
;
TEMPF2 ;TEMP FLOAT REG (5BYTES)
LOWDS *=*+1 ;LOCATION OF LAST BYTE TRANSFERED (3 BYTES).
DECCNT *=*+1 ;NUMBER OF PLACES BEFORE DECIMAL POINT.
TENEXP *=*+1 ;BASE TEN EXPONENT
;
GRBTOP ;POINTER USED IN GARBAGE COLLECTION.(3 BYTES)
LOWTR *=*+1 ;LAST THING TO MOVE IN BLT (3 BYTES).
DPTFLG *=*+1 ;HAS A DPT BEEN INPUT
EXPSGN *=*+1 ;SIGN OF EXPONENT
.SKI 4
; THE FLOATING ACCUMULATOR
DSCTMP *=*+1 ;TEMPORARY DESCRIPTORS ARE BUILT HERE.
;DSCTMP OVERLAPS UP TO FACMOH.
DSCTMP *=*+1 ;TEMPORARY DESCRIPTORS ARE BUILT HERE.
;DSCTMP OVERLAPS UP TO FACMOH.
FAC
FACEXP *=*+1
FACHO *=*+1 ;MOST SIGNIFICANT BYTE OF MANTISSA.
FACMOH *=*+1
INDICE ;USED BY QINT.
FACMO *=*+1
FACLO *=*+1
FACSGN *=*+1
DEGREE ;COUNT USED BY POLYNOMIALS.
SGNFLG *=*+1
BITS *=*+1 ;CELL FOR SHIFTR TO USE.
FACEXP *=*+1
FACHO *=*+1 ;MOST SIGNIFICANT BYTE OF MANTISSA.
FACMOH *=*+1
INDICE ;USED BY QINT.
FACMO *=*+1
FACLO *=*+1
FACSGN *=*+1
DEGREE ;COUNT USED BY POLYNOMIALS.
SGNFLG *=*+1
BITS *=*+1 ;CELL FOR SHIFTR TO USE.
.SKI 4
; THE FLOATING ARGUMENT (UNPACKED)
T1=* ;TEMPORARIES --USES FP BUFFER
@@ -201,31 +201,31 @@ T2=T1+1
T3=T1+2
T4=T1+3
;
ARGEXP *=*+1
ARGHO *=*+1
ARGMOH *=*+1
ARGMO *=*+1
ARGLO *=*+1
ARGSGN *=*+1
ARGEXP *=*+1
ARGHO *=*+1
ARGMOH *=*+1
ARGMO *=*+1
ARGLO *=*+1
ARGSGN *=*+1
STRNG1
ARISGN *=*+1 ;A SIGN REFLECTING THE RESULT
FACOV *=*+1 ;OVERFLOW BYTE OF THE FAC
*=*+1
ARISGN *=*+1 ;A SIGN REFLECTING THE RESULT
FACOV *=*+1 ;OVERFLOW BYTE OF THE FAC
*=*+1
.SKI 4
STRNG2 ;-> TO STR OR DESC
POLYPT ;-> TO POLYNOMIAL COEFFICIENTS
CURTOL ;ABSOLUTE LINEAR INDEX IS FORMED HERE
FBUFPT *=*+PTRSIZ ;-> INTO FBUFFR USED BY FOUT
TXTPTR *=*+PTRSIZ ;POINTER TO CURRENT TERM
BUFFPT *=*+PTRSIZ ;^INPUT BUFFER
;
NOZE ;USING'S LEADING ZERO COUNTER
PARSTS *=*+1 ;DOS STD PARSER WORD
POINT ;USING'S POINTER TO DECIMAL POINT
PARSTX *=*+1 ;DOS AUX PARSER WORD
;
SEEDPT *=*+2
ERRNUM *=*+1
STRNG2 ;-> TO STR OR DESC
POLYPT ;-> TO POLYNOMIAL COEFFICIENTS
CURTOL ;ABSOLUTE LINEAR INDEX IS FORMED HERE
FBUFPT *=*+PTRSIZ ;-> INTO FBUFFR USED BY FOUT
TXTPTR *=*+PTRSIZ ;POINTER TO CURRENT TERM
BUFFPT *=*+PTRSIZ ;^INPUT BUFFER
;
NOZE ;USING'S LEADING ZERO COUNTER
PARSTS *=*+1 ;DOS STD PARSER WORD
POINT ;USING'S POINTER TO DECIMAL POINT
PARSTX *=*+1 ;DOS AUX PARSER WORD
;
SEEDPT *=*+2
ERRNUM *=*+1
.PAG
; STRING AREA AVAILABLE FOR COPY. THIS AREA IS USED
; BY FOUT AS A BUFFER AND MUST HAVE DOSSPC CONTIGUOUS
@@ -235,113 +235,113 @@ ERRNUM *=*+1
; USED BY THE DOS INTERFACE ROUTINES. NOTE, DECLARATION
; ORDER OF LOCATIONS DOSOFL-DOSSA MUST BE PRESERVED.
;
* =$200
* =$200
FBUFFR
VSPBUF ;BUFFER USED TO INTERFACE WITH VSP
*=*+16 ;RESERVE 16 BYTES FOR FILENAME 1
DOSF1L *=*+1 ;DOS FILE NAME 1 LENGTH
DOSDS1 *=*+1 ;DOS DISK DRIVE 1
DOSF1A *=*+2 ;DOS FILE NAME 1 ADDRESS
DOSF1B *=*+1 ;DOS FILE NAME 1 BANK
;
DOSF2L *=*+1 ;DOS FILE NAME 2 LENGTH
DOSDS2 *=*+1 ;DOS DISK DRIVE 2
DOSF2A *=*+2 ;DOS FILE NAME 2 ADDRESS
DOSF2B *=*+1 ;DOS FILE NAME 2 BANK
;
DOSBNK *=*+1 ;DOS BANK NUMBER
DOSOFL *=*+2 ;DOS LOW OFFSET (BSAVE,BLOAD)
DOSOFH *=*+2 ;DOS HIGH OFFSET (BSAVE)
;
DOSLA *=*+1 ;DOS LOGICAL ADDRESS
DOSFA *=*+1 ;DOS PHYSICAL ADDRESS
DOSSA *=*+1 ;DOS SECONDARY ADDRESS
DOSRCL *=*+1 ;DOS RECORD LENGTH
;
DOSDID *=*+2 ;DOS DISK IDENTIFIER (2 CHARS)
DIDCHK *=*+1 ;DOS DID FLAG
;
DOSSTR *=*+1 ;DOS OUTPUT STRING BUFFER
VSPBUF ;BUFFER USED TO INTERFACE WITH VSP
*=*+16 ;RESERVE 16 BYTES FOR FILENAME 1
DOSF1L *=*+1 ;DOS FILE NAME 1 LENGTH
DOSDS1 *=*+1 ;DOS DISK DRIVE 1
DOSF1A *=*+2 ;DOS FILE NAME 1 ADDRESS
DOSF1B *=*+1 ;DOS FILE NAME 1 BANK
;
DOSF2L *=*+1 ;DOS FILE NAME 2 LENGTH
DOSDS2 *=*+1 ;DOS DISK DRIVE 2
DOSF2A *=*+2 ;DOS FILE NAME 2 ADDRESS
DOSF2B *=*+1 ;DOS FILE NAME 2 BANK
;
DOSBNK *=*+1 ;DOS BANK NUMBER
DOSOFL *=*+2 ;DOS LOW OFFSET (BSAVE,BLOAD)
DOSOFH *=*+2 ;DOS HIGH OFFSET (BSAVE)
;
DOSLA *=*+1 ;DOS LOGICAL ADDRESS
DOSFA *=*+1 ;DOS PHYSICAL ADDRESS
DOSSA *=*+1 ;DOS SECONDARY ADDRESS
DOSRCL *=*+1 ;DOS RECORD LENGTH
;
DOSDID *=*+2 ;DOS DISK IDENTIFIER (2 CHARS)
DIDCHK *=*+1 ;DOS DID FLAG
;
DOSSTR *=*+1 ;DOS OUTPUT STRING BUFFER
DOSSPC=*-FBUFFR ;SPACED USED BY DOS ROUTINES
.SKI 4
* =*+46
* =*+46
;
;
TRMPOS ;CURSOR COLUMN ON CRT
ANDMSK *=*+1 ;MASK USED BY WAIT
EORMSK *=*+1 ;MASK USED BY WAIT
TRMPOS ;CURSOR COLUMN ON CRT
ANDMSK *=*+1 ;MASK USED BY WAIT
EORMSK *=*+1 ;MASK USED BY WAIT
;
DFBANK *=*+1 ;DEFAULT BANK NUMBER
DOLU *=*+1 ;DEFAULT OUTPUT LU (0=> NOT STD OUTPUT) KEEPS DS + DIR OK
DFBANK *=*+1 ;DEFAULT BANK NUMBER
DOLU *=*+1 ;DEFAULT OUTPUT LU (0=> NOT STD OUTPUT) KEEPS DS + DIR OK
;
DOMASK
TANSGN *=*+1 ;USED IN DETERMINING SIGN OF TAN
TANSGN *=*+1 ;USED IN DETERMINING SIGN OF TAN
;
LDAABS *=*+1 ;LDA ABS ROUTINE (SEE INITAT)
TTTEMP ;TEMPORARY STORE
LDAADR *=*+2 ;MODIFIABLE ADDRESS
*=*+1 ;RETURN OPCODE
LDAABS *=*+1 ;LDA ABS ROUTINE (SEE INITAT)
TTTEMP ;TEMPORARY STORE
LDAADR *=*+2 ;MODIFIABLE ADDRESS
*=*+1 ;RETURN OPCODE
.SKI 3
;
;DECLARATIONS FOR PRINT USING
;
HULP *=*+1 ;COUNTER
BNR *=*+1 ;POINTER TO BEGIN NO
ENR *=*+1 ;POINTER TO END NO
DOLR *=*+1 ;DOLLAR FLAG
FLAG *=*+1 ;COMMA FLAG
SWE *=*+1 ;COUNTER
USGN *=*+1 ;SIGN EXPONENT
UEXP *=*+1 ;POINTER TO EXPONENT
VN *=*+1 ;# DIGITS BEFORE DECIMAL POINT
CHSN *=*+1 ;JUSTIFY FLAG
VF *=*+1 ;# POS BEFORE DEC POINT (FIELD)
NF *=*+1 ;# POS AFTER DEC POINT (FIELD)
POSP *=*+1 ;+/- FLAG (FIELD)
FESP *=*+1 ;EXPONENT FLAG (FIELD)
ETOF *=*+1 ;SWITCH
CFORM *=*+1 ;CHAR COUNTER (FIELD)
SNO *=*+1 ;SIGN NO
BLFD *=*+1 ;BLANK/STAR FLAG
BEGFD *=*+1 ;POINTER TO BEGIN OF FIELD
LFOR *=*+1 ;LENGTH OF FOR]AT
ENDFD *=*+1 ;POINTER TO END OF FIELD
HULP *=*+1 ;COUNTER
BNR *=*+1 ;POINTER TO BEGIN NO
ENR *=*+1 ;POINTER TO END NO
DOLR *=*+1 ;DOLLAR FLAG
FLAG *=*+1 ;COMMA FLAG
SWE *=*+1 ;COUNTER
USGN *=*+1 ;SIGN EXPONENT
UEXP *=*+1 ;POINTER TO EXPONENT
VN *=*+1 ;# DIGITS BEFORE DECIMAL POINT
CHSN *=*+1 ;JUSTIFY FLAG
VF *=*+1 ;# POS BEFORE DEC POINT (FIELD)
NF *=*+1 ;# POS AFTER DEC POINT (FIELD)
POSP *=*+1 ;+/- FLAG (FIELD)
FESP *=*+1 ;EXPONENT FLAG (FIELD)
ETOF *=*+1 ;SWITCH
CFORM *=*+1 ;CHAR COUNTER (FIELD)
SNO *=*+1 ;SIGN NO
BLFD *=*+1 ;BLANK/STAR FLAG
BEGFD *=*+1 ;POINTER TO BEGIN OF FIELD
LFOR *=*+1 ;LENGTH OF FOR]AT
ENDFD *=*+1 ;POINTER TO END OF FIELD
PUCHRS
PUFILL *=*+1 ;PRINT USING FILL SYMBOL
PUCOMA *=*+1 ;PRINT USING COMMA SYMBOL
PUDOT *=*+1 ;PRINT USING DECIMAL POINT SYMBOL
PUMONY *=*+1 ;PRINT USING MONETARY SYMBOL
*=$280
PUFILL *=*+1 ;PRINT USING FILL SYMBOL
PUCOMA *=*+1 ;PRINT USING COMMA SYMBOL
PUDOT *=*+1 ;PRINT USING DECIMAL POINT SYMBOL
PUMONY *=*+1 ;PRINT USING MONETARY SYMBOL
*=$280
; BASIC INDIRECTS
;
IERROR *=*+2 ;ERROR ROUTINE, OUTPUT ERR IN .X
IMAIN *=*+2 ;INTERPRETER MAIN LOOP
ICRNCH *=*+2 ;TOKENIZATION ROUTINE
IQPLOP *=*+2 ;TOKEN OUTPUT EXPANDER ROUTINE
IGONE *=*+2 ;DISPATCHER
IEVAL *=*+2 ;EVAL ROUTINE
IFRMEV *=*+2 ;FRMEVL ROUTINE
ICHRGO *=*+2 ;CHRGOT ROUTINE
ICHRGE *=*+2 ;CHRGET ROUTINE
ADRAY1 *=*+2 ;CONVERT FLOAT -> INTEGER
ADRAY2 *=*+2 ;CONVERT INTEGER -> FLOAT
IERROR *=*+2 ;ERROR ROUTINE, OUTPUT ERR IN .X
IMAIN *=*+2 ;INTERPRETER MAIN LOOP
ICRNCH *=*+2 ;TOKENIZATION ROUTINE
IQPLOP *=*+2 ;TOKEN OUTPUT EXPANDER ROUTINE
IGONE *=*+2 ;DISPATCHER
IEVAL *=*+2 ;EVAL ROUTINE
IFRMEV *=*+2 ;FRMEVL ROUTINE
ICHRGO *=*+2 ;CHRGOT ROUTINE
ICHRGE *=*+2 ;CHRGET ROUTINE
ADRAY1 *=*+2 ;CONVERT FLOAT -> INTEGER
ADRAY2 *=*+2 ;CONVERT INTEGER -> FLOAT
.SKI 2
; ERROR TRAPPING DECLARATIONS
;
TRAPNO *=*+2 ;ERROR TRAP VECTOR
ERRLIN *=*+2 ;HOLDS LINE # OF LAST ERROR
ERRTXT *=*+2 ;TEXT POINTER AT TIME OF ERROR
OLDSTK *=*+1 ;STACK POINTER BEFORE EXECUTION OF LAST INSTRUCTION
TMPTRP *=*+1 ;USED TO SAVE HI BYTE OF TRAP LINE >TRAP & <RESUME
DSPTMP *=*+1 ;TEMPORARY FOR DISPOSE
OLDTOK *=*+1 ; " " "
TMPDES *=*+6 ;TEMPORARY FOR INSTR$
;
HIGHST *=*+2 ;MAX OFFSET FOR ANY USER BANK
;
;
MSIISM *=*+1 ;USED TO SAVE LENGTH OF STRING TO BE ADDED IN GARB COLLECT
NEWSYS= $FF6C
;
TRAPNO *=*+2 ;ERROR TRAP VECTOR
ERRLIN *=*+2 ;HOLDS LINE # OF LAST ERROR
ERRTXT *=*+2 ;TEXT POINTER AT TIME OF ERROR
OLDSTK *=*+1 ;STACK POINTER BEFORE EXECUTION OF LAST INSTRUCTION
TMPTRP *=*+1 ;USED TO SAVE HI BYTE OF TRAP LINE >TRAP & <RESUME
DSPTMP *=*+1 ;TEMPORARY FOR DISPOSE
OLDTOK *=*+1 ; " " "
TMPDES *=*+6 ;TEMPORARY FOR INSTR$
;
HIGHST *=*+2 ;MAX OFFSET FOR ANY USER BANK
;
;
MSIISM *=*+1 ;USED TO SAVE LENGTH OF STRING TO BE ADDED IN GARB COLLECT
NEWSYS= $FF6C
;
.SKI 4
.END

+ 382
- 382
BASIC_CBM2_A/butes1 View File

@@ -1,91 +1,91 @@
.PAGE 'BASIC UTILITY ROUTINES'
STXTPT LDA #TXTBNK
STA TXTPTR+2
CLC
LDA TXTTAB
ADC #255
STA TXTPTR
LDA TXTTAB+1
ADC #255
STA TXTPTR+1
RTS
.SKIP 4
GETNUM JSR GETPIN ;GET POSITIVE INTEGER
COMBYT JSR CHKCOM
JMP GETBYT
;
GTBYTC JSR CHRGET
GETBYT JSR FRMNUM
CONINT JSR POSINT
LDX FACMO
BNE FCER1
LDX FACLO
JMP CHRGOT
.SKIP 4
GETPIN JSR FRMNUM ;EVALUATE THE FORMULA
GETADR LDA FACSGN
BMI FCER1
LDA FACEXP
CMP #145
BCS FCER1
JSR QINT
LDA FACMO
LDY FACMO+1
STY POKER
STA POKER+1
RTS
;
BJMPS ;REFERENCED IN INITIALIZATION ROUTINE
FCER1 JMP FCERR
.SKIP 4
STXTPT LDA #TXTBNK
STA TXTPTR+2
CLC
LDA TXTTAB
ADC #255
STA TXTPTR
LDA TXTTAB+1
ADC #255
STA TXTPTR+1
RTS
.SKIP 4
GETNUM JSR GETPIN ;GET POSITIVE INTEGER
COMBYT JSR CHKCOM
JMP GETBYT
;
GTBYTC JSR CHRGET
GETBYT JSR FRMNUM
CONINT JSR POSINT
LDX FACMO
BNE FCER1
LDX FACLO
JMP CHRGOT
.SKIP 4
GETPIN JSR FRMNUM ;EVALUATE THE FORMULA
GETADR LDA FACSGN
BMI FCER1
LDA FACEXP
CMP #145
BCS FCER1
JSR QINT
LDA FACMO
LDY FACMO+1
STY POKER
STA POKER+1
RTS
;
BJMPS ;REFERENCED IN INITIALIZATION ROUTINE
FCER1 JMP FCERR
.SKIP 4
; THESE ROUTINES CHECK FOR CERTAIN 'VALTYP'
; (C) IS NOT PRESERVED.
FRMNUM JSR FRMEVL
CHKNUM CLC
.BYTE $24
CHKSTR SEC
CHKVAL BIT VALTYP
BMI DOCSTR
BCS CHKERR
CHKOK RTS
;
DOCSTR BCS CHKOK
CHKERR LDX #ERRTM
JMP ERROR
.SKIP 4
FRMNUM JSR FRMEVL
CHKNUM CLC
.BYTE $24
CHKSTR SEC
CHKVAL BIT VALTYP
BMI DOCSTR
BCS CHKERR
CHKOK RTS
;
DOCSTR BCS CHKOK
CHKERR LDX #ERRTM
JMP ERROR
.SKIP 4
;
; PRINT THE STR WHOSE DESCRIPTOR IS -> BY FACMO
STRPRT
JSR FREFAC ;RETURN TEMP ->
TAX ;PUT COUNT INTO COUNTER
LDY #0
INX
JSR MAPINX
JSR FREFAC ;RETURN TEMP ->
TAX ;PUT COUNT INTO COUNTER
LDY #0
INX
JSR MAPINX
;
; OUTPUT X CHARACTERS TO DEVICE
STRP2 DEX
BEQ STRP3
LDA (INDEX)Y
JSR OCHR ;OUTPUT ONE CHAR
INY
JMP STRP2 ;NEXT
STRP3 JMP MAPTXT
STRP2 DEX
BEQ STRP3
LDA (INDEX)Y
JSR OCHR ;OUTPUT ONE CHAR
INY
JMP STRP2 ;NEXT
STRP3 JMP MAPTXT
;
; OUTPUT SPACE
OSPC
LDA CHANNL
BEQ CRTSKP
LDA #' '
.BYTE $2C ;EAT NEXT TWO BYTES
CRTSKP LDA #29
.BYTE $2C ;EAT NEXT TWO BYTES
OUTQST LDA #'?'
LDA CHANNL
BEQ CRTSKP
LDA #' '
.BYTE $2C ;EAT NEXT TWO BYTES
CRTSKP LDA #29
.BYTE $2C ;EAT NEXT TWO BYTES
OUTQST LDA #'?'
;
; OUTPUT ONE CHARACTER TO DEVICE
OCHR JSR BSOUT ;OUTPUT CHARACTER
AND #$FF
RTS
.PAGE 'DOS UTILITY ROUTINES.'
OCHR JSR BSOUT ;OUTPUT CHARACTER
AND #$FF
RTS
.PAGE 'DOS UTILITY ROUTINES.'
; -MGM 7/23/79-
;
; THIS IS THE DOS PARSER ROUTINE WHICH LOOKS AT LINES
@@ -176,369 +176,369 @@ OCHR JSR BSOUT ;OUTPUT CHARACTER
; "1" BITS ARE REQUIRED TO BE SET.
; "*" BITS ARE OPTIONAL PARAMETERS.
.SKIP 2
DOSTBL .BYTE $FF,$FF,$FF,$FF,DOSLFN,DOSDSK,$6F
DOSTBL .BYTE $FF,$FF,$FF,$FF,DOSLFN,DOSDSK,$6F
.SKIP 2
DOSPAR
LDA #0
;
DOSPRS ;SPECIAL ERROR FLAG ENTRY
LDX #$FF ;NO AUX OPTIONS!
DOSPRX ;SPEC AUX ERROR FLAG ENTRY
PHA ;SAVE ERROR FLAGS
TXA
PHA
LDA #0
STA PARSTS
STA PARSTX
LDA #0
;
DOSPRS ;SPECIAL ERROR FLAG ENTRY
LDX #$FF ;NO AUX OPTIONS!
DOSPRX ;SPEC AUX ERROR FLAG ENTRY
PHA ;SAVE ERROR FLAGS
TXA
PHA
LDA #0
STA PARSTS
STA PARSTX
.SKI 1
LDX #DOSSPC-1 ;CLEAR DOS SCRATCH AREA
DOS01 STA FBUFFR,X
DEX
BNE DOS01
LDX #DOSSA-DOSOFL ;SET SOME DEFAULTS FROM TABLE
DOS02 LDA DOSTBL,X
STA DOSOFL,X
DEX
BPL DOS02
LDX DFBANK
STX DOSBNK
;
JSR CHRGOT ;GET CURRENT CHR
BNE PARSE1 ;IF NOT END OF STATEMENT
LDX #DOSSPC-1 ;CLEAR DOS SCRATCH AREA
DOS01 STA FBUFFR,X
DEX
BNE DOS01
LDX #DOSSA-DOSOFL ;SET SOME DEFAULTS FROM TABLE
DOS02 LDA DOSTBL,X
STA DOSOFL,X
DEX
BPL DOS02
LDX DFBANK
STX DOSBNK
;
JSR CHRGOT ;GET CURRENT CHR
BNE PARSE1 ;IF NOT END OF STATEMENT
;
DONE
PLA ;GET AUX ERROR FLAG
AND PARSTX ; REPEATED,ILLEGAL PARAMS?
BNE DN20
PLA ;GET ERROR FLAGS
JSR PRMRPT
LDA PARSTS
LDX PARSTX
RTS
;
PARSE1 CMP #'#'
BEQ LOGADR ;IF LOGICAL FILE NUMBER
CMP #'W'
BEQ RECLEN ;IF RECORD LENGTH
CMP #'L'
BEQ RECLEN ;IF RECORD LENGTH
CMP #'R'
BNE DOS5 ;IF NOT ????
JSR CHRGET ;MOVE ON
JMP DELIM1
;
ON1 JSR ON
SAV60 JMP DEL1
;
UNIT1 JSR UNIT ;DO UNIT# PARSING
BNE SAV60 ;ALWAYS
;
BANK1 JSR BANK
BEQ SAV60 ;ALWAYS
PLA ;GET AUX ERROR FLAG
AND PARSTX ; REPEATED,ILLEGAL PARAMS?
BNE DN20
PLA ;GET ERROR FLAGS
JSR PRMRPT
LDA PARSTS
LDX PARSTX
RTS
;
PARSE1 CMP #'#'
BEQ LOGADR ;IF LOGICAL FILE NUMBER
CMP #'W'
BEQ RECLEN ;IF RECORD LENGTH
CMP #'L'
BEQ RECLEN ;IF RECORD LENGTH
CMP #'R'
BNE DOS5 ;IF NOT ????
JSR CHRGET ;MOVE ON
JMP DELIM1
;
ON1 JSR ON
SAV60 JMP DEL1
;
UNIT1 JSR UNIT ;DO UNIT# PARSING
BNE SAV60 ;ALWAYS
;
BANK1 JSR BANK
BEQ SAV60 ;ALWAYS
.SKIP 4
DOS5 CMP #'D'
BEQ DRV1
CMP #TKON ;"ON" TOKEN
BEQ ON1
CMP #'B'
BEQ BANK1
CMP #'U'
BEQ UNIT1
CMP #'P'
BEQ DOFFL
CMP #'I'
BNE DOS10 ;IF NOT IDENTIFIER
BEQ IDENT
;
.SKIP 4
DOS5 CMP #'D'
BEQ DRV1
CMP #TKON ;"ON" TOKEN
BEQ ON1
CMP #'B'
BEQ BANK1
CMP #'U'
BEQ UNIT1
CMP #'P'
BEQ DOFFL
CMP #'I'
BNE DOS10 ;IF NOT IDENTIFIER
BEQ IDENT
;
.SKIP 4
LOGADR
LDA #4
JSR PRMRPT ;CHECK FOR REPEATED PARAMETER
JSR GETVAL
CPX #0
BEQ QTYER2 ;IF ILLEGAL VALUE
STX DOSLA
LDA #4 ;SET LOGICAL ADDRESS FLAG
BNE SAV60 ;GET NEXT PARAMETER
DN20 JMP SNERR
.SKIP 4
LDA #4
JSR PRMRPT ;CHECK FOR REPEATED PARAMETER
JSR GETVAL
CPX #0
BEQ QTYER2 ;IF ILLEGAL VALUE
STX DOSLA
LDA #4 ;SET LOGICAL ADDRESS FLAG
BNE SAV60 ;GET NEXT PARAMETER
DN20 JMP SNERR
.SKIP 4
RECLEN
TAX ;SAVE CHAR
LDA #$40
JSR PRMRPT ;CHECK FOR REPEATED PARAMETER
CPX #'W'
BNE RECOO
JSR CHRGET
JMP RECON ;SET PARSTS
RECOO JSR GETVAL
CPX #0
BEQ QTYER2 ;ZERO ILLEGAL DOSRCL
CPX #255
BEQ QTYER2 ;ILLEGAL DOSRCL
STX DOSRCL ;STORE PARCEL
TAX ;SAVE CHAR
LDA #$40
JSR PRMRPT ;CHECK FOR REPEATED PARAMETER
CPX #'W'
BNE RECOO
JSR CHRGET
JMP RECON ;SET PARSTS
RECOO JSR GETVAL
CPX #0
BEQ QTYER2 ;ZERO ILLEGAL DOSRCL
CPX #255
BEQ QTYER2 ;ILLEGAL DOSRCL
STX DOSRCL ;STORE PARCEL
;
RECON
LDA #$40 ;SET DOSRCL FLAG &
BNE TACKY1
LDA #$40 ;SET DOSRCL FLAG &
BNE TACKY1
;
DOS10 CMP #'"'
BEQ NAME1
CMP #'('
BEQ NAME1
BNE DN20
DOS10 CMP #'"'
BEQ NAME1
CMP #'('
BEQ NAME1
BNE DN20
;
.SKIP 4
DRV1
LDA #$10
JSR PRMRPT ;CHECK FOR REPEATED PARAMETER
JSR GETVAL
CPX #2
BCS QTYER2 ;ILLEGAL DRV# IF >1
STX DOSDS1
STX DOSDS2
LDA #$10
TACKY1 BNE DEL1
;
QTYER2 JMP QTYERR
.SKIP 4
IDENT LDA DIDCHK
BEQ IDCON ;ONLY 1 DOSDID ALLOWED
BNE DN20
;
DOFFL LDA #$02 ;CHK AUX STATUS
JSR PRXRPT
JSR GETOFF ;GET OFFSET VALUE
STY DOSOFL
STA DOSOFL+1
LDA #$02
DLIMX1 ORA PARSTX ;SET AUX STATUS BITS
STA PARSTX
BNE DELIM1 ;TRY FOR NXT PARAM
;
DOFFH LDA #$04
JSR PRXRPT
JSR GETOFF
STY DOSOFH
STA DOSOFH+1
LDA #$04
BNE DLIMX1 ;SET AUX STATUS
LDA #$10
JSR PRMRPT ;CHECK FOR REPEATED PARAMETER
JSR GETVAL
CPX #2
BCS QTYER2 ;ILLEGAL DRV# IF >1
STX DOSDS1
STX DOSDS2
LDA #$10
TACKY1 BNE DEL1
;
QTYER2 JMP QTYERR
.SKIP 4
IDENT LDA DIDCHK
BEQ IDCON ;ONLY 1 DOSDID ALLOWED
BNE DN20
;
DOFFL LDA #$02 ;CHK AUX STATUS
JSR PRXRPT
JSR GETOFF ;GET OFFSET VALUE
STY DOSOFL
STA DOSOFL+1
LDA #$02
DLIMX1 ORA PARSTX ;SET AUX STATUS BITS
STA PARSTX
BNE DELIM1 ;TRY FOR NXT PARAM
;
DOFFH LDA #$04
JSR PRXRPT
JSR GETOFF
STY DOSOFH
STA DOSOFH+1
LDA #$04
BNE DLIMX1 ;SET AUX STATUS
;
IDCON
JSR CHRGET ;GET NEXT CHARACTER
STA DOSDID ;M(TXTPTR => DOSDID
JSR CHRGET
STA DOSDID+1
LDA #$FF
STA DIDCHK ;SET DOSDID FLAG &
JSR CHRGET ;CONTINUE
JMP DELIM1
.SKIP 4
JSR CHRGET ;GET NEXT CHARACTER
STA DOSDID ;M(TXTPTR => DOSDID
JSR CHRGET
STA DOSDID+1
LDA #$FF
STA DIDCHK ;SET DOSDID FLAG &
JSR CHRGET ;CONTINUE
JMP DELIM1
.SKIP 4
NAME1
LDA #1 ;NAME1 ALLWD ONLY ONCE
JSR NEWNAM ;DO NAME PARSING
STA DOSF1L
STA XCNT ;SAVE TEMP VALUE
LDA #<FBUFFR
STA DOSF1A
LDA #>FBUFFR
STA DOSF1A+1
LDA #SYSBNK ; SET TO SYSTEM BANK
STA DOSF1B
;
LDY #0
JSR MAPINX
LOOP6 LDA (INDEX)Y
STA FBUFFR,Y ; SET CHAR IN BUFFER
INY
CPY XCNT
BCC LOOP6 ;IF NOT FULL NAME
JSR MAPTXT
LDA #1 ;SET NAME1 FLAG
LDA #1 ;NAME1 ALLWD ONLY ONCE
JSR NEWNAM ;DO NAME PARSING
STA DOSF1L
STA XCNT ;SAVE TEMP VALUE
LDA #<FBUFFR
STA DOSF1A
LDA #>FBUFFR
STA DOSF1A+1
LDA #SYSBNK ; SET TO SYSTEM BANK
STA DOSF1B
;
LDY #0
JSR MAPINX
LOOP6 LDA (INDEX)Y
STA FBUFFR,Y ; SET CHAR IN BUFFER
INY
CPY XCNT
BCC LOOP6 ;IF NOT FULL NAME
JSR MAPTXT
LDA #1 ;SET NAME1 FLAG
;
DEL1
ORA PARSTS
STA PARSTS
ORA PARSTS
STA PARSTS
;
DELIM1
JSR CHRGOT
BNE NXXX
DONE1 JMP DONE ;<CR>/<> => DONE
JSR CHRGOT
BNE NXXX
DONE1 JMP DONE ;<CR>/<> => DONE
;
NEXT6 CMP #TKON
BNE NEXT6A
JMP ON1
NEXT6A CMP #TKTO ;"TO" TOKEN
BEQ NEXT6B
BNE SAV61 ;SNTAX ERROR
NEXT6 CMP #TKON
BNE NEXT6A
JMP ON1
NEXT6A CMP #TKTO ;"TO" TOKEN
BEQ NEXT6B
BNE SAV61 ;SNTAX ERROR
;
; IF "TO" IS NOT FOLLOWED BY AN OFFSET PARAM,
; THEN DO FILE2 PARAMS. OTHERWISE, DO HIGH
; OFFSET AND CONTINUE WITH FILE0 OPTIONS.
NEXT6B JSR CHRGET
CMP #'P'
BNE PARS22
BEQ DOFFH
;
NXXX CMP #','
BNE NEXT6
JSR CHRGET
JMP PARSE1
;
PARSE2 JSR CHRGET
PARS22 CMP #'D'
BEQ DRV2
CMP #TKON ;"ON" TOKEN
BEQ ON2
CMP #'U'
BEQ UNIT2
CMP #'"'
BEQ NAME2
CMP #'('
BEQ NAME2
NEXT6B JSR CHRGET
CMP #'P'
BNE PARS22
BEQ DOFFH
;
NXXX CMP #','
BNE NEXT6
JSR CHRGET
JMP PARSE1
;
PARSE2 JSR CHRGET
PARS22 CMP #'D'
BEQ DRV2
CMP #TKON ;"ON" TOKEN
BEQ ON2
CMP #'U'
BEQ UNIT2
CMP #'"'
BEQ NAME2
CMP #'('
BEQ NAME2
;
DRV2
LDA #$20
JSR PRMRPT ;CHECK FOR REPEATED PARAMETER
JSR GETVAL
CPX #2
BCS QTYERR ;ILLEGAL DRIVE #
STX DOSDS2
LDA #$20
BNE DEL2
LDA #$20
JSR PRMRPT ;CHECK FOR REPEATED PARAMETER
JSR GETVAL
CPX #2
BCS QTYERR ;ILLEGAL DRIVE #
STX DOSDS2
LDA #$20
BNE DEL2
;
ON2 JSR ON
JMP DEL2
ON2 JSR ON
JMP DEL2
;
UNIT2 JSR UNIT ;DO UNIT# PARSING
BNE DEL2 ;ALWAYS
UNIT2 JSR UNIT ;DO UNIT# PARSING
BNE DEL2 ;ALWAYS
;
NAME2
LDA #2 ;NAME2 ALLOWED ONLY ONCE
JSR NEWNAM
STA DOSF2L
STX DOSF2A
STY DOSF2A+1
LDA INDEX1+2 ; GET STRNG BANK#
STA DOSF2B
LDA #2 ;SET FILENAME2 FLAG &
LDA #2 ;NAME2 ALLOWED ONLY ONCE
JSR NEWNAM
STA DOSF2L
STX DOSF2A
STY DOSF2A+1
LDA INDEX1+2 ; GET STRNG BANK#
STA DOSF2B
LDA #2 ;SET FILENAME2 FLAG &
;
DEL2
ORA PARSTS ;SET FLAG IN STATUS
STA PARSTS
JSR CHRGOT
BEQ DONE1 ;DONE ON <CR>/<>
CMP #','
BEQ PARSE2
CMP #TKON ;"ON" TOKEN
BEQ ON2
CMP #'U'
BEQ UNIT2
ORA PARSTS ;SET FLAG IN STATUS
STA PARSTS
JSR CHRGOT
BEQ DONE1 ;DONE ON <CR>/<>
CMP #','
BEQ PARSE2
CMP #TKON ;"ON" TOKEN
BEQ ON2
CMP #'U'
BEQ UNIT2
SAV61
BNE SNER
.SKIP 4
BNE SNER
.SKIP 4
QTYERR
JMP FCERR ;"ILLEGAL QUANTITY"
JMP FCERR ;"ILLEGAL QUANTITY"
;
ON JSR CHRGET
CMP #'U'
BEQ UNIT ;IF CHARACTER IS A "U"
CMP #'B'
BEQ BANK
BNE SNER
ON JSR CHRGET
CMP #'U'
BEQ UNIT ;IF CHARACTER IS A "U"
CMP #'B'
BEQ BANK
BNE SNER
;
UNIT
JSR GETVAL
CPX #32
BCS QTYERR ;ERROR IF >31
CPX #3
BCC QTYERR ;ERROR IF <3
STX DOSFA
LDA #8
RTS
JSR GETVAL
CPX #32
BCS QTYERR ;ERROR IF >31
CPX #3
BCC QTYERR ;ERROR IF <3
STX DOSFA
LDA #8
RTS
;
BANK
LDA #$01 ;REPEATED PARAM?
JSR PRXRPT
JSR GETVAL
CPX #MXBANK ;BANK TOO LARGE?
BCS QTYERR
STX DOSBNK
LDA #$01
ORA PARSTX ;SET BNK BIT IN AUX STATUS
STA PARSTX
LDA #0 ; .A=STD STATUS WRD, NO BITS TO SET
RTS
;
SNER JMP SNERR ;JUMP SYSTAN ERROR
LDA #$01 ;REPEATED PARAM?
JSR PRXRPT
JSR GETVAL
CPX #MXBANK ;BANK TOO LARGE?
BCS QTYERR
STX DOSBNK
LDA #$01
ORA PARSTX ;SET BNK BIT IN AUX STATUS
STA PARSTX
LDA #0 ; .A=STD STATUS WRD, NO BITS TO SET
RTS
;
SNER JMP SNERR ;JUMP SYSTAN ERROR
;
NEWNAM
JSR PRMRPT ;CHECK FOR REPEATED PARAMETER
JSR SAV13
TAX ;SAVE LENGTH OF STRING
BEQ QTYERR ;IF LENGTH = 0
LDY #0
JSR SAV12
CMP #'@'
BNE LENCHK
LDA #$80
JSR PRMRPT
LDA PARSTS
ORA #$80 ;SET "@" FLAG
STA PARSTS
DEX ;DECREMENT LENGTH
INC INDEX1 ;INCREMENT PAST "@"
BNE LENCHK ;IF NO CARRY
INC INDEX1+1
JSR PRMRPT ;CHECK FOR REPEATED PARAMETER
JSR SAV13
TAX ;SAVE LENGTH OF STRING
BEQ QTYERR ;IF LENGTH = 0
LDY #0
JSR SAV12
CMP #'@'
BNE LENCHK
LDA #$80
JSR PRMRPT
LDA PARSTS
ORA #$80 ;SET "@" FLAG
STA PARSTS
DEX ;DECREMENT LENGTH
INC INDEX1 ;INCREMENT PAST "@"
BNE LENCHK ;IF NO CARRY
INC INDEX1+1
;
LENCHK
TXA
CMP #17
BCS ERRLEN ;IF LENGTH < 17
LDX INDEX1
LDY INDEX1+1
RTS
;
ERRLEN LDX #ERRLS
JMP ERROR ;FILENAME TOO LONG
.SKIP 4
GETVAL ;GET NEXTVALUE ROUTINE
JSR CHRGET ;GET NXT CHR
GTVL2 BEQ SNER ;IF END OF STATEMENT
BCC GTVL5 ;CAN BE NUMERIC
JSR CHKOPN ;OR A "("
JSR GETBYT ;ANYTHING ELSE IS AN ERROR
JMP CHKCLS ;NEED CLOSING ")"
;
GTVL5 JMP GETBYT ;EVALUATE IT
TXA
CMP #17
BCS ERRLEN ;IF LENGTH < 17
LDX INDEX1
LDY INDEX1+1
RTS
;
ERRLEN LDX #ERRLS
JMP ERROR ;FILENAME TOO LONG
.SKIP 4
GETVAL ;GET NEXTVALUE ROUTINE
JSR CHRGET ;GET NXT CHR
GTVL2 BEQ SNER ;IF END OF STATEMENT
BCC GTVL5 ;CAN BE NUMERIC
JSR CHKOPN ;OR A "("
JSR GETBYT ;ANYTHING ELSE IS AN ERROR
JMP CHKCLS ;NEED CLOSING ")"
;
GTVL5 JMP GETBYT ;EVALUATE IT
;
; GET NEXT 2BYTE EXPR ROUTINE
; EXIT: .A,.Y (HIGH,LOW) VALUE
;
GETOFF JSR CHRGET ;GET NXT CHR
BEQ SNER ;IF END OF STATEMENT
BCC GTFF5 ;CAN BE NUM. CONST
JSR CHKOPN ;OR A "("
JSR GETPIN ;EXPR
JSR CHKCLS ;NEED CLOSING ")"
LDY POKER
LDA POKER+1
RTS
;
GTFF5 JMP GETPIN ;EVALUATE IT
.SKIP 4
GETOFF JSR CHRGET ;GET NXT CHR
BEQ SNER ;IF END OF STATEMENT
BCC GTFF5 ;CAN BE NUM. CONST
JSR CHKOPN ;OR A "("
JSR GETPIN ;EXPR
JSR CHKCLS ;NEED CLOSING ")"
LDY POKER
LDA POKER+1
RTS
;
GTFF5 JMP GETPIN ;EVALUATE IT
.SKIP 4
; PRMRPT CHECKS FOR A REPEATED PARAMETER.
;
; ENTRY A CONTAINS PARSTS FLAG TO CHECK.
PRMRPT
AND PARSTS ;AND WITH PARSTS
BNE SNER ;IF BIT PREVIOUSLY SET
RTS
AND PARSTS ;AND WITH PARSTS
BNE SNER ;IF BIT PREVIOUSLY SET
RTS
;
; PRXRPT CHECKS FOR A REPEATED PARAMETER.
;
; ENTRY A CONTAINS PARSTX FLAG TO CHECK.
PRXRPT
AND PARSTX ;AND WITH PARSTX
BNE SNER ;IF BIT PREVIOUSLY SET
RTS
AND PARSTX ;AND WITH PARSTX
BNE SNER ;IF BIT PREVIOUSLY SET
RTS
.END

+ 380
- 380
BASIC_CBM2_A/butes2 View File

@@ -6,409 +6,409 @@
;
TABFCB
TCLR=*-TABFCB
.BYT <FCLRM1 ;CLEAR
.BYT <FCLRM1 ;CLEAR
TCAT=*-TABFCB
.BYT FCAT-1 ;CATALOG
.BYT FCAT-1 ;CATALOG
TOPN=*-TABFCB
.BYT FOPN-1 ;DOPEN DSAVE DLOAD
.BYT FOPN-1 ;DOPEN DSAVE DLOAD
TAPN=*-TABFCB
.BYT FAPN-1 ;APPEND
.BYT FAPN-1 ;APPEND
THED=*-TABFCB
.BYT FHED-1 ;HEADER
.BYT FHED-1 ;HEADER
TCOLL=*-TABFCB
.BYT FCOLL-1 ;COLLECT
.BYT FCOLL-1 ;COLLECT
TBAK=*-TABFCB
.BYT FBAK-1 ;BACKUP
.BYT FBAK-1 ;BACKUP
TCOPY=*-TABFCB
.BYT FCOPY-1 ;COPY
.BYT FCOPY-1 ;COPY
TCONC=*-TABFCB
.BYT FCONC-1 ;CONCAT
.BYT FCONC-1 ;CONCAT
TREN=*-TABFCB
.BYT FREN-1 ;RENAME
.BYT FREN-1 ;RENAME
TSCR=*-TABFCB
.BYT FSCR-1 ;SCRATCH
.BYT FSCR-1 ;SCRATCH
TREC=*-TABFCB
.BYT FREC-1 ;RECORD
;
XSCA =$C2 ;SEND DOSSCA
XID =$D0 ;SENDS DISK ID
XD1 =$D1 ;SENDS DOSDS1
XD2 =$D2 ;SENDS DOSDS2
XREC =$E0 ;SENDS S FOR SEQ OR DOSRCL
XWRT =$E1 ;SENDS W OR L
XRCL =$E2 ;SEND LOW ((POKER))
XFAT =$F0 ;SENDS "@" IF SPECIFIED
XFN1 =$F1 ;SENDS FILENAME1
XFN2 =$F2 ;SENDS FILENAME2
.BYT FREC-1 ;RECORD
;
XSCA =$C2 ;SEND DOSSCA
XID =$D0 ;SENDS DISK ID
XD1 =$D1 ;SENDS DOSDS1
XD2 =$D2 ;SENDS DOSDS2
XREC =$E0 ;SENDS S FOR SEQ OR DOSRCL
XWRT =$E1 ;SENDS W OR L
XRCL =$E2 ;SEND LOW ((POKER))
XFAT =$F0 ;SENDS "@" IF SPECIFIED
XFN1 =$F1 ;SENDS FILENAME1
XFN2 =$F2 ;SENDS FILENAME2
;
; TABLD - TOKEN TABLE DEFINITIONS
;
TABLD ;USED TO BUILD DISK COMMAND STRINGS
FCLR =*-TABLD
FCLRM1 =FCLR-1
.BYT 'I',XD1
FCAT =*-TABLD
.BYT '$',XD1,':',XFN1
TABLD ;USED TO BUILD DISK COMMAND STRINGS
FCLR =*-TABLD
FCLRM1 =FCLR-1
.BYT 'I',XD1
FCAT =*-TABLD
.BYT '$',XD1,':',XFN1
;
FOPN =*-TABLD
.BYT XFAT,XD1,':',XFN1,',',XWRT,',',XREC
FOPN =*-TABLD
.BYT XFAT,XD1,':',XFN1,',',XWRT,',',XREC
;
FCONC =*-TABLD
.BYT 'C',XD2,':',XFN2,'=',XD2,':',XFN2,','
FAPN =*-TABLD
.BYT XD1,':',XFN1,',','A'
FCONC =*-TABLD
.BYT 'C',XD2,':',XFN2,'=',XD2,':',XFN2,','
FAPN =*-TABLD
.BYT XD1,':',XFN1,',','A'
;
FHED =*-TABLD
.BYT 'N',XD1,':',XFN1,',',XID
FHED =*-TABLD
.BYT 'N',XD1,':',XFN1,',',XID
;
FCOLL =*-TABLD
.BYT 'V',XD1
FCOLL =*-TABLD
.BYT 'V',XD1
;
FBAK =*-TABLD
.BYT 'D',XD2,'=',XD1
FBAK =*-TABLD
.BYT 'D',XD2,'=',XD1
;
FCOPY =*-TABLD
.BYT 'C',XD2,':',XFN2,'=',XD1,':',XFN1
FCOPY =*-TABLD
.BYT 'C',XD2,':',XFN2,'=',XD1,':',XFN1
;
FREN =*-TABLD
.BYT 'R',XD1,':',XFN2,'=',XD1,':',XFN1
FREN =*-TABLD
.BYT 'R',XD1,':',XFN2,'=',XD1,':',XFN1
;
FSCR =*-TABLD
.BYT 'S',XD1,':',XFN1
FSCR =*-TABLD
.BYT 'S',XD1,':',XFN1
;
FREC =*-TABLD
.BYT 'P',XSCA,XRCL,XREC
FREC =*-TABLD
.BYT 'P',XSCA,XRCL,XREC
.PAG
; SEND PARAMETERS TO DEVICE
;
; ENTRY A NUMBER OF BYTES IN FORMAT.
; Y --> TABLD ENTRY.
SAV20 JSR CHK2
LDY #TOPN ;TABLE OFFSET
SAV21 LDA #4 ;LENGTH
SAV20 JSR CHK2
LDY #TOPN ;TABLE OFFSET
SAV21 LDA #4 ;LENGTH
SENDP
STA XCNT ;SAVE NUMBER OF STRING BYTES
LDA TABFCB,Y ;GET POINTER INTO TABLD
PHA
JSR OLDCLR ;CLEAR OLD STATUS
STA XCNT ;SAVE NUMBER OF STRING BYTES
LDA TABFCB,Y ;GET POINTER INTO TABLD
PHA
JSR OLDCLR ;CLEAR OLD STATUS
;
LDX #0
LDX #0
SDP1
PLA
DEC XCNT
BMI TRANR
TAY
INY ;MOVE DOWN TABLE
TYA
PHA
LDA TABLD,Y ;GET NEXT ENTRY
BPL SDP5 ;IF NOT ESCAPE CODE
CMP #XSCA ;IF NOT SECONDARY ADDRESS
BEQ RSCA
CMP #XID
BEQ RID ;IF DISK ID
CMP #XRCL
BEQ RDCN ;IF RECORD NUMBER
CMP #XWRT
BEQ RWRT ;IF W OR L
CMP #XFAT
BEQ RFAT ;IF "@" SYMBOL REQUEST
CMP #XFN1
BEQ RSFN ;IF FILENAME 1
CMP #XFN2
BEQ GORDFN ;IF FILENAME 2
CMP #XREC
BNE SDP2 ;IF NOT RECORD TYPE
LDA DOSRCL ;GET REC #
BNE SDP5 ;ALWAYS BRANCH
SDP2 CMP #XD1
BNE SDP3 ;IF NOT DRIVE 1
LDA DOSDS1
BPL SDP4 ;ALWAYS BRANCH
SDP3 CMP #XD2
BNE SDP1 ;IF NOT DRIVE 2, CONTINUE
LDA DOSDS2
SDP4 ORA #'0 ;CHANGE # TO ASCII
;
SDP5 STA DOSSTR,X ;ELSE INTO BUFFER
INX
BNE SDP1 ;ALWAYS
PLA
DEC XCNT
BMI TRANR
TAY
INY ;MOVE DOWN TABLE
TYA
PHA
LDA TABLD,Y ;GET NEXT ENTRY
BPL SDP5 ;IF NOT ESCAPE CODE
CMP #XSCA ;IF NOT SECONDARY ADDRESS
BEQ RSCA
CMP #XID
BEQ RID ;IF DISK ID
CMP #XRCL
BEQ RDCN ;IF RECORD NUMBER
CMP #XWRT
BEQ RWRT ;IF W OR L
CMP #XFAT
BEQ RFAT ;IF "@" SYMBOL REQUEST
CMP #XFN1
BEQ RSFN ;IF FILENAME 1
CMP #XFN2
BEQ GORDFN ;IF FILENAME 2
CMP #XREC
BNE SDP2 ;IF NOT RECORD TYPE
LDA DOSRCL ;GET REC #
BNE SDP5 ;ALWAYS BRANCH
SDP2 CMP #XD1
BNE SDP3 ;IF NOT DRIVE 1
LDA DOSDS1
BPL SDP4 ;ALWAYS BRANCH
SDP3 CMP #XD2
BNE SDP1 ;IF NOT DRIVE 2, CONTINUE
LDA DOSDS2
SDP4 ORA #'0 ;CHANGE # TO ASCII
;
SDP5 STA DOSSTR,X ;ELSE INTO BUFFER
INX
BNE SDP1 ;ALWAYS
;
GORDFN
BEQ RDFN
BEQ RDFN
;
TRANR
TXA ;LENGTH TO A
PHA
LDX #<DOSSTR ;SET FILENAME
LDY #>DOSSTR
STX HIGHDS ; SET UP VECTOR FOR FILENAME
STY HIGHDS+1
LDY #SYSBNK ;FILENAME IS IN SYSTEM BANK
STY HIGHDS+2
JSR SAV3
PLA
RTS
TXA ;LENGTH TO A
PHA
LDX #<DOSSTR ;SET FILENAME
LDY #>DOSSTR
STX HIGHDS ; SET UP VECTOR FOR FILENAME
STY HIGHDS+1
LDY #SYSBNK ;FILENAME IS IN SYSTEM BANK
STY HIGHDS+2
JSR SAV3
PLA
RTS
.SKI 4
RSCA LDA DOSSA ;SECONDARY ADDRESS (RECORD)
BNE SDP5 ;ALWAYS
RSCA LDA DOSSA ;SECONDARY ADDRESS (RECORD)
BNE SDP5 ;ALWAYS
;
RFAT
BIT PARSTS
BMI RFATA
BPL SDP1 ;IF @ NOT ENCOUNTERED
RFATA LDA #'@
BNE SDP5 ;ALWAYS
BIT PARSTS
BMI RFATA
BPL SDP1 ;IF @ NOT ENCOUNTERED
RFATA LDA #'@
BNE SDP5 ;ALWAYS
;
; ID SUBROUTINE
RID
LDA DOSDID ;INCLUDE ID
STA DOSSTR,X
INX
LDA DOSDID+1
BNE SDP5 ;ALWAYS
LDA DOSDID ;INCLUDE ID
STA DOSSTR,X
INX
LDA DOSDID+1
BNE SDP5 ;ALWAYS
;
RWRT
LDA DOSRCL ;CHK FOR L OR W
BEQ RWRT1 ;ZERO THEN WRITE
LDA #'L
BNE SDP5 ;ALWAYS
LDA DOSRCL ;CHK FOR L OR W
BEQ RWRT1 ;ZERO THEN WRITE
LDA #'L
BNE SDP5 ;ALWAYS
;
RWRT1 LDA #'S ;SEND W,S
STA DOSRCL
LDA #'W
BNE SDP5 ;ALWAYS
RWRT1 LDA #'S ;SEND W,S
STA DOSRCL
LDA #'W
BNE SDP5 ;ALWAYS
;
; MOVE RECORD NUMBER
RDCN
LDA POKER
STA DOSSTR,X
LDA POKER+1
INX
BNE SDP5 ;ALWAYS
LDA POKER
STA DOSSTR,X
LDA POKER+1
INX
BNE SDP5 ;ALWAYS
;
; MOVE FILE NAMES.
RSFN
LDA DOSF1A
STA INDEX1
LDA DOSF1A+1
STA INDEX1+1
LDA DOSF1B
LDY DOSF1L
BEQ RDRT0 ;IF NULL STRING
BNE XRFN ;ALWAYS
LDA DOSF1A
STA INDEX1
LDA DOSF1A+1
STA INDEX1+1
LDA DOSF1B
LDY DOSF1L
BEQ RDRT0 ;IF NULL STRING
BNE XRFN ;ALWAYS
;
RDFN
LDA DOSF2A
STA INDEX1
LDA DOSF2A+1
STA INDEX1+1
LDA DOSF2B
LDY DOSF2L
BEQ RDRT0 ;IF NULL STRING
LDA DOSF2A
STA INDEX1
LDA DOSF2A+1
STA INDEX1+1
LDA DOSF2B
LDY DOSF2L
BEQ RDRT0 ;IF NULL STRING
;
XRFN
STA I6509 ;SET INDIRECTION BANK
STY COUNT
LDY #0 ;MOVE NAME TO DOSSTR
RDMOV LDA (INDEX1)Y
STA DOSSTR,X
INX
INY
CPY COUNT
BNE RDMOV ;IF MOVE NOT COMPLETE
.BYTE $24 ;HOP
RDRT0 DEX ;CASE CDD=SD
STA I6509 ;SET INDIRECTION BANK
STY COUNT
LDY #0 ;MOVE NAME TO DOSSTR
RDMOV LDA (INDEX1)Y
STA DOSSTR,X
INX
INY
CPY COUNT
BNE RDMOV ;IF MOVE NOT COMPLETE
.BYTE $24 ;HOP
RDRT0 DEX ;CASE CDD=SD
RDRT1
JSR MAPTXT ;RESTORE INDIR BANK
JMP SDP1 ;GET NEXT SYMBOL
JSR MAPTXT ;RESTORE INDIR BANK
JMP SDP1 ;GET NEXT SYMBOL
.PAG
; SYNTAX CHECKER
; ROUTINES FOR DOS.WRITE
CHK1
AND #$E6 ;FOR HEADER,DLOAD,SCRTCH
BEQ CHK2 ;CHK OPT PARMS
CHKER1 JMP SNERR
AND #$E6 ;FOR HEADER,DLOAD,SCRTCH
BEQ CHK2 ;CHK OPT PARMS
CHKER1 JMP SNERR
;
CHK2
LDA PARSTS ;FOR DSAVE
AND #1
CMP #1 ;CHK REQ'D PARMS
BNE CHKER1 ;ERROR IF 1 MISSING
LDA PARSTS ;RELOAD FOR RETURN
RTS
;
CHK3 AND #$E7 ;FOR COLECT
BNE CHKER1 ;CHK OPT PARMS
RTS
;
CHK4 AND #$C4 ;FOR COPY,CONCAT
BNE CHKER1 ;CHK OPT PARMS
LDA PARSTS
CHK5 AND #3 ;FOR RENAME
CMP #3 ;CHK REQ'D PARMS
BNE CHKER1