Why did you want to revise the ROM checksum routine? It works well, doesn't it?
av
EJECT
TITLE 'Vegas ROM test'
;...............................................................
; ROM.CHECKSUM
;
; Compute Checksum of rom banks $FE, $FF.
; and compare with expected value
;
; Call : In Full native mode, Data Bank 0, use JSL
; Return: In Full native mode
;
; 20 Feb 86: Created
; 09 Apr 86: Add register based ram test
;
;...............................................................
; SEG RUNBANK
ROM_CHECKSUM EQU * ;Called from test sequencer
STZ RamBank
JSR DoZPageInd ;Register based ram test first
DATA16
BCS BAD_RAM ;Ram is bad so report and stop
STZ CHK_BEG ;Starting address
PEA |$FCFC ;Firts bank $FC
PLB
PLB ;et data bank register
LDY #$FFFF ;Entire 64k of rom
JSR CAL_CHECKSUM ;Go get checksum
PEA |$FDFD ;Bank $FD
PLB
PLB
DEY ;Entire 64k of rom
JSR CAL_CHECKSUM2 ;Get checksum
PEA |$FEFE ;Bank $FE
PLB
PLB
DEY ;Entire 64k of rom
JSR CAL_CHECKSUM2 ;Get checksum
PEA |$FFFF ;Bank $FF
PLB
PLB
DEY ;Entire 64k of rom
JSR CAL_CHECKSUM2 ;Get checksum
;
; Note that the rom checksum must be adjusted
; to equal $1234
;
CMP #$1234 ;Compare with a fixed value
; Change CHECKSUM condition in file: MAIN
IF CHECKSUM <> 0 THEN ;Normally do next line
BNE BAD_ROM ;Bad checksum so fail
ELSE ;Do next line for debugging only
BRA GOOD_ROM ;Don't fail ROM checkum
ENDIF
GOOD_ROM EQU * ;Rom ok
CLC
RTL
BAD_ROM EQU * ;Rom does'nt check out
STA >TST_STATUS+1 ;Save actual checksum for display
LDA #$CDD2 ;"RM" = RoM fail
STA >LINE1+$100 ;Put "RM" msg on screen in case system hangs
SEC
RTL ;ttempt to return to sequencer to put bad message on screen
BAD_RAM EQU * ;Encountered bad ram during rom test
LDA #$01 ;Bad ram
STA |TST_STATUS+3 ;01-> can't do rom tst because bad ram
STA |TST_STATUS+1 ;Error that occurred (See Test code)
SEC
RTL
EJECT
;...............................................................
;
; Calculate Checksum. 16 Bit ADC
;
; Call : In Full native mode, use JSR
; Return: In Full native mode
;
; Inputs:
; C: Partially computed checksum, or else 0
; CHK.BEG: Start address to checksum (Zero Page var)
; Y: No Bytes (odd) to checksum
; B: Set data bank reg to required bank.
;
; Output:
; C: Checksum of C to C+Y inclusive
;
;
; Note: Have partially computed checksum in C when
; dealing with more than one bank.
;
; xxx nov85
;...............................................................
CAL_CHECKSUM EQU * ;Enter here first bank with C=0, else enter next line+1
LDA #$0000 ;Clear checksum to zero
CLC
CAL_CHECKSUM2 EQU * ;Enter here for remaining banks.
DEY ;rop to low byte of top address
N_NXT_CHK EQU *
ADC (CHK_BEG),Y ;Add to previous value
DEY ;ve to next byte
BEQ CHK_END ;Fin except for last 2
DEY ;ve to next byte
BNE N_NXT_CHK ;do next two bytes
CHK_END EQU *
ADC (CHK_BEG),Y ;Add last 2 bytes
RTS ;eturn in Native 16 mode