Armed with the
py65 emulator(*), I've used
Bitwise's assembler to produce a binary bootrom(**) which can load intel hex, and
teamtempest's assembler to produce that (variant) intel hex for test programs.
Creating the bootrom:
Code:
java -cp ./65016.jar org.x6502.x65016.As65016 bootrom.asm
java -cp ./65016.jar org.x6502.x65016.Lk65016 -bss \$00010000-\$EFFFFFFF -code \$0000fe00-\$0000FFFF -bin -output bootrom.bin bootrom.obj
The test program:
Code:
.hexfile
.cpu T_32_M16
.assume BIT32=1032, BIT32R=3210
.include "i6502.a"
; I/O is memory-mapped in py65:
PUTC = $f001
GETC = $f005 ; blocking input
; our bootstrap ROM will only load to $0200
.ORG $200
another
lda GETC
eor #$20 ; swap upper and lower case as a demo
sta PUTC
jmp another
Assembling the test program:
Code:
./HXA_TW.EXE testprog.asm
cat TESTPROG.HEX
which gives us
Code:
;020000040000FA
;1202000000A5F005004900200085F001004C0200000025
;00000001FF
(of which we need to discard the first line)
And then we can spin up the emulator, load the ROM, feed in the hex, and then type in some text:
Code:
$ PYTHONPATH=. python ./py65/monitor.py -m 65Org16
Py65 Monitor
PC AC XR YR SP NV---------BDIZC
65Org16: 00000000 0000 0000 0000 ffff 0000000000110000
.load bootrom.bin fe00
Wrote +512 bytes from $0000fe00 to $0000ffff
PC AC XR YR SP NV---------BDIZC
65Org16: 00000000 0000 0000 0000 ffff 0000000000110000
.goto fe00
Send 65Org16 code in variant Intel Hex format at 19200,n,8,1 ->
#
Download Successful!
Jumping to location $0200
*hELLOwORLD*
(The # is feedback to say one hex record was successfully loaded)
For reference: re-stating TT's example with some extraneous slashes to demarcate these fields:
Code:
│Record │ Record │ Load │ Record │ Data │ Checksum │
│Mark │ Length │ Offset │ Type │ │ │
Short standard 8-bit Intel record for a 32-bit wide address space looks like this starting at $FFFFE000:
Code:
:/02/0000/04/FFFF/xx
:/08/E000/00/0001020304050607/xx
:/08/E008/00/08090A0B0C0D0E0F/xx
:/00/0000/01/FF
Then the 16-bit format with the novel ';' record start character looks like this:
Code:
;/02/0000/04/FFFF/xx
;/10/E000/00/00000001000200030004000500060007/xx
;/10/E008/00/00080009000A000B000C000D000E000F/xx
;/00/0000/01/FF
teamtempest wrote:
Notice:
- the "record start" character changes from ":" to ";"
- the "data byte count" remains octet-correct
- the "address offset" is 16-bit correct
(*) an extension of
Mike's
(**) based on
Ross Archer's code