Question

I tried it with Keil-µVision and Asem-51 but they still plugging that it is an syntax error. Here is my code:

acall subroutine1
.
.
.

subroutine1:
.
.
.
ret
Was it helpful?

Solution

The AT89C2051 part definitely supports the ACALL instruction (so claims the data sheet and I've successfully used it myself).

What is the exact error that you are seeing in each assembler? Does the rest of your source compile OK?

Can you post the exact source that is giving an error (or make a small example that demonstrates the issue if the code itself is confidential)?

OTHER TIPS

I just figured it out. The subroutine definition must go first before calling it:

   org 0
   sjmp start

subroutine1:
   .
   .
   .
   ret

start:
  .
  .
  .
  acall subroutine1

Thanks psmears for confirming that "acall" instruction really works for AT89C2051.

@All, you may vote up this answer if this helped you. Thanks.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top