Author Topic: Here's another not-absolutely-necessary question I have, just out of curiosity.  (Read 9301 times)

0 Members and 1 Guest are viewing this topic.

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
You might be interested in reading my 5th ASM lesson for more information.

http://ourl.ca/4673/88522

Just note that .org 40339 is the same as .org $9D93.   .org $9D95 and .org $9D93 can be interchanged with a few simple changes.
« Last Edit: June 29, 2010, 11:11:14 am by Hot_Dog »

Offline Iambian

  • Coder Of Tomorrow
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 739
  • Rating: +216/-3
  • Cherry Flavoured Nommer of Fishies
    • View Profile
Ahaha. I came late to this party! So, to add my $0.02...

You'd usually do the following:
Code: [Select]
.org $9D93
.dw $6DBB
instead of
Code: [Select]
.dw $6DBB
.org $9D95
Now, it *shouldn't* make any difference between which one you use, but it does depend on your assembler and what you're trying to make that assembler do. For example, with TASM, your batch files might be assembling your files with the -b or -c switches, which causes all undefined values between known locations to be written out. Which is to say, if you did the latter code, TASM would try to fill in *all* the information between addresses $0000 to $9D95, resulting in a program that's nearly 40KB.

I made this mistake a while back and I'd rather not see it happen again. I don't know how much better the new fancy assemblers like SPASM and Brass and ZDS are, but if this problem hasn't been mentioned, they've gotta be a bit better.
A Cherry-Flavored Iambian draws near... what do you do? ...

Offline mapar007

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 550
  • Rating: +28/-5
  • The Great Mata Mata
    • View Profile
I tried this with spasm a while ago iirc, and it didn't make any difference.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
No. :) Both copy to $9d95. We write .org $9d93 because of the .db $BB,$6D bytes, which should not be counted in. These are equivalent:
Code: [Select]
.org $9d93
.db $bb,$6d
blablabla
Code: [Select]
.db $bb,$6d
.org $9d95
blablabla

And I don't quite get what you mean by shifting labels. If you mean inserting one byte so that all labels are shifted one position 'upwards', then yes.
Thanks for clarifying this.  It make even more sense to me now. :)  Thanks! ;D

Offline mapar007

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 550
  • Rating: +28/-5
  • The Great Mata Mata
    • View Profile
Thanks :)