Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Dasm rorg directive
2008-11-05 20:28
The Human Code Machine

Registered: Sep 2005
Posts: 112
Dasm rorg directive

Hi, I'm looking for a DASM cross assembler version newer than 2.12 for DOS/Win with correctly working rorg directive. All newer versions I found on the net can't assemble the lower attached test source. I found it ages ago on one of the famous Fred Fish disks and I don't want to switch to another one :( I tried to contact one of the new maintainers, but I got no response. Anybody here has a working version or knows the dasm sourcecode a bit and has time to fix it?

processor 6502
org $c000

Main subroutine
sei
jsr Test
jmp nmi

Test subroutine
ldx #nmi_end-nmi_start-1
.loop lda nmi_start,x
sta nmi,x
dex
bpl .loop
rts


nmi_start subroutine

RORG $02
nmi subroutine
.1 INC $d020
jmp .1
rend

nmi_end
2008-11-05 20:38
Danzig

Registered: Jun 2002
Posts: 440
switch to kickassembler and explore a whole new world for you :D sorry, not the advise you expected but really: give it a try!
2008-11-05 20:41
iAN CooG

Registered: May 2002
Posts: 3197
Quote: Hi, I'm looking for a DASM cross assembler version newer than 2.12 for DOS/Win with correctly working rorg directive. All newer versions I found on the net can't assemble the lower attached test source. I found it ages ago on one of the famous Fred Fish disks and I don't want to switch to another one :( I tried to contact one of the new maintainers, but I got no response. Anybody here has a working version or knows the dasm sourcecode a bit and has time to fix it?

processor 6502
org $c000

Main subroutine
sei
jsr Test
jmp nmi

Test subroutine
ldx #nmi_end-nmi_start-1
.loop lda nmi_start,x
sta nmi,x
dex
bpl .loop
rts


nmi_start subroutine

RORG $02
nmi subroutine
.1 INC $d020
jmp .1
rend

nmi_end


Grab my version, I just compiled it fine.
http://iancoog.altervista.org/

        org $c000

Main subroutine
        sei
        jsr Test
        jmp nmi

Test subroutine
        ldx #nmi_end-nmi_start-1
.loop   lda nmi_start,x
        sta nmi,x
        dex
        bpl .loop
        rts


nmi_start subroutine

        RORG $02
nmi subroutine
.1      inc $d020
        jmp .1
        REND

nmi_end


dasm "x.s" -o"x.prg" -v2 -l"x.lst"

------- FILE x.s LEVEL 1 PASS 3
      1  c000                                         org       $c000
      2  c000
      3  c000                              Main       subroutine
      4  c000                  78                     sei
      5  c001                  20 07 c0               jsr       Test
      6  c004                  4c 02 00               jmp       nmi
      7  c007
      8  c007                              Test       subroutine
      9  c007                  a2 05                  ldx       #nmi_end-nmi_start-1
     10  c009                  bd 12 c0    .loop      lda       nmi_start,x
     11  c00c                  95 02                  sta       nmi,x
     12  c00e                  ca                     dex
     13  c00f                  10 f8                  bpl       .loop
     14  c011                  60                     rts
     15  c012
     16  c012
     17  c012                              nmi_start  subroutine
     18  c012
     19  c012 0000                                    RORG      $02
     20  c012 0000                         nmi        subroutine
     21  c012 0002             ee 20 d0    .1         inc       $d020
     22  c015 0005             4c 02 00               jmp       .1
     23  c018                                         REND
     24  c018
     25  c018                              nmi_end

2008-11-05 20:45
tlr

Registered: Sep 2003
Posts: 1790
It doesn't assemble in dasm V2.20.10, but not due to the rorg directive.
It rather fails because it assumes "sta nmi,x" is 3 bytes long in the first pass and in the second pass nmi_start has then moved one byte.
It probably behaves wrong in this sense.
If you force it to long by .wx it works. I think you can force it to zp too, but I don't remember how.
2008-11-05 20:46
iAN CooG

Registered: May 2002
Posts: 3197
Quote: It doesn't assemble in dasm V2.20.10, but not due to the rorg directive.
It rather fails because it assumes "sta nmi,x" is 3 bytes long in the first pass and in the second pass nmi_start has then moved one byte.
It probably behaves wrong in this sense.
If you force it to long by .wx it works. I think you can force it to zp too, but I don't remember how.


