Welcome, Guest. Please login or register.

Author Topic: Assembler (68k) help (about dc pseudo op)  (Read 25986 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Kronos

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show all replies
    • http://www.SteamDraw.de
Re: Assembler (68k) help (about dc pseudo op)
« on: January 13, 2003, 03:20:40 PM »
68k-asm ? Long long ago .... but I will give it a try.

marker: dc.w 1
Means you got an variable (16bit) with the value "1" stored into it.

The Assmembler will replace
move #1,marker

with

move value_1 to address marker

You should never (really never) put an fixed number on any address,
because that variable will move with every piece of code you put before it.

Let the assembler sort out that mess  ;-)

"#" is NO addressing, you will use that number, and not the memory-cell
it would point to if used as an address.

move #marker,d1 load the address of you variable into d1
 move marker,d1 loads the contents of your variable into d1.


/me just hopes he hasn't made a complete fool of himself
1. Make an announcment.
2. Wait a while.
3. Check if it can actually be done.
4. Wait for someone else to do it.
5. Start working on it while giving out hillarious progress-reports.
6. Deny that you have ever announced it
7. Blame someone else
 

Offline Kronos

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show all replies
    • http://www.SteamDraw.de
Re: Assembler (68k) help (about dc pseudo op)
« Reply #1 on: January 13, 2003, 03:42:44 PM »
double_di_hoop
1. Make an announcment.
2. Wait a while.
3. Check if it can actually be done.
4. Wait for someone else to do it.
5. Start working on it while giving out hillarious progress-reports.
6. Deny that you have ever announced it
7. Blame someone else
 

Offline Kronos

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show all replies
    • http://www.SteamDraw.de
Re: Assembler (68k) help (about dc pseudo op)
« Reply #2 on: January 13, 2003, 03:42:58 PM »
No it's not on an uneven address, it's just not alligned to 4.

AFAIR that is something a bit different on every assembler, so

RTFM ;-)
1. Make an announcment.
2. Wait a while.
3. Check if it can actually be done.
4. Wait for someone else to do it.
5. Start working on it while giving out hillarious progress-reports.
6. Deny that you have ever announced it
7. Blame someone else