[Coco] Assembly help: Corrupted bin file ?

Art Flexser flexser at fiu.edu
Wed Dec 17 08:21:45 EST 2008


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

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.

Art

On Wed, 17 Dec 2008, Fedor Steeman wrote:

> 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
> 




More information about the Coco mailing list