[Coco] Assembly help: Corrupted bin file ?

Fedor Steeman petrander at gmail.com
Wed Dec 17 10:20:35 EST 2008


Hi,

Thanks!

>Guillaume wrote:
> FF 00 00 xx xx
> where xx xx is the execute address.
>

I notice the binary starts with 00 00 24 21 ... wheren 24 21 is the
execution address. Should the binary really start with FF 00 00 24 21 ? Is
this a bug in the assembler or did I forget to set an option?

> Art wrote:
> Looks to me like the generated file is lacking its final segment that
contains
> the execution address.
>

Now that is confusing. Should the binary start with the execution or end
with it? And again: Is this a bug in the assembler or did I forget to set an
option?

I did get other assembly programs to compile and run with no problems. These
do not seem to have these segments attached in the binaries...

>Art wrote:
> Also, the JSR [POLCAT] at the end doesn't do anything--if you want it to
wait
> for a keypress before terminating, you need a BEQ <address of the POLCAT
call>
> after it.

Thanks for the input! I will adjust the code accordingly!

Cheers,
Fedor

2008/12/17 Guillaume Major <gmajor at videotron.ca>

> FF 00 00 xx xx
>
> where xx xx is the execute address. There should be an option in RainbowIDE
> to generate valid RS-DOS files.
>
> Guillaume
>
> "Fedor Steeman" <petrander at gmail.com> a écrit
> dans le message de news:
> dcc956220812162330t4b8be888je63b60fd6321d19f at mail.gmail.com...
> > Hello everyone,
> >
> > I am still trying to learn assembly language but keep on running into
> > problems.
> >
> > I have been trying to have the following source code assembled:
> >
> > VIDRAM  EQU     $0400     *Start of Video Display location
> > V0CLR   EQU     $FFC0        *Clear bit for Sam Chip (Graphics mode)
> > V1SET   EQU     $FFC3        *Set V1 bit in Sam Chip (Graphics mode)
> > V2SET   EQU     $FFC5        *set V2 bit in Sam Chip (Graphics mode)
> > VOFSET  EQU     $FFC6       *Display Offset Binary, This is the CLR Bit
> > (Video page offset)
> > VDGSET  EQU     $FF22        *PIA1 data port B: VDG Control output
> > POLCAT  EQU     $A000        *Color Basic rom poll keyboard routine
> >
> >        ORG     $21FD
> >        LDX     #VIDRAM   *331D: 8E 04 00
> >        LDD     $AAAA     *3320: CC AA AA
> > Z3323   STD     ,X++      *3323: ED 81
> >        CMPX    #$1C00    *3325: 8C 1C 00
> >        BCS     Z3323     *3328: 25 F9
> >        NOP               *332A: 12
> > PMODE4  STA     V0CLR     *2787: B7 FF C0
> >        STA     V1SET     *278A: B7 FF C3
> >        STA     V2SET     *278D: B7 FF C5
> >        LDA     #$F8      *2790: 86 F8
> >        STA     VDGSET    *2792: B7 FF 22
> >        STA     VOFSET    *2795: B7 FF C6
> >        JSR     [POLCAT]  *332E: AD 9F A0 00
> >        RTS               *3332:
> >
> > Using Roger Taylor's CCASM (as included in RainbowIDE) I get the
> following
> > binary file:
> >
> > 00 00 24 21 FD 8E 04 00 FC AA AA ED 81 8C 1C 00
> > 25 F9 12 B7 FF C0 B7 FF C3 B7 FF C5 86 F8 B7 FF
> > 22 B7 FF C6 AD 9F A0 00 39
> >
> > When I try to run this binary file using the VCC emulator I get an error
> > message stating that the binary file is corrupt.
> >
> > Can anyone help me try to understand whether there is anything wrong with
> > my
> > source code, the assembler (i.e. the resulting binary file) or the
> > emulator?
> >
> > Thanks in advance!
> >
> > Cheers,
> > Fedor
> >
> > --
> > Coco mailing list
> > Coco at maltedmedia.com
> > http://five.pairlist.net/mailman/listinfo/coco
> >
>
>
>
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
>
>



More information about the Coco mailing list