the other dasms around sux. mine rulz. end of the story.
:D
2008-11-05 21:13
chatGPZ

Registered: Dec 2001
Posts: 11386
any version of dasm sucks arse, fact =P
2008-11-05 21:29
iAN CooG

Registered: May 2002
Posts: 3197
Quote: any version of dasm sucks arse, fact =P

hmpf. you're not even worth a reply
OMFG I replied anyway!1 /o\
2008-11-05 21:30
The Human Code Machine

Registered: Sep 2005
Posts: 112
Thx iAN CooG! I'll give it a try. I think DASM is still a good assembler and I like the way it handles local labels and I didn't find an assembler which offers this the same way. Perhaps I was too lazy to look deep enough...
2008-11-05 21:33
chatGPZ

Registered: Dec 2001
Posts: 11386
:o)

does yours give some half sane error messages at least? i have to use dasm for work atm and its inability to even print meaningful errors drives my nuts =)

thcm: many assemblers support "cheap" local labels :) dasm really doesnt have any special features at all.
2008-11-05 21:51
The Human Code Machine

Registered: Sep 2005
Posts: 112
@Groepaz: For me the SUBROUTINE is special enough and I like the simplicity and readability of my good old trusted DASM assembler. I don't like the high level stuff like the script stuff used in kickassembler. I also don't like the way local labels are handled, but that's just my personal taste. Thx everybody for the help.
2008-11-05 21:54
iAN CooG

Registered: May 2002
Posts: 3197
Quote: :o)

does yours give some half sane error messages at least? i have to use dasm for work atm and its inability to even print meaningful errors drives my nuts =)

thcm: many assemblers support "cheap" local labels :) dasm really doesnt have any special features at all.


Huh, depends on what do you mean by sane =)
Any example of weird messages?
I have to remember that I stripped from my build any other processor, it's 6502 only, so no need to write processor 6502 on top anymore -it's simply ignored - so if you use it for some microcontroller coding with different cpu it's no use for you. I only need coding in asm for the C64 =)
2008-11-05 22:01
chatGPZ

Registered: Dec 2001
Posts: 11386
well the one i use ("official" 2.20.11) doesnt really give any errors at all. for example when you make a simple typo somewhere, it just says assembling failed, doesnt give a line number or whatever, VERY annoying =P

and yeah well, i use it for 6502 :)
2008-11-05 22:36
iAN CooG

Registered: May 2002
Posts: 3197
Quote: well the one i use ("official" 2.20.11) doesnt really give any errors at all. for example when you make a simple typo somewhere, it just says assembling failed, doesnt give a line number or whatever, VERY annoying =P

and yeah well, i use it for 6502 :)


oh no, that would be unusable for sure.
My version is based on 2.20.07 but I can assure it gives errors and line numbers even with 0 verboseness. But it's been so modified that has nothing to spare with the original source, after 4 years of mods.
-v and -l are there for extra verboseness. I use -v 2 and -lname.lst all the time

2008-11-05 22:51
chatGPZ

Registered: Dec 2001
Posts: 11386
gotta try it then i guess :)
2008-11-06 08:48
Frantic

Registered: Mar 2003
Posts: 1648
iAN: Is your mod available somewhere?

//FTC
2008-11-06 12:04
Mace

Registered: May 2002
Posts: 1799
Frantic, check message nr. 3 in this thread.
You'll find a link to iAN's website ;)
2008-11-06 12:46
Martin Piper

Registered: Nov 2007
Posts: 722
This works in ACME:
*=$c000
sei
jsr Test
jmp nmi

Test
ldx #nmi_end-nmi_start-1
.loop lda nmi_start,x
sta+1 nmi,x ; +1 forces 8 bit addressing mode
dex
bpl .loop
rts


nmi_start

!pseudopc $02 {
nmi
.1 INC $d020
jmp .1
rend
}
nmi_end
2008-11-10 17:30
chatGPZ

