I'm reversing an automotive ECU firmware which works on SAF80-C509 processor (Intel 51 architecture). Now, I've got this part of code:
code:64C5 mov MD0, R0 ; Multiplication/Division Register 0 code:64C7 mov MD1, R1 ; Multiplication/Division Register 1 code:64C9 mov MD4, #0A0h ; Multiplication/Division Register 4 code:64CC mov MD5, #0 ; Multiplication/Division Register 5 code:64CF nop code:64D0 nop code:64D1 nop code:64D2 nop code:64D3 mov B, MD0 ; Quot = A:B code:64D6 mov A, MD1 ; Multiplication/Division Register 1 code:64D8 mov R2, MD2 ; Multiplication/Division Register 2 code:64DA mov R2, MD3 ; spare Reminder
According to specification, the write sequence MD0, MD1, MD4, MD5 means that it's
16bit/16bit division operation. At the same time, the result should be in
MD1:MD0 for quotient (High:Low) and in
MD5:MD4 in reminder. As one can see, the firmware reads
MD3:MD2. An obvious discrepancy. As far as I understand, if
MD5 isn't read, then read sequence isn't over and it may lead to some error condition.
I've seen some issues (typos) in the specification I've got. Hence, here is my question: is it a typo in the specification again?
P.S.: I've got this specification (user manual) from Keil site: https://www.keil.com/dd/docs/datashts/infineon/c509_um.pdf