Results 1 to 3 of 3

Thread: Help with understand assembly - LAB_ vs. LBL_ sections

  1. #1
    Fuel Injected!
    Join Date
    Oct 2013
    Posts
    42

    Help with understand assembly - LAB_ vs. LBL_ sections

    I am trying to work my way through the 12202088 OS which someone very generously put up here as a disassembly. They were even so kind as to lay out what most of the code does. This has helped tremendously in my very limited understanding of what's going on. So much that I now have more questions :).


    What the difference is between LBL_ and LAB_ commands. I am pretty sure that the LAB_ signifies a routine (or segment) for the code to jump to. There are several spots with branch commands that list LAB_xxx as the next step to go to in the code. Many times there are a bunch of them in a row with the code jumping to the next steps. I just started to notice that sometimes, segments of the code show a LBL_xxxx. In these segments, there are some memory steps / checks going on, and then there could be more branch or jump commands (JSR). Is there an inherent differnce between these two types of segments of code?

  2. #2
    Administrator
    Join Date
    May 2011
    Location
    Lakes Region, NH
    Age
    54
    Posts
    3,852
    The disassembly you're working on is "relocatable." Variables, code sections, and tables are identified by names, or labels. If you modify or change the code, it can be fed to an assembler and the assembler will replace the names with actual line numbers.

    LBL is used to indicate the start of a subroutine. The JSR instruction will have an EXT_#### with it. A lookup table in the beginning of the code translates The EXT_#### label to an address. EXT_0072 is an example that translates to location $01FE4.

    LAB is used to indicate a location for a conditional branch. LAB addresses in code are generally translated by the assembler during the assembly process.

    JSR will store values on the stack for the processor to use upon return. A subroutine is a small section of code which must be run to get a temporary or single stage result. When the processor is sent to complete a task in a subroutine it is expected that code will return. Then the processor will need to pick up where it left off. A branch OTOH is a one-way ticket to some other piece of code.

  3. #3
    Fuel Injected!
    Join Date
    Oct 2013
    Posts
    42
    Thank you for the quick response. As I was reading more of the code, that was what I was thinking but didn't quite have the logic all figured out.

    I do have another question, regarding when / how the outputs are triggered. After reading through where the status flags are changed, I am not sure that in effect does the actual changing of a given output (example being electric fan relays). At some point, aren't the DTC's checked to see if that output should be working or not? The code that I read goes through checking the qualifiers to turn something on .... then it goes through the checks to change the status flags. But does that really do it? I thought that at some point in the code it would need to check to see if the DTC for that output was turned on or not? I found the DTC's in the memory locations, but did not see where / how they got loaded or if they are being used during the status flag sections of the code.

Similar Threads

  1. How to find the outputs in an assembly file
    By turbo_bu in forum GM EFI Systems
    Replies: 3
    Last Post: 03-22-2017, 04:56 PM
  2. Trying to understand 7747 idle logic
    By mmigacz in forum GM EFI Systems
    Replies: 0
    Last Post: 07-18-2016, 05:47 PM
  3. a coulpe ? to help me understand
    By mjc in forum GM EFI Systems
    Replies: 14
    Last Post: 11-28-2013, 09:11 AM
  4. Code: Learning Disassembly Assembly
    By EagleMark in forum Gear Heads
    Replies: 34
    Last Post: 08-22-2013, 10:47 PM
  5. Replies: 24
    Last Post: 05-04-2013, 07:49 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •