!pr3
Questions and Answers

I have just finished installing Version 2.0 of your assembler, and I have a few questions.

a.  First, how is the line length of the escape-L changed?  The short line looks ridiculous on an 80-column screen.  I would also like to change the first character from "*" to ";".

b.  How can I get the assembler to initialize things with DOS's MON CI modes set?

c.  In working with big programs, it is easy to exceed line number 9999.  It happens all the time.  As new lines get added, the formatting of lines around 9999 goes haywire, as the spacing is done according to the line number at the time of entry.  Thus when a line number changes from 4 to 5 digits or vice versa due to renumbering the opcode and operand columns no longer line up properly.  What can be done about the erratic column alignment?

d.  I noticed that the symbol table generated by an assembly takes more memory with version 2.0 than it did with 1.1. Why?

e.  There appear to be two errors in the sample program S.INLINE on the Macro 2.0 disk.  The comment on how to use it shows a comma between the &INPUT and the string variable, when the program in fact requires that there be NO comma.  Then, the first line of the main routine does a CMP, which should be an LDA.  With these corrections, the program is great.  &INPUT will accept input from keyboard or disk, and reads the complete record including commas, quotes, and colons.  This I find rather useful.

Mike Lawrie, South Africa

!lm+3

a.  The routine which generates the star-dash line starts at $DB21, with the following:

       TXA
       BEQ ...
       LDA #$AA        change to $BB for ";"
       JSR ...
       LDA $D01E   ("-" CHAR)
       CPX #$26        increase as you like

For example, I changed mine just now like this:

       $C083 C083 DB25:BB N DB2D:46


b.  Whatever selections you have turned on with the MON command are turned off by the DOS "INT" or "FP" commands.  I guess if you want the MONCI modes all the time you could add code to the assembler to set the proper bits inside DOS.  The flags are in $AA5E:  C=$40, I=$20, O=$10.  Store $60 into $AA5E to effect MONCI.

c.  I agree with you that it is annoying the way the columns stagger when the line numbers are near 9999.  There are several possible solutions.  One solution, is to start line numbers at 10000.  You can do this by changing the code at $D32B:

       LDA #990       change to #9990
       STA ...
       LDA /990       change to /9990

A better way is to make a the line numbers always print with five digits.  To effect this, change the code at $DE63:

       LDX #3  change to LDX #4

       $C083 C083 DE64:4

d.  The symbol table does indeed take more space in version 2.0 than it did in previous versions.  This is due to the fact that symbols can have values up to 32-bits long.  Every symbol has two more bytes in the table now.

e.  Right on both counts.  Disks with serial numbers 1186 and larger have the corrections you give.
!lm-3


Is there any way of loading a program from the monitor (without going back to Basic) or reload DOS or reboot without losing what is in memory?

Munson Compton, Shreveport, LA

!lm+3
If you entered the monitor via CALL-151 from Basic, or MNTR or MGO-151 from the S-C Macro Assembler, DOS is still alive and will still respond to commands.  You can BLOAD or LOAD a program, but of course using LOAD will flip you into either Applesoft, Integer BASIC, or the Macro Assembler depending on file type and what languages are around.  If you want to stay in the monitor after the LOAD file has been read into memory, you could temporarily patch the DOS LOAD code which starts at $A413.  The book "Beneath Apple DOS" would be helpful here.  It looks to me like you could so subvert type A files by patching the JMP ($9D60) at $A44D to RTS (by putting 60 at $A44D).  Type I files might be tricked by putting an RTS (60) at $A5AF.  I don't know what other ramifications these patches might have.  Beware!!!

You can reboot a slave disk without losing the actual text of an assembler source file from memory.  However, the pointer which tells the assembler where the program starts will be reset.  Before rebooting, record the value stored in $CA and $CB, and after getting back into the assembler restore those two bytes.  Of course, if the assembler is in the language card rebooting DOS marks it as not being there.  From the monitor you can put it all back by typing:
!np
       ]CALL-151
       *C081 C081 E000:20
       *INT
       :$CA:...(whatever values you recorded earlier)
       :LIST   (Voila!)

!lm-3

I have the Apple ToolKit and the Big Mac assemblers, and use them primarily to key in source files from articles such as yours.  I've figured out how to transpose most of the different labels and opcodes, but would like some enlightenment on the use of the .1, .2, .3 etc. labels that are repeated in the code.  I assume this is a capability of your assembler that others don't have.

David Roberson

!lm+3
For help in converting our listings to other assemblers and vice versa, you should refer to my "Directory of Assembler Directives" article in the September 1982 AAL.  You are correct in assuming that most other assemblers do not have the kind of local labels as the S-C assemblers, but some do.  These numeric labels are one or two digits after a period, and are very convenient for branch points within a sub- routine.  They are defined below a normal label, and are only accessible within that area.  The local labels are defined internally relative to the preceding normal label, and must be within a 255-byte range after the normal label.  Once a new normal label is defined, a whole new set of local labels is available.  The use of local labels simplifies programming, because there is no need to think up dozens of unique names like LOOP1, LOP2, LUPA, LUPB, and so on.  Local labels also encourage writing good modular code, with only one entry point per module, since the local labels are not accessible outside the routine in which they are defined.

The LISA assembler uses a different type of numeric label, which I call a near-by label.  These are redefinable at will, and when they are referenced a pointer must be included to tell the assembler which direction to search for the definition.  You can refer to the nearest definition in either a forward or backward direction.  I get thoroughly confused trying to read and/or modify programs using these.
!lm-3
.
.
.
.
.
.
.
.
.
1
