#garfield Logs

Aug 27 2021

#garfield Calendar

12:16 AM rue_mohr: hmm progress is not linear
12:24 AM rue_mohr: its sort of recursive regression
12:25 AM rue_mohr: }:] I'v rewritten code older than this, I can do this too
12:33 AM rue_mohr: nothing I can find anywhere matches it
12:34 AM rue_mohr: I dont even think its trying to program memory
12:35 AM rue_mohr: the entry point for memory program traces out to code that seems to say "PROGRAMMING CANT CONTINUE" and exits
12:35 AM rue_mohr: hmm
12:48 AM rue_mohr: programmer.asm is repeatedly tripping things up
12:48 AM rue_mohr: its the biggest change
12:52 AM rue_mohr: oh a function was moved
12:52 AM rue_mohr: who are you
12:52 AM rue_mohr: L0568:
12:52 AM rue_mohr: 0887 B4CE05 CJNE A, #0CEh, L0569
12:52 AM rue_mohr: L0008:
12:52 AM rue_mohr: 088A 8BCB MOV 0CBh, R3
12:52 AM rue_mohr: 088C 89CA MOV 0CAh, R1
12:52 AM rue_mohr: 088E 22 RET
12:54 AM rue_mohr: complex
01:03 AM rue_mohr: there you are.
01:03 AM rue_mohr: ITRAP: CJNE A,#TMR0,$+8 ;TIMER 0
01:03 AM rue_mohr: MOV TH0,R3
01:03 AM rue_mohr: MOV TL0,R1
01:03 AM rue_mohr: RET
08:27 AM rue_mohr: they broke twitter again
08:52 AM rue_mohr: so, modifying the 8051 code is a bit of a challange when they moved code, and the 8051 cant jump over page boundries
08:54 AM Tom_L: like a pic?
08:54 AM rue_mohr: yea
09:04 AM rue_mohr: the source has thigns like this too
09:04 AM rue_mohr: CJNE A,#TRC2,$+8 ;RCAP2 TOKEN
09:04 AM rue_mohr: RCL: DB 8BH ;MOV R3 DIRECT OP CODE
09:04 AM rue_mohr: DB 0CBH ;RCAP2H LOCATION
09:04 AM rue_mohr: DB 89H ;MOV R1 DIRECT OP CODE
09:04 AM rue_mohr: DB 0CAH ;RCAP2L LOCATION
09:04 AM rue_mohr: RET
09:04 AM rue_mohr: I suppose the assembler was missing instructions, so they were just db'd in
09:06 AM polprog: molex 105450-0101
09:06 AM polprog: i made a mistake of ordering the PCB before the BOM >_>
09:06 AM Tom_L: oh board mount
09:06 AM polprog: yeah
09:06 AM polprog: im not even sure how to reflow that with hot air
09:06 AM Tom_L: i got a whole slew of usb mini if you want :)
09:07 AM polprog: considering getting a hotplate, theres one for $30 here
09:07 AM Tom_L: C wasn't a thing when i was making those
09:07 AM polprog: The thing im making is a dummy power delivery board, so it needs C
09:16 AM rue_mohr: polprog, shame, today you have to order the parts before designing the pcb
09:16 AM polprog: yeah...
09:17 AM rue_mohr: how many times must we hear people about having to continiously redesign pcbs to find out the parts they designed them around cant by obtained by the time they finished the pcb design
09:18 AM rue_mohr: select parts, buy parts, design pcb
09:40 AM polprog: ill do it like that next time
09:43 AM rue_mohr: I'm confused why people dont get it
09:43 AM rue_mohr: there seemed to be resistance when I said it on twitt
09:43 AM rue_mohr: if you dont, you simply wont have the parts to make the board
09:58 AM Tom_L: midway thru my programmers i had to switch usb mini brands.. they discontinued the one i'd been using
09:58 AM Tom_L: the new one mounted slightly different
07:46 PM rue_shop2: hi
07:47 PM aandrew: howdy
07:48 PM Tom_L: hi
08:08 PM rue_mohr: bit tired after work
08:08 PM rue_mohr: this afternoon was nice, i'm hoping to cast tommorow
08:08 PM rue_mohr: if I was on it faster I could have today
08:08 PM rue_mohr: :(
08:10 PM aandrew: we had rain yesterday so today was not 99% humidity
08:11 PM aandrew: and I hear the fires are settling down out by you, rue_mohr
08:12 PM rue_mohr: ought to be, there have been a few heavy rains
08:14 PM Tom_L: guy asked for testers on his code generator
08:14 PM Tom_L: hope i didn't piss him off with all the suggestions i left
08:14 PM rue_mohr: hu?
08:14 PM Tom_L: gcode
08:14 PM rue_mohr: oh
08:21 PM rue_mohr: that what you beeen up to
08:22 PM Tom_L: not that much
08:22 PM Tom_L: it only took a few min to see the problems
08:22 PM Tom_L: he's got a different code style than me to though
08:23 PM rue_mohr: that can make testing results interseting
08:25 PM Tom_L: not so much
08:25 PM Tom_L: i put code in not knowing the state of the maching
08:26 PM Tom_L: he tends to leave some out
08:26 PM Tom_L: prior to the program who's to say i didn't MDI different settings than the defaults...
08:40 PM rue_mohr: mdi?
09:16 PM Tom_L: manual data input
09:16 PM rue_mohr: :)
09:16 PM rue_mohr: i'M slowly working thru binary blobs the decompiler didn't hit
09:39 PM rue_mohr: its not helping when parts of binary blobs refer to other binary blobs
09:44 PM Tom_L: hah
10:22 PM rue_mohr: remmeber how I was saying that the system for labels kept changing
10:22 PM rue_mohr: letters numbers...
10:22 PM rue_mohr: now we have numbers that instead of counting up, repeat
10:22 PM rue_mohr: 1 11 111 ....
10:24 PM rue_mohr: I'm at 0x0ACA of 0x1FFF
10:24 PM rue_mohr: 8-|
10:28 PM Tom_L: the numbers were for the disassembler though it appeared
10:28 PM Tom_L: he had a method
10:28 PM Tom_L: and kept it a secret
10:29 PM rue_mohr: this will take me a while, I'm trying to work out the changes and re-apply them to the orig code
10:29 PM rue_mohr: I figure in the process i will know how all the code works
10:31 PM rue_mohr: right now I'm taking a dump of the new rom and using the orig source to work out what all the labels are
10:31 PM rue_mohr: I'd like to get to 0x1000 today
10:32 PM rue_mohr: the binary blobs are slowing me down a lot
10:32 PM rue_mohr: RLINE:
10:32 PM rue_mohr: 0AF5 F1 DB 0F1h
10:32 PM rue_mohr: 0AF6 34 DB 034h ; '4'
10:32 PM rue_mohr: 0AF7 51 DB 051h ; 'Q'
10:32 PM rue_mohr: 0AF8 D4 DB 0D4h
10:32 PM rue_mohr: 0AF9 E1 DB 0E1h
10:33 PM rue_mohr: 0AFA 1B DB 01Bh
10:33 PM rue_mohr: --
10:33 PM rue_mohr: RLINE: ACALL INTERR ;GET THE INTEGER
10:33 PM rue_mohr: ;
10:33 PM rue_mohr: RL1: ACALL GLN
10:33 PM rue_mohr: AJMP CLN_UP
10:33 PM rue_mohr: --
10:33 PM rue_mohr: so I take the address 0af5, convert it to decimal
10:33 PM rue_mohr: 2805
10:34 PM rue_mohr: then call the dissassembler with that start point
10:34 PM rue_mohr: dis51 -l 2805 < 64kimg.hex | less
10:34 PM rue_mohr: 0AF5 F134 ACALL L0001
10:34 PM rue_mohr: 0AF7 51D4 ACALL L0002
10:34 PM rue_mohr: 0AF9 E11B AJMP L0003
10:35 PM rue_mohr: then find the addresses for L0001/2/3
10:35 PM Tom_L: quite the scavenger hunt
10:35 PM rue_mohr: 1 IS 0F34
10:36 PM rue_mohr: 0AF5 F134 ACALL L0001 (0F34)
10:36 PM rue_mohr: 0AF7 51D4 ACALL L0002 (0AD4)
10:36 PM rue_mohr: 0AF9 E11B AJMP L0003 (0F1B)
10:37 PM rue_mohr: then go see what the replacement meaningless label is
10:37 PM rue_mohr: 0f34 is a binary blob
10:38 PM rue_mohr: that I can assume is interr
10:39 PM rue_mohr: and then I have
10:40 PM rue_mohr: RLINE:
10:40 PM rue_mohr: 0AF5 F134 ACALL L0001 (0F34) INTERR
10:40 PM rue_mohr: 0AF7 51D4 ACALL L0041 (0AD4) GLN
10:40 PM rue_mohr: 0AF9 E11B AJMP L0387 (0F1B) CLN_UP
10:40 PM rue_mohr: and a few more labels on random code
10:42 PM rue_mohr: UGH, there are tonnes of blobs ahead
10:43 PM rue_mohr: the basic interpereter uses a function lookup table, and the decompiler cant follow it
10:44 PM rue_mohr: I need to know what functions the labels are so I can compare to the binary compiled from the origional source and modify it to suit
10:46 PM aandrew: surely there are better ways to disasemble this
10:46 PM aandrew: ida or ... ghidra for 8051?
10:51 PM rue_mohr: the problem is I need to match up all the labels to the binary from the source
10:51 PM rue_mohr: it would REALLY help if the decompiler used the address to make the label
10:51 PM rue_mohr: like L0x01333
10:51 PM rue_mohr: like L0x1333
10:51 PM rue_mohr: whatever
10:52 PM rue_mohr: it uses arbitrary numbers
10:52 PM rue_mohr: but I'v got a week into this file and I'm not gonna turn around now
10:52 PM rue_mohr: whats good is that verry little was changed
10:52 PM rue_mohr: so most of the code matches up
10:54 PM rue_mohr: some of the binary blobs are trig lookup tables
10:54 PM rue_mohr: really small ones that dont make sense
10:59 PM rue_mohr: if (lbl[addr] == 0)
10:59 PM rue_mohr: lbl[addr] = ++newlbl;
10:59 PM rue_mohr: hmmm
10:59 PM rue_mohr: sprintf(label, "L%04d", lbl[addr]);
11:00 PM rue_mohr: well this might be easy to fix
11:01 PM rue_mohr: wait, what
11:16 PM rue_mohr: ok I have a custom version with hex, address based labels
11:16 PM rue_mohr: the speed of this hack makes my hackerness feel good
11:17 PM rue_mohr: I wish I'd known to do this from the start
11:18 PM rue_mohr: 0AFF 51CA ACALL L0x0ACA
11:18 PM rue_mohr: 0B01 F4 CPL A
11:18 PM rue_mohr: 0B02 8002 SJMP L0x0B06
11:18 PM rue_mohr: 0B04 51 DB 051h ; 'Q'
11:18 PM rue_mohr: 0B05 CA DB 0CAh
11:18 PM rue_mohr: L0x0B06:
11:18 PM rue_mohr: 0B06 7C03 MOV R4, #3h
11:18 PM rue_mohr: 0B08 FD MOV R5, A
11:18 PM rue_mohr: 0B09 800C SJMP L0x0B17
11:18 PM rue_mohr: that cuts out a thing
11:18 PM rue_mohr: a few steps actually