Skip to content

Generate rcxnub and rcxnub_odd from the assembly file#8

Merged
mesheets merged 4 commits intoBrickBot:masterfrom
schodet:fastdl-src
May 4, 2025
Merged

Generate rcxnub and rcxnub_odd from the assembly file#8
mesheets merged 4 commits intoBrickBot:masterfrom
schodet:fastdl-src

Conversation

@schodet
Copy link
Copy Markdown
Contributor

@schodet schodet commented Apr 29, 2025

Move one instruction to make it bit exact with the previously included SREC
file, add conditional to also generate the odd parity version.

The unused rcxnub_linuxusb.h and the commented out version in rcxnub_odd.h
were the same. They explicitly set odd parity while the non commented version
just skip changing the register.

On build, if H8300 toolchain is not available, use a pre-built version. If
toolchain is available, the pre-built version is checked to make sure it is up
to date.

Also remove outdated pre-built rxc[12]_nqh.h. They are generated anyway at
every build.

For reference here is the disassembly of original srec file:

rcxlib/fastdl.srec:     file format srec

Disassembly of section .sec1:

0000000000008000 <.sec1>:
    8000:	79 06 00 0f 	mov.w	#0xf,r6
    8004:	6b 86 ee 80 	mov.w	r6,@0xee80:16
    8008:	79 06 ee 64 	mov.w	#0xee64,r6
    800c:	6d f6       	mov.w	r6,@-r7
    800e:	79 06 ee 74 	mov.w	#0xee74,r6
    8012:	5e 00 3b 9a 	jsr	@0x3b9a:24
    8016:	0b 87       	adds	#2,r7
    8018:	79 06 ee 5e 	mov.w	#0xee5e,r6
    801c:	5e 00 06 88 	jsr	@0x688:24
    8020:	7f d8 72 50 	bclr	#0x5,@0xd8:8
    8024:	fe 67       	mov.b	#0x67,r6l
    8026:	3e d9       	mov.b	r6l,@0xd9:8
    8028:	18 ee       	sub.b	r6l,r6l
    802a:	6a 8e ef 51 	mov.b	r6l,@0xef51:16
    802e:	fe 02       	mov.b	#0x2,r6l
    8030:	6a 8e ef 06 	mov.b	r6l,@0xef06:16
    8034:	fe 0d       	mov.b	#0xd,r6l
    8036:	6a 8e ee 5e 	mov.b	r6l,@0xee5e:16
    803a:	54 70       	rts	
    803c:	44 6f       	.word	H'44,H'6f
    803e:	20 79       	mov.b	@0x79:8,r0h
    8040:	6f 75 20 62 	mov.w	@(0x2062:16,r7),r5
    8044:	79 74 65 2c 	mov.w	#0x652c,@(0x4:2,r0)
    8048:	20 77 
    804a:	68 65       	mov.b	@r6,r5h
    804c:	6e 20 49 20 	mov.b	@(0x4920:16,r2),r0h
    8050:	6b 6e       	.word	H'6b,H'6e
    8052:	6f 63 6b 3f 	mov.w	@(0x6b3f:16,r6),r3
	...

This one for nub_odd:

rcxlib/nub_odd.srec:     file format srec

Disassembly of section .sec1:

0000000000008000 <.sec1>:
    8000:	79 06 00 0f 	mov.w	#0xf,r6
    8004:	6b 86 ee 80 	mov.w	r6,@0xee80:16
    8008:	79 06 ee 64 	mov.w	#0xee64,r6
    800c:	6d f6       	mov.w	r6,@-r7
    800e:	79 06 ee 74 	mov.w	#0xee74,r6
    8012:	5e 00 3b 9a 	jsr	@0x3b9a:24
    8016:	0b 87       	adds	#2,r7
    8018:	79 06 ee 5e 	mov.w	#0xee5e,r6
    801c:	5e 00 06 88 	jsr	@0x688:24
    8020:	fe 67       	mov.b	#0x67,r6l
    8022:	3e d9       	mov.b	r6l,@0xd9:8
    8024:	18 ee       	sub.b	r6l,r6l
    8026:	6a 8e ef 51 	mov.b	r6l,@0xef51:16
    802a:	fe 02       	mov.b	#0x2,r6l
    802c:	6a 8e ef 06 	mov.b	r6l,@0xef06:16
    8030:	fe 0d       	mov.b	#0xd,r6l
    8032:	6a 8e ee 5e 	mov.b	r6l,@0xee5e:16
    8036:	54 70       	rts	
    8038:	44 6f       	.word	H'44,H'6f
    803a:	20 79       	mov.b	@0x79:8,r0h
    803c:	6f 75 20 62 	mov.w	@(0x2062:16,r7),r5
    8040:	79 74 65 2c 	mov.w	#0x652c,@(0x4:2,r0)
    8044:	20 77 
    8046:	68 65       	mov.b	@r6,r5h
    8048:	6e 20 49 20 	mov.b	@(0x4920:16,r2),r0h
    804c:	6b 6e       	.word	H'6b,H'6e
    804e:	6f 63 6b 3f 	mov.w	@(0x6b3f:16,r6),r3
	...

