how to run sjasm output (Development MSX Fora)MSX Resource Center MSXdev 2008 - MSX1 development bonanza!           
            
English Nederlands Español Português Russian         
 Nieuws
   Voorpagina
  Nieuws archief
  Nieuws onderwerpen

 Informatie
   MSX Fora
  Artikelen
  Recensies
  Beursverslagen
  Fotoreportages
  Beurzen en meetings
  Enquêtes
  Links
  Zoek

 Software
   Downloads
  Webshop

 MRC
   Wie we zijn
  Kom bij ons team
  Doneren
  Policies
  Contact met het MRC
  Link naar Ons
  Statistieken

 Zoek
 
  

  

 Login
 

Gebruikersnaam

Wachtwoord




Ben je nog niet lid? Klik hier en word MSX vriend!


 Statistieken
 

Er zijn 104 gasten en 6 MSX vrienden online

Je bent een anonieme bezoeker.
 

MSX Fora


MSX Fora

Development - how to run sjasm output

Schrijver

how to run sjasm output

pjotrx
msx friend
Berichten: 9
Geplaatst: 09 Juli 2006, 21:24   
Hi all,

I'm playing around a bit with Z80 assembly (with practically no experience), using sjasm on linux, but every time I try to execute the created binary file (bload"t1.bin",r), I get a "Bad file mode" message, both in openMSX and on my real MSX. I've compiled my source as follows: sjasm -l t1.asm t1.bin

Can anyone tell me what I am doing wrong?

thanks
sjoerd
msx addict
Berichten: 444
Geplaatst: 09 Juli 2006, 21:46   
Does your source start with a header like this one?

  byte 0feh
  word start
  word end-1
  word start

  org 0c000h

start:
  nop
  ret
end:

pjotrx
msx friend
Berichten: 9
Geplaatst: 10 Juli 2006, 07:52   
I was missing parts of that, but now it works, thanks!
pjotrx
msx friend
Berichten: 9
Geplaatst: 10 Juli 2006, 15:51   
Okay, so now I can execute my compiled code. However, things are not working as I would, perhaps somewhat naively, expect...

The following code is supposed to draw two lines and give two beeps, using routines in the (sub)rom. The first set is in the main loop, the second in a subroutine which is called from the main loop. But it appears the second is never executed. No second beep, no second line.... The subroutine does show up in the symbol list and label table produced by sjasm, however.

Could anyone tell me what I'm doing wrong?


        byte 0feh
        word start
        word end-1
        word start

        org 0c000h

start:  ld a,5          ; screen 5
        ld ix,#00d1     ; CHGMOD
        call #015F      ; extrom -> call subrom routine in ix

        ld bc,204       ; end coordinates
        ld (#fcb3),bc
        ld bc,50
        ld (#fcb5),bc

        ld bc,50        ; start coordinates
        ld de,161

        ld a,8          ; color
        ld (#F3F2),a
        ld a,0          ; LOGOPR
        ld (#FB02),a

        ld ix,#0085     ; DOGRPH
        call #015f      ; EXTROM

        call #00c0      ; beep

        call #009f      ; chget: wait for input

        call putlin

        call #009f      ; chget: wait for input

        ld a,0          ; screen 0
        ld ix,#00d1     ; CHGMOD
        call #015F      ; extrom -> call subrom routine in ix

        nop
        ret
end:

putlin: call #00c0      ; beep

        ld bc,204       ; end coordinates
        ld (#fcb3),bc
        ld bc,161
        ld (#fcb5),bc

        ld bc,50        ; start coordinates
        ld de,50

        ld a,15          ; color
        ld (#F3F2),a
        ld a,0          ; LOGOPR
        ld (#FB02),a

        ld ix,#0085     ; DOGRPH
        call #015f      ; EXTROM

        ret



pjotrx
msx friend
Berichten: 9
Geplaatst: 10 Juli 2006, 16:33   
Oh I get it... it's because the code of the putlin routine is after the end label and thus after the ending address as indicated in the header.
 
 







(c) 1994 - 2008 Stichting MSX Resource Center. MSX is een trademark van MSX Licensing Corporation.