1

I see $ in SJMP, CJNE and other instructions in 8051 assembly code and don't know what it does. Here

CJNE A,#'A',$+5   
SJMP $

Can you tell me the purpose of it?

phuclv
  • 37,963
  • 15
  • 156
  • 475
OnurTR
  • 11
  • 1
  • 5

1 Answers1

1

It's a special label indicating the current line. SJMP $ is equivalent to

currentline: SJMP currentline

And CJNE A,#'A',$+5 will jump to the instruction 5 bytes ahead when the condition matches

In fact it's the same as the dollar sign in assembly languages for many other architectures

phuclv
  • 37,963
  • 15
  • 156
  • 475