Registered: Dec 2001
Posts: 11386
urks, i tried your version ian.... and unfortunately i have to say that it sucks even more than the official one. the program counter seems to get confused under certain circumstances :/
747  9ffa       ; BANK 1 Vectors at $fffa
748  9ffa           org $9ffa
749  9ffa         a0 ff        .byte.b $a0,$ff ; NMI
750  9ffc         ac ff        .byte.b $ac,$ff ; Reset
751  9ffe         ac ff        .byte.b $ac,$ff ; IRQ

results in:
0000:1FD0 | D0 8D 21 D0   A0 00 B9 72   FF 99 00 02   C8 D0 F7 4C
0000:1FE0 | 00 02 A0 FF   AC FF AC FF   4C 12 80 4C   12 80 FF 43
0000:1FF0 | 42 4D A0 00   B9 3B A8 99   00 40 C8 D0   F7 A5 06 F0 


the very same file assembled with official 2.20.11 gives the expected (correct) output. so now i can choose between useful error messages and correct output. "great" =P
2008-11-10 19:38
iAN CooG

Registered: May 2002
Posts: 3197
Quote: urks, i tried your version ian.... and unfortunately i have to say that it sucks even more than the official one. the program counter seems to get confused under certain circumstances :/
747  9ffa       ; BANK 1 Vectors at $fffa
748  9ffa           org $9ffa
749  9ffa         a0 ff        .byte.b $a0,$ff ; NMI
750  9ffc         ac ff        .byte.b $ac,$ff ; Reset
751  9ffe         ac ff        .byte.b $ac,$ff ; IRQ

results in:
0000:1FD0 | D0 8D 21 D0   A0 00 B9 72   FF 99 00 02   C8 D0 F7 4C
0000:1FE0 | 00 02 A0 FF   AC FF AC FF   4C 12 80 4C   12 80 FF 43
0000:1FF0 | 42 4D A0 00   B9 3B A8 99   00 40 C8 D0   F7 A5 06 F0 


the very same file assembled with official 2.20.11 gives the expected (correct) output. so now i can choose between useful error messages and correct output. "great" =P


wtf?
 org $9ffa
 .byte $a0,$ff ; NMI
 .byte $ac,$ff ; Reset
 .byte $ac,$ff ; IRQ

this assembles just fine. Probably there is more you are not showing?
2008-11-10 19:45
chatGPZ

Registered: Dec 2001
Posts: 11386
ofcourse, this is from a large project (mmcr bios). i have to admit that i am not really in the mood to cut it down into a simple testcase right now :)
2008-11-10 19:58
WVL

Registered: Mar 2002
Posts: 902
Ehr hold on..

Are you saying you have the sources to the mmcr bios... also for the built-in sidplayer? Willing to share (if you are allowed?) so we can fix that thing?
2008-11-10 20:07
chatGPZ

Registered: Dec 2001
Posts: 11386
i can't share - but i *am* fixing it, just right now =)
2008-11-10 20:08
Ninja

Registered: Jan 2002
Posts: 411
gpz: Hint: You know that RR development was the main reason for Doc Bacardi to create DreamAss ;)
2008-11-10 20:09
iAN CooG

Registered: May 2002
Posts: 3197
Quote: ofcourse, this is from a large project (mmcr bios). i have to admit that i am not really in the mood to cut it down into a simple testcase right now :)

I fear some reversed org addresses can cause errors.
Make sure the lowest org is declared 1st.
Also raising the number of build passes can help resolving labels declared later in the source.
2008-11-10 20:22
chatGPZ

Registered: Dec 2001
Posts: 11386
Quote:
gpz: Hint: You know that RR development was the main reason for Doc Bacardi to create DreamAss ;)


hehe well, i don't really feel like converting the source to another assembler :) (and then i'd choose ca65 =P)
2008-11-10 20:38
Ninja

Registered: Jan 2002
Posts: 411
:D

Well, as long as there is a new binary for all of us at the end of the day. Oh. and what WVL said! ;)
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
kbs/Pht/Lxt
Andy/AEG
XmikeX
Peacemaker/CENSOR/Hi..
Sulevi/Virtual Dreams
slimeysmine
megasoftargentina
grass/LETHARGY
Hagar/The Supply Team
t0m3000/hf^boom!^ibx
Mibri/ATL^MSL^PRX
Guests online: 174
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Violator  (9.7)
4 Acidchild  (9.7)
5 Cash  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.1 sec.