Meaning of disassembly underscore.

This is where the BIN Hackers and definition junkies discuss the inner workings of the EEC code and hardware. General tuning questions do not go here. Only technical/hardware-specific/code questions and discussions belong here.

Moderators: cgrey8, EDS50, Jon 94GT, 2Shaker

Post Reply
User avatar
xd41efisc
Regular
Posts: 90
Joined: Wed Jan 21, 2009 5:21 am
Location: Perth, Western Australia.

Meaning of disassembly underscore.

Post by xd41efisc » Sun Jun 30, 2019 5:46 am

Hi,

I have a very limited knowledge of what is going on with the the disassembly code I have made using tvrfan's SAD.
I have played around with arduino's a bit, but I am no expert.
I am an Electrician, and spent most of my time with relay logic systems.

I have been looking at a disassembly I have here.
It is from a 1986-87 XF Falcon/Fairlane.
The catch code is WA1, and it is a VM140 hardware I believe.
It is a very basic setup, it has the following inputs:
VAF, VAT, ECT, PIP, TPS, NDS, STI, AC Clutch, Knock Sensor.

It has these outputs:
Spout, 2 Injector Drivers (Batch Fire), ISC, Fuel Pump, 2 EGR Solenoids, CANP, STO, Trip Computer.

It has no HEGOs, No KAM, All Open Loop.

Code: Select all

2091: 30,a0,02          jnb   B0,Ra0,2096    if (B0_Ra0)  {
2094: 20,1d             sjmp  20b3           goto 20b3; }
What has me stumped is what is going on in the brackets (B0_Ra0).
I realize B0 is Bit0 and Ra0 is a value from the registry.
What does the underscore mean?
It is probably a simple answer but I have look through here and dechipa's site and have not found it.

I am also trying to work out what Bits turn on the Pins on the J1 Connector.
From what I can make out most subroutines end up at a HSO subroutine, that has something to do with the output pins, but I am not sure.
The inputs also have me stumped.
I came across a post by cgrey that I think was asking the same thing.

Thanks
Chris.
Ford Falcon 4.1/250 EFI Xflow, Eaton M112, Water/Air intercooler,
C0S/GURE ECU, 42# Injectors, 90mm LMAF, AEM wideband, QH, BE/EA.

jsa
Tuning Addict
Posts: 567
Joined: Sat Nov 23, 2013 7:28 pm
Location: 'straya

Re: Meaning of disassembly underscore.

Post by jsa » Sun Jun 30, 2019 7:23 am

The underscore is just a spacer between B0 and RA0.

If RA0 contained binary value 00000001 the program would continue on the next line.

If RA0 contained the binary value 00000000 the program would jump.

Bits 1 to 7 could be 1 or 0 and have no effect on this line of code.

What version of SAD are you using?
Cheers

John

95 Escort RS Cosworth - GHAJ0 / ANTI on a COSY box code
Moates QH & BE
ForDiag

User avatar
xd41efisc
Regular
Posts: 90
Joined: Wed Jan 21, 2009 5:21 am
Location: Perth, Western Australia.

Re: Meaning of disassembly underscore.

Post by xd41efisc » Sun Jun 30, 2019 7:54 am

Hi,

Thanks it makes some sense, but what changes Ra0 from 0 to 1?

I am using SAD 0.2, by the looks, I thought it was 3.08, I will look into it again.

Thanks.
Ford Falcon 4.1/250 EFI Xflow, Eaton M112, Water/Air intercooler,
C0S/GURE ECU, 42# Injectors, 90mm LMAF, AEM wideband, QH, BE/EA.

jsa
Tuning Addict
Posts: 567
Joined: Sat Nov 23, 2013 7:28 pm
Location: 'straya

Re: Meaning of disassembly underscore.

Post by jsa » Sun Jun 30, 2019 6:08 pm

Look for ORB instructions. It is the most common method for bit flags.

ORB RA0 01
if ra0 were zero
0000 0000 #ra0
0000 0001 #0x01
0000 0001 #orb result

If ra0 were something else
0101 0000 #ra0
0001 0001 #0x11
0101 0001 #orb result

If you have 3.08 it will give that detail at the top of the listing.
Give 3.07 a try as well.
Last edited by jsa on Sun Jun 30, 2019 8:15 pm, edited 1 time in total.
Cheers

John

95 Escort RS Cosworth - GHAJ0 / ANTI on a COSY box code
Moates QH & BE
ForDiag

User avatar
tvrfan
Tuning Addict
Posts: 408
Joined: Sat May 14, 2011 11:41 pm
Location: New Zealand

Re: Meaning of disassembly underscore.

Post by tvrfan » Sun Jun 30, 2019 7:23 pm

From me, the SAD author...

I had to come up with some kind of default name, so I chose Bx_Ry, meaning "Bit x of Register y".
In a typical binary there are many,many 'flag' states (i.e. ON or OFF), used for all sorts of things, and the CPU has the opcodes JB JNB (jump if bit set/not set) to support fast checks. Underscore char in name is just a 'joiner'. It is used a lot in coding language names to do this (as spaces are nearly always 'hard' separators).

Read/Write stuff.

To clear a flag, you AND it with a 'reverse mask', and to set it you OR it with the bit you want.
So for example -

AN2B R15, 0x7f; # clears bit 7 of reg 15 (byte)
ORB R15 0x80; # sets bit 7 of REG 15 (byte)

and the only reason the opcode is called AN2B is because there are 2 and 3 operand versions. Oddly the OR only ever has 2 operands.

In the 'pseudo source' printout, I generally use 'C' code type symbols, so AN2B originally showed as "Rx = Rx & 7f;
AN3B was Rx = Ry & 7f; and ORB was Rx = Rx | 80;

But then I decided that for lots of individual flags, it would be better to change it to -

AN2B R15, 0x7f; B7_R15 = 0;
ORB R15 0x80; B7_R15 = 1;

because that's what you truly want to know, without all that tedious messing around with bit masks......

Special Registers

If the register is below R10 on 8061, or R20 in 8065, then these are special function CPU registers. Some some can only be written to, some can only be read, some are R/W (and the CPU changes them to reflect some kind of state or data change) Several of these registers are a collection of single bit flags.

SAD is all about helping to understand the code, so I've written a few shortcuts like this one in the extra 'pseudo source' at the end of each opcode.
You can define a name (=symbol) for individual bits to make the code easier to read.
The special registers (and flags) are already named by default.

In later versions I also added extras for sizes and signed where they change across an opcode (like DIV for example)
and I put a quick guide at the top of the printout.

wRx to indicate a WORD (16 bits) (R = register)
yRx to indicate a BYTE (8 bytes)
lRx for a LONG (32 bits, 2 words),
and an s where appropriate to indicate a SIGNED change or opcode.

Hope that helps explain..........................
TVR, kit cars, classic cars. Ex IT geek, development and databases.
https://github.com/tvrfan/EEC-IV-disassembler

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests