Re: Trying to decipher the mysteriously confusing WDC 65c02
Posted: Sat Jul 23, 2022 10:39 pm
Here is the "S19 Record Loader" portion of the monitor.
https://en.wikipedia.org/wiki/SREC_(file_format)
And here is a Windows tool to convert binary files to S19 format
https://www.keil.com/download/docs/4.asp
However it's not really obvious how the S19 data is loaded. Whether pasting/typing line-by-line or if a file can be opened for loading.
Code: Select all
;===============================================================================
; 'S' - S19 Record Loader
;-------------------------------------------------------------------------------
cmp #'S'
if eq
jsr NextChar
cmp #'1' ; Data record?
if eq
jsr GetByte ; Extract length
bcs .S19Fail
sta ADDR_E+0
jsr GetWord ; Extract address
bcs .S19Fail
jsr SetStartAddr
dec ADDR_E+0 ; Reduce count
dec ADDR_E+0
dec ADDR_E+0
ldy #0
sty ADDR_E+1
repeat
jsr GetByte ; Extract data byte
bcs .S19Fail
ldy ADDR_E+1 ; And save
lda TEMP+0
sta (ADDR_S),y
inc ADDR_E+1
dec ADDR_E+0 ; Until line processed
until eq
else
cmp #'9'
if eq
jsr GetByte ; Extract length
bcs .S19Fail
jsr GetWord ; Extract start address
bcs .S19Fail
lda TEMP+0 ; Copy to PC
sta PC_REG+0
lda TEMP+1
sta PC_REG+1
else
.S19Fail: jmp Error
endif
endif
jmp NewCommand
endif
Quote:
Motorola S-record is a file format, created by Motorola in the mid-1970s, that conveys binary information as hex values in ASCII text form. This file format may also be known as SRECORD, SREC, S19, S28, S37. It is commonly used for programming flash memory in microcontrollers, EPROMs, EEPROMs, and other types of programmable logic devices. In a typical application, a compiler or assembler converts a program's source code (such as C or assembly language) to machine code and outputs it into a HEX file. The HEX file is then imported by a programmer to "burn" the machine code into non-volatile memory, or is transferred to the target system for loading and execution.
And here is a Windows tool to convert binary files to S19 format
https://www.keil.com/download/docs/4.asp
However it's not really obvious how the S19 data is loaded. Whether pasting/typing line-by-line or if a file can be opened for loading.