Schrijver
| pasmo cross assembler run directive
|
prothnl msx friend Berichten: 5 | Geplaatst: 08 Januari 2006, 00:04   |
When I start working on a new system like I started with MSX recently, I try to work as much on PC as I can. I start with trying out emulators and crosscompilers/assemblers. I been working with pasmo for a while now, but after not using it for a while I tend forget that I have to change the run adres in the header with a hex editor.
With the org directive I can set the load adres but the run adres is default 00 00. When I test with:
bload"MyProg.bin",r
it doesnt work. Every time I blame my code for hours before I remember that I have to set the runadres.
Is there an elegant way to avoid this like:
ORG &HC000
RUN &HC000
in the code or :
SET RUN=ORG in configuration file. I prefer not to download the source code (if its available) and change it there.
By the way I read something about using pasmo with GCC compiler. Anyone doing that fro MSX development and is it any good? |
|
DamageX msx freak Berichten: 168 | Geplaatst: 08 Januari 2006, 06:06   |
Ah... I just tried some MSX assembly and ran into this problem also. I suggest assembling with the --bin option and making your own header in the source:
; program load address minus size of header
org $C000-7
; header
db $FE
dw $C000
dw theend-1
dw $C000
; code
;
; put this label at the end
theend
|
|
BiFi msx guru Berichten: 3142 | Geplaatst: 08 Januari 2006, 07:04   |
any decent assembler should be able to handle this:
db $fe
dw start,ending,start
org $c000
start: ; your code
ending: equ $-1
|
|
DamageX msx freak Berichten: 168 | Geplaatst: 09 Januari 2006, 03:43   |
I think that is the first thing I tried and my resulting binary had the 7-byte header followed by 48KB of nothing and then the code...
|
|
snout
 msx legend Berichten: 4991 | Geplaatst: 09 Januari 2006, 08:40   |
Hmmm.. perhaps it's a good idea to give either SjASM or tniASM a go? I'm afraid little MSX developers use Pasmo...
|
|
manuel msx guru Berichten: 3531 | Geplaatst: 09 Januari 2006, 09:15   |
Some C-BIOS developers use Pasmo. Also, Pasmo is next to z80asm (by shevek) one of the two Z80 assemblers available in Debian GNU/Linux. Pasmo is a build-dependency for C-BIOS (also in Debian) and C-BIOS is a dependency of openMSX (also in Debian).
So, for making ROMs, Pasmo is definately suitable. I think that shevek's z80asm is underestimated though! |
|
AuroraMSX
 msx master Berichten: 1260 | Geplaatst: 09 Januari 2006, 12:11   |
You could try this in pasmo:
org $C000-7
db $FE
dw start,ending,start
start:
; your code
ending: equ $-1
The small difference with Bifi's example is that the org comes first, before any code.
If no ORG is given at the start of the source, pasmo will start placing code at location #0000.
That's where the header bytes land. The following org puts the location counter at #c000 resulting in a 12K-7 bytes 0-filled area. If you start the prog with the ORG, though, the very first byte will aready be put at #c000-7 and everything will be just fine.
In short: Pasmo is not a decent assembler
[oh. DamageX already said this. Ah well ...  ] |
|
NotFound msx friend Berichten: 4 | Geplaatst: 16 Januari 2006, 01:35   |
Hello.
The entry point in pasmo can be defined with a END directive at the end of the code, passing the address as his argument.
Regards.
|
|
|
|
|