Macros in Source Code
The following is a listing of the macros used in this source listing. You will be able to tell when a macro was used by a plus (+) sign to the left of the hex code produced in column two by the assembler. ASLA: MACRO %L ASL A ENDM RORA: MACRO %L ROR A ENDS LSRA: MACRO %L LBR A ENDM ROLA: MACRO %L ROL ENDM FDB: MACRO %L DW REV (%1) IF '=%2' <> '=' DW REV (%2) IF '=%3' <> '=' DW REV (%3) IF '=%4' <> '=' DW REV (%4) IF '=%5' <> '=' DW REV (%5) ENDIF EBDIF ENDIF ENDIF ENDM LOCAL: MACRO PROC ENDM BYTE: MACRO IF '%I' = '=' %L DB $80+((%2-*)&$7F) XOR $40 ) ELSE IF '%1' = '@@' %L DW ( %2 ) ELSE %L DB %1 ENDIF ENDIF ENDM Syntax Table Macro ;THIS MACRO IS 1110 TO SIMULATE THE ACTION OF THE ORIGINAL ;ASSEMBLER IN HANDLING SPECIAL SYNTAX TABLE PSEUDO OPS AND ;OPERANDS ; ;THE 'SYN' MACRO EXAMINES UP TO 4 ARGUMENTS FOR CERTAIN SPECIAL ;CASE NAMES. ; ;IF THE NAME 'JS' IS FOUND, IT GENERATES A SPECIAL 'RELATIVE ; SYNTAX JSR' TO THE LABEL FOUND IN THE NEXT PARAMETER 273The Bugs in Atari BASIC
Yes, it's true. There are some bugs in Atari BASIC. Of course, that's not surprising, since Atari released the product as ROM without giving the authors a chance to do second-round bug- fixing. But what hurts, a little, is that most of the fixes for the bugs have been known since June of 1979. As this book is being written, rumor has it that at last Atari is in the final stages of releasing a new version of the BASIC ROMs. Unfortunately, these modified ROMs will appear too late for us to comment upon them in this edition. On the other hand, there are supposed to be fewer than twenty fixes implemented (which isn't a bad record for a product as mature as Atari BASIC), so those of you who are willing to PEEK around a bit can use this listing as at least a road map to the new ROMs. In any case, though, we thought it would be appropriate to mention a few of the bugs we know about, show you why they exist, and tell how we fixed them back there in the summer of '79. The Editing and String Bug In the course of editing a BASIC program, sometimes the system loses all or part of the program, or it simply hangs. Often, even SYSTEM RESET will not return control to the user. Also, string assignments that involve the movement of exact multiples of 256 bytes do not move the bytes properly. For example, A$=B$(257,512) would actually move bytes 513 through 768 of B$ into bytes 257 through 512 of A$, even if neither string were DIMensioned to those values. Both of these are really the same bug. And both are caused because we strove to be a little too efficient. There are many ways to move strings of bytes using the 6502's instruction set. The simplest and most-used methods, though, are excruciatingly slow. So Paul and Kathleen invented a super-fast set of move-memory routines, one for 275Labels and Hexadecimal Addresses
AADD AF52 CGTO 0017 CVFPI AD56 EREXPR AAE0 AAPSTR AB98 CILET 0036 CVIFP D9AA EXOPOP AB0B n ADC AF53 CIO E456 DATAD 00B6 EXP DDC0 ADFLAG 00B1 CIX 00F2 DATALN 00B7 EXP1 DE03 n AFP D800 CLALL1 BD4F n DCBORG 0300 EXP10 DDCC AMULl AF5D CLE 001D DEGFLG 00FB EXP2 DE20 AMUL2 AF46 CLEN 0042 DEGON 0006 EXP3 DE26 APHM 000E CLIST 0004 DIGRT 00F1 EXPAND A881 ARGOPS 0080 CLPRR 002B DIRFLG 00A6 EXPERR DE4B ARGP2 AC06 CLSALL BD41 DNERR BCB0 EXPINT AB2E ARGPOP ABF2 CLSYS1 BCF1 DOSLOC 000A EXPLOW A87F ARGPUS ABBA CLSYSD BCF1 DSPFLG 02FE EXPOUT DE4A ARGSTK 0080 CLT 0020 ECSIZE 00A4 EXPSGN DE39 ARSLVL 00AA CMINUS 0026 EEXP 00ED EXSVOP 00AB ARSTKX 00AA CMUL 0024 ELADVC BADD EXSVPR 00AC n ASCIN D800 CNE 001E ENDSTA 008E FADD DA66 ASLA mac CNFNP 0044 ENDVVT 0088 n FASC D8E6 ATAN BE77 CNOT 0028 ENTDTD 00B4 FBODY 000C ATAN1 BE9A COLD1 A008 EPCHAR 005D FCHRFL 00F0 ATAN2 BED4 COLDST A000 ERBRTN B920 FDB mac ATCOEF DFAE COLOR 00C8 ERGFDE B922 FDIV DB28 ATEMP 00AF COMCNT 00B0 ERLTL B924 FHALF DF6C ATNOIT BEE2 CON 001E ERNOFO B926 FIXRST B825 BININT 00D4 COSTLO A8FB ERNOLN B928 FLD01 DD8F BOTH BDB3 CONTRA A8FD n ERON B93E n FLD0P DD8D BRKBYT 0011 COPEN BBB6 EROVFL B92A FLD0R DD89 BYELOC E471 COR 0029 ERRAOS B92C FLDl1 DD9E n BYTE mac COS BDB1 ERRDIM B92E FLD1P DD9C C 0044 C0X 0094 ERRDNO B918 FLD1R DD98 BYELOC E471 CPC 009D ERRINP B930 FLIM 0000 n BYTE mac CPLUS 0025 ERRLN B932 FLIST BAD5 C 0044 CPND 001C ERRNSF B916 n FLOG10 DF01 CAASN 002D CR 009B ERRNUM 00B9 FLPTR 00FC CACOM 003C CREAD 0022 ERROOD B934 FMOVE DDB6 CADR 0043 CREGS 02C4 ERROR B940 PMOVE1 DDB8 CALPRN 0038 CRPRN 002C ERRPTL B91A FMOVER A947 CAND 002A CRTGI BFF9 ERRRAV 003C FMPREC 0005 CASC 0040 CSASN 002E ERRSSL B936 FMUL DADB CCHX 0031 CSC 0015 ERRVSF B938 n FNTAB A829 CCOM 0012 CSEQ 0034 ERSVAL B91C FONE DE8F CCR 0016 CSGE 0031 ERVAL B93A FP9S DFEA CDATA 0001 CSGT 0033 ESIGN 00EF FPI D9D2 CDIV 0027 CSLE 002F EVAADR 0002 FPONE BE71 CDLPRn 0039 CSLPRN 0037 EVAD1 0004 FPORG D800 n CDOL 0013 CSLT 0032 EVAD2 0006 FPREC 0006 n CDQ 0010 CSNE 0030 n EVARRA 0040 FPSCR 05E6 CDSLPR 003B CSOE 0011 EVDIM 0001 FPSCR1 05EC CEOS0 0014 CSROP 001D n EVNUM 0001 FPTR2 00FE CEQ 0022 CSTEP 001A EVSADR 0002 FR0 00D4 CERR 0037 CSTR 003D EVSCAL 0000 FR0M 00D5 CEXP 0023 CTHEN 001B EVSDIM 0006 FR1 00E0 CFFUN 003D CTO 0019 EVSDTA 0002 FR1M 00E1 CFLPRN 003A CUMINU 0036 EVSLEN 0004 FR2 00E6 CFOR 0008 CUPLUS 0035 EVSTR 0080 FRA10 DD01 CGE 001F CUSR 003F n EVTYPE 0000 FRA1E DD09 CGOSOB 000C CVAFP D800 n EVVALU 0002 FRA20 DD05 CGS 0018 CVAL 0041 EXECNL A95F FRA2E DD0F CGT 0021 CVFASC D8E6 EXECNS A962 FRADD AD3B 281