This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DS390:"DB 02h ,DW Reset" and ljmp

for example,inst390.uv2 project in the C:\Keil\C51\EXAMPLES\Dallas 390\Asm,in disassembly window ,the first instruction is displayed as "c:0x000000 020003 LJMP RESET(c:0003)" with source code :
DB 02H ; LJMP in Classic 8051 Mode
DW WORD0 Reset
if "ljmp Reset",it is displayed as "c:0x000000 020000".
why ljmp displayed in such a way in classic 8051 mode without ACON set?

Parents
  • So, the "OLD" LJMP instruction is encoded as a DB 02 (which is the 8051 LJMP) rather than the fancy new 4-byte LJMP mnemonic of the 390.

    Then mnemonic is not what's new about that --- it's the same mnemonic, for the same machine instruction byte. Only the size of the operand changes, if the assembler was put into 390 contiguous moude.

    The LJMP could be coded in the usual way if $MOD_CONT weren't a "primary" control, i.e. if one could change back and forth between $MOD_CONT and $MOD51 within a source file. But as-is, LJMP would do the wrong thing, so one has to use either DB 02 as an LJMP in disguise (as seen in the OP), or an SJMP instead of LJMP.

Reply
  • So, the "OLD" LJMP instruction is encoded as a DB 02 (which is the 8051 LJMP) rather than the fancy new 4-byte LJMP mnemonic of the 390.

    Then mnemonic is not what's new about that --- it's the same mnemonic, for the same machine instruction byte. Only the size of the operand changes, if the assembler was put into 390 contiguous moude.

    The LJMP could be coded in the usual way if $MOD_CONT weren't a "primary" control, i.e. if one could change back and forth between $MOD_CONT and $MOD51 within a source file. But as-is, LJMP would do the wrong thing, so one has to use either DB 02 as an LJMP in disguise (as seen in the OP), or an SJMP instead of LJMP.

Children