2

I am doing an assignment for an information systems class and the professor decided to use psuedo-assembler. He used the

@

in

SUB @106, -2(104), 110

What does that symbol mean?

5
  • 3
    Which assembler are you using to compile this code? Commented Jun 26, 2012 at 19:34
  • 4
    What processor are we talking about here? Commented Jun 26, 2012 at 19:34
  • 7
    Their are dozens, probably hundreds of different dialects for different processors and tastes. Which assembler are you talking about? Commented Jun 26, 2012 at 19:35
  • I am new to assembler, for all I know its a common symbol. Also, please read the actual text before responding with "what processor". Its psuedo-code, it doesn't have a specification. Commented Jun 26, 2012 at 19:41
  • 2
    A symbol in pseudo-assembler would mean whatever the writer of the pseudo-assembler code wants it to mean. All the more reason to ask your prof. I think dasblinkenlight has a pretty good guess, though. Commented Jun 26, 2012 at 19:51

1 Answer 1

5

In DEC's assembly languages (PDP-11, VAX) @ means indirect addressing mode, i.e. an extra level of indirection.

In your case, @106 means that the address of the operand is taken from the address 106.

4
  • So what is the difference between that and calling 106 directly, in terms of making the SUB computation? Does it still mean I have to subtract whatever is in 106? Commented Jun 26, 2012 at 19:58
  • 1
    @user1260028 The difference between 106 and @106 is that in the first case the address of the operand is 106, and in the second case it's whatever is stored at the address 106. For example, if 110 is stored at 106, then @106 is equivalent to 110. Commented Jun 26, 2012 at 20:00
  • Ok so if say 106 is holding the value 101 (as it in the table provided), then I have to actually subtract the contents of 101 rather than 106? Commented Jun 26, 2012 at 20:03
  • 2
    @user1260028 Yes, this is correct. If you are familiar with C, the term indirection means adding an asterisk * in front of a pointer. Since you can interpret any number as a pointer in assembly language, you can think of @ as roughly corresponding to C's asterisk *. Commented Jun 26, 2012 at 20:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.