-1

I need help in this matter.I have to draw a memory map and I have

here is the code

ORG $6080;  
CAT EQU 5;  
DOG DC.L CAT;  
Hourse EQU 1;

I m not getting after ORG line,can anyone tell how can i draw its memory map

Sean
  • 60,939
  • 11
  • 97
  • 136
  • 1
    What do you mean by "I am not getting"? Is there an error message? – donjuedo Feb 25 '16 at 15:22
  • 1
    Is this supposed to be 68000 assembly code? It doesn't contain real assembly instructions, just assembler directives. – Codo Feb 25 '16 at 15:28
  • no this is my assignment question and I don't how to draw its memory map and indicate all relevant addresses as I am not getting what these lines mean – Owais Rehman Feb 25 '16 at 15:30
  • yes it does not contain any real assembly instructions, that is where I am confused at – Owais Rehman Feb 25 '16 at 15:35
  • It doesn't need any instructions if you're supposed to show how these are placed in memory. EQU is a constant definition and doesn't need memory, DC.L actually places data in memory. It's quite simple. Just read a 68k assembly manual. http://68k.hax.com/DC http://68k.hax.com/EQU http://68k.hax.com/DC – Sami Kuhmonen Feb 25 '16 at 16:10
  • 2
    I don't usually do this, but I strongly suggest removing the accept mark from the answer you accepted and checking my answer. The other answer is completely wrong and has literally not a single correct statement in it. – Sami Kuhmonen Feb 25 '16 at 16:51

2 Answers2

3

Let's break it down:

ORG $6080; // Defines the start of data/code
CAT EQU 5;  // Defines a constant with value 5, does not allocate any memory
DOG DC.L CAT;  // Defines a 32bit variable in memory, sets value to CAT (5)
Hourse EQU 1;  // Defines a constant with value 1, does not allocate any memory

So now that you know the start of the block and what is put into memory and what is not, you can draw a memory map of it. It will contain a single 32bit value.

Sami Kuhmonen
  • 30,146
  • 9
  • 61
  • 74
-1

This is my attempt at understanding what your Lecturer wants. Their choice of sudo code is interesting.

ORG is probably referring to a number although this could be a Memory address.

CAT is then presumably a variable in a register. EQU is saying that CAT is equal to 5.

DOG is also then presumably a variable in a register. Absolute far addressing is used to say what DOG is equal to. In other words DOG is equal to DC.L indexed by 5.

Hourse is then another variable in a register and it is equal to 1.

Now a table can be created (Memory Map) where we go

Variable | Value | Address

ORG          1       ?
CAT          5       ?
DOG          ?     DC.L indexed by 5
Hourse       1       ?

You could define what memory locations these are in in the data section of the assembly. Then you can fill out the address question marks. The actual value stored is arbitrary but just included for context.

Careful Now
  • 260
  • 1
  • 9
  • 1
    Attempt, probably, could be, presumably, DC.L indexed by 5. There would be no guessing if a 68k assembly manual was read and the actual information taken. – Sami Kuhmonen Feb 25 '16 at 16:11
  • DC.L is absolute memory addressing and the format shown in the manual is a little different to his sudo code but considering how faithful the rest of his code was this was closer to the actual assembly than the rest of it. – Careful Now Feb 25 '16 at 16:45
  • 1
    Absolute memory addressing? It puts a long value into memory. It has no memory addressing. The whole answer is just plain wrong. – Sami Kuhmonen Feb 25 '16 at 16:47