
 1000  *SAVE S.DISPLAY CHAR SET
 1010  *--------------------------------
 1020  *      DISPLAY CHARACTER SET
 1030  *--------------------------------
 1040  CNT8       .EQ $00
 1050  B          .EQ $01
 1060  CNT16      .EQ $02
 1070  *--------------------------------
 1080  EPROM.A.IMAGE  .EQ $6800
 1090  EPROM.B.IMAGE  .EQ $7000
 1100  *--------------------------------
 1110  AS.HGR     .EQ $F3E2
 1120  *--------------------------------
 1130         .OR $803
 1140  DISPLAY
 1150  *---TURN ON HI-RES GRAPHICS------
 1160         LDA $C081    GET A/S ROMS ON MOTHERBOARD
 1170         JSR AS.HGR
 1180         LDA $C080    BACK TO S-C ASM IN RAM CARD
 1190  *---FIRST CHAR SET---------------
 1200         LDA /$2000   TOP LINE, LEFT SIDE
 1210         STA SCREEN.ADR+1
 1220         LDA #$2000
 1230         STA SCREEN.ADR
 1240         LDA /EPROM.A.IMAGE  FIRST CHARACTER SET
 1250         STA EPROM.ADR+1
 1260         LDA #EPROM.A.IMAGE
 1270         STA EPROM.ADR
 1280         JSR DISPLAY.ONE.SET
 1290  *---SECOND CHAR SET--------------
 1300         LDA /$2014   TOP LINE, RIGHT SIDE
 1310         STA SCREEN.ADR+1
 1320         LDA #$2014
 1330         STA SCREEN.ADR
 1340         LDA /EPROM.B.IMAGE  SECOND CHARACTER SET
 1350         STA EPROM.ADR+1
 1360         LDA #EPROM.B.IMAGE
 1370         STA EPROM.ADR
 1380         JSR DISPLAY.ONE.SET
 1390  *---PAUSE UNTIL KEYSTROKE--------
 1400  .1     LDA $C000
 1410         BPL .1
 1420         STA $C010
 1430         RTS          RETURN TO ASSEMBLER
 1440  *--------------------------------
 1450  *      DISPLAY ONE CHARACTER SET IN 16-BY-16 FORMAT
 1460  *--------------------------------
 1470  DISPLAY.ONE.SET
 1480         LDA #16      COUNT 16 ROWS
 1490         STA CNT16
 1500  .1     JSR DISPLAY.ONE.ROW
 1510  *---NEXT ROW IN EPROM DATA-------
 1520         CLC
 1530         LDA EPROM.ADR
 1540         ADC #15*8
 1550         STA EPROM.ADR
 1560         LDA EPROM.ADR+1
 1570         ADC #0
 1580         STA EPROM.ADR+1
 1590  *---NEXT ROW ON SCREEN-----------
 1600         SEC
 1610         LDA SCREEN.ADR
 1620         SBC #$2000-$80
 1630         STA SCREEN.ADR
 1640         LDA SCREEN.ADR+1
 1650         SBC /$2000-$80
 1660         STA SCREEN.ADR+1
 1670         CMP #$24          HIT THE BREAK YET?
 1680         BCC .2            NO, GO ON
 1690         LDA SCREEN.ADR    YES, ADJUST THE ADDRESSES
 1700         SBC #$400-$28
 1710         STA SCREEN.ADR
 1720         LDA SCREEN.ADR+1
 1730         SBC /$400-$28
 1740         STA SCREEN.ADR+1
 1750  .2     DEC CNT16    LAST ROW YET?
 1760         BNE .1       ...NO
 1770         RTS          ...YES, RETURN
 1780  *--------------------------------
 1790  *      DISPLAY ONE ROW OF 16 CHARACTERS
 1800  *--------------------------------
 1810  DISPLAY.ONE.ROW
 1820         LDA #8       8 SCREEN LINES FOR ONE ROW
 1830         STA CNT8
 1840  .1     LDY #0       EPROM DATA INDEX
 1850         LDX #0       SCREEN IMAGE INDEX
 1860  .2     JSR GET.PUT  MOVE ONE BYTE TO SCREEN
 1870         TYA          ADD 8 TO EPROM DATA INDEX
 1880         CLC
 1890         ADC #8
 1900         TAY
 1910         INX          BUMP SCREEN IMAGE INDEX
 1920         CPX #16
 1930         BCC .2       MORE CHARACTERS
 1940         INC EPROM.ADR  BUMP TO NEXT LINE OF EPROM DATA
 1950         LDA SCREEN.ADR+1   +$400
 1960         ADC #3       (CARRY = 1)
 1970         STA SCREEN.ADR+1
 1980         DEC CNT8     NEXT SCREEN LINE
 1990         BNE .1       ...IF ANY
 2000         RTS          RETURN
 2010  *--------------------------------
 2020  *      REVERSE THE ORDER OF BITS 6-0 IN A-REG
 2030  *      (CHANGE XABCDEFG TO 0GFEDCBA)
 2040  *--------------------------------
 2050  REVERSE.BITS
 2060         LSR          REVERSE 7 BITS
 2070         ROL B        A=0XABCDEF  B=XXXXXXXG
 2080         LSR
 2090         ROL B        A=00XABCDE  B=XXXXXXGF
 2100         LSR
 2110         ROL B        A=000XABCD  B=XXXXXGFE
 2120         LSR
 2130         ROL B        A=0000XABC  B=XXXXGFED
 2140         LSR
 2150         ROL B        A=00000XAB  B=XXXGFEDC
 2160         LSR
 2170         ROL B        A=000000XA  B=XXGFEDCB 
 2180         LSR
 2190         ROL B        A=0000000X  B=XGFEDCBA
 2200         LDA B
 2210         AND #$7F     0GFEDCBA
 2220         RTS
 2230  *--------------------------------
 2240  *      PICK UP A BYTE OF EPROM DATA,
 2250  *      REVERSE THE BITS, AND STORE
 2260  *      IT ON THE SCREEN.
 2270  *--------------------------------
 2280  GET.PUT
 2290         LDA $FFFF,Y
 2300  EPROM.ADR .EQ *-2
 2310         JSR REVERSE.BITS
 2320         STA $FFFF,X
 2330  SCREEN.ADR .EQ *-2
 2340         RTS
 2350         .LIF

