!pr0
!lm12
!rm75  
More opcodes for the S-C MACRO ASSEMBLER.........R.F. O'Brien
 
 
While using the assembler I felt that it was a pity that the BGE and BLT instructions had not been incorporated especially as it would only have meant an extra 6 bytes of code. This minimal extra overhead is because of the way opcodes are handled in the assembler.
 
Take for example the BRANCH opcode table, which resides in locations $EF5B-EF93. ($2E29-2E47 for RAM version.)  [ These addresses are for version 1.0 ]
 
This table is preceded by a 2-byte descriptor and ends as one would expect with a 00 as end-of-table marker. The descriptor in this case is 0302, i.e. 3-byte entries having a 2-byte name. The table holds the standard 8 6502-opcodes and the 10 Sweet-16 opcodes, interestingly the B of each instruction name has been dropped, saving 18 bytes.

The entries in the table consist of the last 2 letters of the instruction name followed by the hex code. In the case of 2-letter names the entry consists of the second letter plus a space ($20) followed by its hex code.

I decided that I could dispense with the SW-16 codes BM1 and BNM1 without suffering too much if I wanted to write Sweet-16 code in my programs. However, I found that to incorporate the new codes they would have to be placed between the 6502 codes and the SW-16 codes in the table.

It was just a matter of pushing the code for BR to BNZ up in RAM 6 bytes and slotting in the code for BLT and BGE.

To install the code for the two new opcodes just enter the following at any convenient location e.g.$4000 and BSAVE as BLT/BGE.CODE,A$4000,L$1F

     :$4000:47 45 B0 4C 54 90     ("G E B0  L T 90")
     :$:52 20 01 4E 43 02 43 20 03 50 20 04
     :$:4D 20 05 5A 20 06 4E 5A 07 53 20 0C 00
 
  
To install in LC-Version just enter:

     :$C083 C083        write enable card.
     :BLOAD BLT/BGE.CODE,A$EF75
     :$C080             write protect card.

To install in RAM-Version just enter:

     :BLOAD BLT/BGE.CODE,A$2E29
 
If you never use Sweet-16 you only need to use the first 6 bytes of the above code. However, this will wipe out the BR and BNC codes in the table.
!np
Now you can use either BCC or its synonym BLT (Branch if Less Than) and BCS or BGE (Branch if Greater than or Equal to) in your programs and have them assembled correctly without using macro definitions.

The load address for the patch file for version 1.1 will vary depending on which of the 8 versions you are patching:

!lm+5
               40-col  //e    Videx  STB-80
Motherboard    $31A9   318D   3274   329D

RAM Card       $F2C3   F2A7   F397   F3C0
!lm-5
