[Coco] Assembly help: Corrupted bin file ?
William Astle
lost at l-w.ca
Thu Dec 18 17:28:07 EST 2008
Art Flexser wrote:
> You use multiple ORG statements, but there can be only one exec address for the
> binary file. You've specified two of them in your example. (I'd assume most
> assemblers would replace the first exec address ($2000) when the second ($7000)
> is encountered.) Use just a single END specifier to let the assembler know the
> exec address for the binary.
Actually, a lot of assemblers will stop assembly completely at the first
END statement encountered. Hence the name "END".
>
> Art
>
> On Thu, 18 Dec 2008, Fedor Steeman wrote:
>
>> Thanks Roger.
>>
>> So, how do I code a multi-segment source file in assembly? Do I just use
>> multiple origin statements? Like:
>>
>> ORG $2000
>> START NOP
>> NOP
>> END START
>> ORG $7000
>> STRT2 NOP
>> NOP
>> END STRT2
>>
>> Cheers,
>> Fedor
>>
>> 2008/12/18 Roger Taylor <operator at coco3.com>
>>
>>> At 01:30 AM 12/17/2008, you 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:
>>>>
>>>
>>> The source code above is missing two things:
>>> the label of the starting line/address
>>>
>>> try:
>>> EXEC LDX #VIDRAM
>>>
>>> and the LOADM/EXEC finalizer is missing
>>> the last line of the source code should be:
>>>
>>> END EXEC
>>>
>>> Now when you LOADM the program from BASIC, all you have to do is type EXEC
>>> No address is needed as in EXEC #####.
>>> If you just used END without an address, you'd have to type EXEC $21FD from
>>> BASIC to run the program.
>>>
>>>
>>>
>>> --
>>> Roger Taylor
>>>
>>> http://www.wordofthedayonline.com
>>>
>>>
>>> --
>>> 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
>>
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
>
More information about the Coco
mailing list