17 March 2011, 20:21 | #1 |
Registered User
Join Date: Aug 2008
Location: Salisbury
Posts: 750
|
Devpac and assembling for absolute addresses
I'm using DevPac to write pretty much all my code. I've managed to crack the whole absolute address / non-system kinda stuff now, however I have one question..
Is it possible to get Devpac to assemble to an absolute address without adding all the hunks and shit at the start of the file. The end result I need is just a data file with everything in it, the hunk at the start is REALLY annoying. |
17 March 2011, 20:24 | #2 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
To be loaded with a trackloader or something...?
You could use asmone to assemble and then wb (write binary) to the floppy. That way you just get the data of your file and no hunks. For your code to work like this when you jump into it though you'll probably need it all to be pc relative. |
17 March 2011, 20:37 | #3 |
Registered User
Join Date: Jun 2008
Location: somewhere else
Posts: 523
|
It don't remember it being possible with devpac (absolute addressing wasn't considered a good practice back then) better use vasm, it can generate absolute/relocated binary output and is generally very handy (& can even generate chip located hunks to use with gcc).
|
17 March 2011, 22:33 | #5 | |
Going nowhere
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 9,016
|
Quote:
I'm sure theres a specific tool to do the job (I had my own routines for PM3 Deluxe!), but its what I did in lieu of the tools. |
|
20 March 2011, 17:02 | #6 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
If your code can't be assembled without modification in ASM-One or if you insist on using DevPac, then one alternative is to insert some code in the beginning of your program which writes the rest of the code to disk for you.
EDIT: this works and can just be copy-pasted right in Code:
org $40000-76-14 savebinary move.l 4.w, a6 lea _doslib(pc), a1 jsr -408(a6) move.l d0, a6 lea _file(pc), a0 move.l a0, d1 move.l #1006, d2 jsr -30(a6) move.l d0, d4 beq.b _exit move.l d0, d1 lea progstart(pc), a0 move.l a0, d2 move.l _length(pc), d3 jsr -48(a6) move.l d4, d1 jsr -36(a6) _exit moveq #0, d0 rts _length dc.l proglength _doslib dc.b "dos.library", 0 _file dc.b "ram:code.bin", 0, 0 progstart code goes in here proglength = *-progstart Last edited by Leffmann; 20 March 2011 at 17:16. |
21 March 2011, 10:31 | #7 |
Registered User
Join Date: Aug 2008
Location: Salisbury
Posts: 750
|
Hi Guys
Thanks for the tips. I found a way to manage this now. I specify the ORG address in the code and put a string at the end of the code and data. Assemble, Debug, search for string then I can save the binary out of memory. Works wells, just a bit fiddly. |
21 March 2011, 11:00 | #8 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,537
|
If you don't want to use an assembler supporting raw-binary output there is still another option for you: use a linker, like vlink.
1. Create an object file with your assembler. 2. Convert it into a raw binary file with vlink: Code:
$ vlink -brawbin1 -o filename filename.o |
21 March 2011, 18:41 | #9 |
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
|
21 March 2011, 18:50 | #10 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
|
21 March 2011, 19:12 | #11 |
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Assembling Gravity Force 2 source code | absence | Coders. General | 5 | 13 May 2012 11:44 |
[REQ:ASM] Assembling and running | jman | Coders. Tutorials | 9 | 07 May 2011 18:39 |
DevPac and Absolute Address | h0ffman | Coders. General | 2 | 14 January 2011 15:32 |
Free Amiga Life.com email addresses | ami_junkie | Amiga scene | 0 | 17 April 2008 04:03 |
|
|