And this one is the commented part of nub_odd, which is identical to
nub_linuxusb:

rcxlib/nub_linuxusb.srec:     file format srec

Disassembly of section .sec1:

0000000000008000 <.sec1>:
    8000:	79 06 00 0f 	mov.w	#0xf,r6
    8004:	6b 86 ee 80 	mov.w	r6,@0xee80:16
    8008:	79 06 ee 64 	mov.w	#0xee64,r6
    800c:	6d f6       	mov.w	r6,@-r7
    800e:	79 06 ee 74 	mov.w	#0xee74,r6
    8012:	5e 00 3b 9a 	jsr	@0x3b9a:24
    8016:	0b 87       	adds	#2,r7
    8018:	79 06 ee 5e 	mov.w	#0xee5e,r6
    801c:	5e 00 06 88 	jsr	@0x688:24
    8020:	2e d8       	mov.b	@0xd8:8,r6l
    8022:	ce 30       	or.b	#0x30,r6l
    8024:	3e d8       	mov.b	r6l,@0xd8:8
    8026:	fe 67       	mov.b	#0x67,r6l
    8028:	3e d9       	mov.b	r6l,@0xd9:8
    802a:	18 ee       	sub.b	r6l,r6l
    802c:	6a 8e ef 51 	mov.b	r6l,@0xef51:16
    8030:	fe 02       	mov.b	#0x2,r6l
    8032:	6a 8e ef 06 	mov.b	r6l,@0xef06:16
    8036:	fe 0d       	mov.b	#0xd,r6l
    8038:	6a 8e ee 5e 	mov.b	r6l,@0xee5e:16
    803c:	54 70       	rts	
    803e:	44 6f       	.word	H'44,H'6f
    8040:	20 79       	mov.b	@0x79:8,r0h
    8042:	6f 75 20 62 	mov.w	@(0x2062:16,r7),r5
    8046:	79 74 65 2c 	mov.w	#0x652c,@(0x4:2,r0)
    804a:	20 77 
    804c:	68 65       	mov.b	@r6,r5h
    804e:	6e 20 49 20 	mov.b	@(0x4920:16,r2),r0h
    8052:	6b 6e       	.word	H'6b,H'6e
    8054:	6f 63 6b 3f 	mov.w	@(0x6b3f:16,r6),r3
	...

They only differs for the parity regester write.

This is the source of the fastdl.srec file, written by Kekoa Proudfoot,
downloaded from: http://www.mralligator.com/rcx/firmdl3.tar.gz
@schodet
Copy link
Copy Markdown
Contributor Author

schodet commented Apr 29, 2025

At some time, generated default parser and lexer should also be updated… or removed.

@schodet
Copy link
Copy Markdown
Contributor Author

schodet commented Apr 29, 2025

Hum… I guess something is messing with my EOLs.

schodet added 3 commits April 29, 2025 19:09
Move one instruction to make it bit exact with the previously included
SREC file, add conditional to also generate the odd parity version.

The unused rcxnub_linuxusb.h and the commented out version in
rcxnub_odd.h were the same. They explicitly set odd parity while the non
commented version just skip changing the register.

On build, if H8300 toolchain is not available, use a pre-built version.
If toolchain is available, the pre-built version is checked to make sure
it is up to date.
They are generated anyway at every build.
@mesheets mesheets merged commit 663bee9 into BrickBot:master May 4, 2025
1 check passed
@mesheets
Copy link
Copy Markdown
Member

mesheets commented May 4, 2025

This looks to be very thorough—thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants