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
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
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.
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.