Formatting; uppercase

This commit is contained in:
Seth Morabito committed 2014-08-16 16:54:36 -07:00
1 parent 4796b65390
commit cad3673bd2
2 files changed
+121 -93

No files matched your search

+27 -27
View File
@@ -7795,11 +7795,11 @@ StrTab
EndTab EndTab
LAB_MSZM LAB_MSZM
.byte $0D,$0A,"Memory size ",$00 .byte $0D,$0A,"MEMORY SIZE ",$00
LAB_SMSG LAB_SMSG
.byte " Bytes free",$0D,$0A,$0A .byte " BYTES FREE",$0D,$0A,$0A
.byte "Enhanced BASIC 2.22",$0A,$00 .byte "ENHANCED BASIC 2.22",$0A,$00
; numeric constants and series ; numeric constants and series
@@ -8655,24 +8655,24 @@ LAB_BAER
; .word ERR_UA ;$26 undimensioned array ; .word ERR_UA ;$26 undimensioned array
ERR_NF .byte "NEXT without FOR",$00 ERR_NF .byte "NEXT WITHOUT FOR",$00
ERR_SN .byte "Syntax",$00 ERR_SN .byte "SYNTAX",$00
ERR_RG .byte "RETURN without GOSUB",$00 ERR_RG .byte "RETURN WITHOUT GOSUB",$00
ERR_OD .byte "Out of DATA",$00 ERR_OD .byte "OUT OF DATA",$00
ERR_FC .byte "Function call",$00 ERR_FC .byte "FUNCTION CALL",$00
ERR_OV .byte "Overflow",$00 ERR_OV .byte "OVERFLOW",$00
ERR_OM .byte "Out of memory",$00 ERR_OM .byte "OUT OF MEMORY",$00
ERR_US .byte "Undefined statement",$00 ERR_US .byte "UNDEFINED STATEMENT",$00
ERR_BS .byte "Array bounds",$00 ERR_BS .byte "ARRAY BOUNDS",$00
ERR_DD .byte "Double dimension",$00 ERR_DD .byte "DOUBLE DIMENSION",$00
ERR_D0 .byte "Divide by zero",$00 ERR_D0 .byte "DIVIDE BY ZERO",$00
ERR_ID .byte "Illegal direct",$00 ERR_ID .byte "ILLEGAL DIRECT",$00
ERR_TM .byte "Type mismatch",$00 ERR_TM .byte "TYPE MISMATCH",$00
ERR_LS .byte "String too long",$00 ERR_LS .byte "STRING TOO LONG",$00
ERR_ST .byte "String too complex",$00 ERR_ST .byte "STRING TOO COMPLEX",$00
ERR_CN .byte "Can't continue",$00 ERR_CN .byte "CAN'T CONTINUE",$00
ERR_UF .byte "Undefined function",$00 ERR_UF .byte "UNDEFINED FUNCTION",$00
ERR_LD .byte "LOOP without DO",$00 ERR_LD .byte "LOOP WITHOUT DO",$00
;ERR_UV .byte "Undefined variable",$00 ;ERR_UV .byte "Undefined variable",$00
@@ -8680,12 +8680,12 @@ ERR_LD .byte "LOOP without DO",$00
;ERR_UA .byte "Undimensioned array",$00 ;ERR_UA .byte "Undimensioned array",$00
LAB_BMSG .byte $0D,$0A,"Break",$00 LAB_BMSG .byte $0D,$0A,"BREAK",$00
LAB_EMSG .byte " Error",$00 LAB_EMSG .byte " ERROR",$00
LAB_LMSG .byte " in line ",$00 LAB_LMSG .byte " IN LINE ",$00
LAB_RMSG .byte $0D,$0A,"Ready",$0D,$0A,$00 LAB_RMSG .byte $0D,$0A,"READY",$0D,$0A,$00
LAB_IMSG .byte " Extra ignored",$0D,$0A,$00 LAB_IMSG .byte " EXTRA IGNORED",$0D,$0A,$00
LAB_REDO .byte " Redo from start",$0D,$0A,$00 LAB_REDO .byte " REDO FROM START",$0D,$0A,$00
AA_end_basic AA_end_basic
+94 -66
View File
@@ -16,17 +16,24 @@ NMI_vec = IRQ_vec+$0A ; NMI code vector
; setup for the 6502 simulator environment ; setup for the 6502 simulator environment
IO_AREA = $8800 IO_AREA = $8800
ACIAdata = IO_AREA ; simulated ACIA r/w port ACIAdata = IO_AREA ; simulated ACIA r/w port
ACIAstatus = IO_AREA+1 ACIAstatus = IO_AREA+1
ACIAcommand = IO_AREA+2 ACIAcommand = IO_AREA+2
ACIAcontrol = IO_AREA+3 ACIAcontrol = IO_AREA+3
CRTC_A = $9000 ; CRTC register select
CRTC_C = $9001 ; CRTC register IO
CADDR_L = $E0 ; Cursor address (low) CADDR_L = $E0 ; Cursor address (low)
CADDR_H = $E1 ; Cursor address (high) CADDR_H = $E1 ; Cursor address (high)
C_COL = $E2 ; Cursor column C_COL = $E2 ; Cursor column
C_ROW = $E3 ; Cursor row C_ROW = $E3 ; Cursor row
COUTC = $E4 ; Temp storage for char out. COUTC = $E4 ; Temp storage for char out.
TMPY = $E5 TMPY = $E5
R_STRT = $E6 ; E6,E7 contains starting address of
; current row
N_ROWS = 24
N_COLS = 40
; now the code. all this does is set up the vectors and interrupt code ; now the code. all this does is set up the vectors and interrupt code
@@ -34,21 +41,29 @@ ACIAcontrol = IO_AREA+3
; fits in less than 128 bytes ; fits in less than 128 bytes
.segment "MONITOR" .segment "MONITOR"
.org $FC00 ; pretend this is in a 1/8K ROM .org $FC00 ; pretend this is in a 1/8K ROM
; reset vector points here ; reset vector points here
RES_vec RES_vec:
CLD ; clear decimal mode CLD ; clear decimal mode
LDX #$FF ; empty stack LDX #$FF ; empty stack
TXS ; set the stack TXS ; set the stack
;; Initialize the CRTC ;; Initialize the CRTC
LDA #$01
STA CRTC_A
LDA #N_COLS ; 40 columns
STA CRTC_C
LDA #$06
STA CRTC_A
LDA #N_ROWS ; 24 rows
STA CRTC_C
JSR CLRVID JSR CLRVID
;; TODO: Initialize params on CRTC ;; TODO: Initialize params on CRTC
; Initialize the ACIA ; Initialize the ACIA
ACIA_init ACIA_init:
LDA #$00 LDA #$00
STA ACIAstatus ; Soft reset STA ACIAstatus ; Soft reset
LDA #$0B LDA #$0B
@@ -59,7 +74,7 @@ ACIA_init
; set up vectors and interrupt code, copy them to page 2 ; set up vectors and interrupt code, copy them to page 2
LDY #END_CODE-LAB_vec ; set index/count LDY #END_CODE-LAB_vec ; set index/count
LAB_stlp LAB_stlp:
LDA LAB_vec-1,Y ; get byte from interrupt code LDA LAB_vec-1,Y ; get byte from interrupt code
STA VEC_IN-1,Y ; save to RAM STA VEC_IN-1,Y ; save to RAM
DEY ; decrement index/count DEY ; decrement index/count
@@ -67,29 +82,29 @@ LAB_stlp
; now do the signon message, Y = $00 here ; now do the signon message, Y = $00 here
LAB_signon LAB_signon:
LDA LAB_mess,Y ; get byte from sign on message LDA LAB_mess,Y ; get byte from sign on message
BEQ LAB_nokey ; exit loop if done BEQ LAB_nokey ; exit loop if done
JSR V_OUTP ; output character JSR V_OUTP ; output character
INY ; increment index INY ; increment index
BNE LAB_signon ; loop, branch always BNE LAB_signon ; loop, branch always
LAB_nokey LAB_nokey:
JSR V_INPT ; call scan input device JSR V_INPT ; call scan input device
BCC LAB_nokey ; loop if no key BCC LAB_nokey ; loop if no key
AND #$DF ; mask xx0x xxxx, ensure upper case AND #$DF ; mask xx0x xxxx, ensure upper case
CMP #'W' ; compare with [W]arm start CMP #'W' ; compare with [W]arm start
BEQ LAB_dowarm ; branch if [W]arm start BEQ LAB_dowarm ; branch if [W]arm start
CMP #'C' ; compare with [C]old start CMP #'C' ; compare with [C]old start
BNE RES_vec ; loop if not [C]old start BNE RES_vec ; loop if not [C]old start
JMP LAB_COLD ; do EhBASIC cold start JMP LAB_COLD ; do EhBASIC cold start
LAB_dowarm LAB_dowarm:
JMP LAB_WARM ; do EhBASIC warm start JMP LAB_WARM ; do EhBASIC warm start
ACIAout: ACIAout:
@@ -140,7 +155,7 @@ CRTCout:
;; Handle a back-space character. ;; Handle a back-space character.
DO_BS: LDA C_COL DO_BS: LDA C_COL
BNE @l1 ; Skip next bit BNE @l1 ; Skip next bit
LDA #$27 LDA #N_COLS-1
STA C_COL STA C_COL
BNE @l2 BNE @l2
@l1: DEC C_COL @l1: DEC C_COL
@@ -165,7 +180,7 @@ DO_CR: SEC
;; 1. Are we on the last row? Scroll. ;; 1. Are we on the last row? Scroll.
LDA C_ROW LDA C_ROW
CMP #$18 CMP #N_ROWS-1
BNE @inc BNE @inc
JSR DO_SCROLL JSR DO_SCROLL
JMP @lf JMP @lf
@@ -186,13 +201,13 @@ DO_CR: SEC
SET_CURSOR: SET_CURSOR:
LDA #14 LDA #14
STA $9000 STA CRTC_A
LDA CADDR_H LDA CADDR_H
STA $9001 STA CRTC_C
LDA #15 LDA #15
STA $9000 STA CRTC_A
LDA CADDR_L LDA CADDR_L
STA $9001 STA CRTC_C
RTS RTS
;; Clear the video window and put the cursor at the home ;; Clear the video window and put the cursor at the home
@@ -224,7 +239,6 @@ CLRVID:
@l5: STA $7400,Y @l5: STA $7400,Y
INY INY
BNE @l5 BNE @l5
LDY TMPY LDY TMPY
RTS RTS
@@ -271,14 +285,14 @@ INC_CADDR:
INC CADDR_L INC CADDR_L
BNE @l1 ; Did we increment to 0? BNE @l1 ; Did we increment to 0?
INC CADDR_H ; Yes, also increment high INC CADDR_H ; Yes, also increment high
@l1 RTS @l1: RTS
;; Increment the cursor address ;; Increment the cursor address
DEC_CADDR: DEC_CADDR:
CMP CADDR_L ; Is low alrady 0? CMP CADDR_L ; Is low alrady 0?
BNE @l1 BNE @l1
DEC CADDR_H ; Yes, decrement high DEC CADDR_H ; Yes, decrement high
@l1 DEC CADDR_L @l1: DEC CADDR_L
RTS RTS
COUT1: COUT1:
@@ -289,34 +303,35 @@ COUT1:
LDY TMPY LDY TMPY
RTS RTS
; ;;;
; byte in from ACIA. This subroutine will also force ;;; byte in from ACIA. This subroutine will also force
; all lowercase letters to be uppercase. ;;; all lowercase letters to be uppercase, because EhBASIC
; ;;; only understands upper-case tokens
ACIAin ;;;
LDA ACIAstatus ; Read 6551 status ACIAin:
AND #$08 ; LDA ACIAstatus ; Read 6551 status
BEQ LAB_nobyw ; If rx buffer empty, no byte AND #$08 ;
BEQ LAB_nobyw ; If rx buffer empty, no byte
LDA ACIAdata ; Read byte from 6551 LDA ACIAdata ; Read byte from 6551
CMP #'a' ; Is it < 'a'? CMP #'a' ; Is it < 'a'?
BCC @done ; Yes, we're done BCC @done ; Yes, we're done
CMP #'{' ; Is it >= '{'? CMP #'{' ; Is it >= '{'?
BCS @done ; Yes, we're done BCS @done ; Yes, we're done
AND #$5f ; Otherwise, mask to uppercase AND #$5f ; Otherwise, mask to uppercase
@done @done:
SEC ; Flag byte received SEC ; Flag byte received
RTS RTS
LAB_nobyw LAB_nobyw:
CLC ; flag no byte received CLC ; flag no byte received
no_load ; empty load vector for EhBASIC no_load: ; empty load vector for EhBASIC
no_save ; empty save vector for EhBASIC no_save: ; empty save vector for EhBASIC
RTS RTS
; vector tables ; vector tables
LAB_vec LAB_vec:
.word ACIAin ; byte in from simulated ACIA .word ACIAin ; byte in from simulated ACIA
.word CRTCout ; byte out to simulated ACIA .word CRTCout ; byte out to simulated ACIA
.word no_load ; null load vector for EhBASIC .word no_load ; null load vector for EhBASIC
@@ -324,34 +339,47 @@ LAB_vec
; EhBASIC IRQ support ; EhBASIC IRQ support
IRQ_CODE IRQ_CODE:
PHA ; save A PHA ; save A
LDA IrqBase ; get the IRQ flag byte LDA IrqBase ; get the IRQ flag byte
LSR ; shift the set b7 to b6, and on down ... LSR ; shift the set b7 to b6, and on down ...
ORA IrqBase ; OR the original back in ORA IrqBase ; OR the original back in
STA IrqBase ; save the new IRQ flag byte STA IrqBase ; save the new IRQ flag byte
PLA ; restore A PLA ; restore A
RTI RTI
; EhBASIC NMI support ; EhBASIC NMI support
NMI_CODE NMI_CODE:
PHA ; save A PHA ; save A
LDA NmiBase ; get the NMI flag byte LDA NmiBase ; get the NMI flag byte
LSR ; shift the set b7 to b6, and on down ... LSR ; shift the set b7 to b6, and on down ...
ORA NmiBase ; OR the original back in ORA NmiBase ; OR the original back in
STA NmiBase ; save the new NMI flag byte STA NmiBase ; save the new NMI flag byte
PLA ; restore A PLA ; restore A
RTI RTI
END_CODE END_CODE:
;;; CRTC row addresses: HIGH
CRA_HI:
.byte $70,$70,$70,$70,$70,$70,$70,$71
.byte $71,$71,$71,$71,$71,$72,$72,$72
.byte $72,$72,$72,$72,$73,$73,$73,$73
;;; CRTC row addresses: LOW
CRA_LO:
.byte $00,$28,$50,$78,$A0,$C8,$F0,$18
.byte $40,$68,$90,$B8,$E0,$08,$30,$58
.byte $80,$A8,$D0,$F8,$20,$48,$70,$98
; sign on string ; sign on string
LAB_mess:
LAB_mess .byte $0D,$0A,"SYMON (C) 2008-2014, SETH MORABITO"
.byte $0D,$0A,"Symon (c) 2008-2014, Seth Morabito" .byte $0D,$0A,"ENHANCED 6502 BASIC 2.22 (C) LEE DAVISON"
.byte $0D,$0A,"Enhanced 6502 BASIC 2.22 (c) Lee Davison" .byte $0D,$0A,"[C]OLD/[W]ARM ?",$00
.byte $0D,$0A,"[C]old/[W]arm ?",$00
; system vectors ; system vectors