Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Benoit0123 Newsgroups: comp.sys.apple2.programmer Subject: Re: DA statement not registering after running compiled program. Date: Mon, 26 Oct 2015 10:08:05 +0000 (UTC) Organization: Mac GUI Lines: 54 Message-ID: References: <9106d3b6-6cd3-41d3-bec5-d604f093bd67@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 26 Oct 2015 10:08:05 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="ac9e0e4d7dd3957fb97803ee6801bab8"; logging-data="4947"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX187ggzZ6nyPPhGLQeLuXw7x" User-Agent: Mac GUI Usenet In-Reply-To: <9106d3b6-6cd3-41d3-bec5-d604f093bd67@googlegroups.com> Cancel-Lock: sha1:oSLoM21RmIKoXSqNlF49eMFfcxA= Xref: csiph.com comp.sys.apple2.programmer:1924 jamesiwalker77 wrote: > It seems to me that the DA statement is somehow not registering. > > My code is: > ORG $300 > LDA $6000 > STA $2000 > DONE RTS > ORG $6000 > DA $FFFF > > I compiled this program, and Merlin shows correct compilation, with the > values of memory addresses $6000 and $6001 both set to $FF. > > However, after I save the source and object code (after compiling), I > leave > the assembler, switch to HGR and BRUN the program. There should be a > white > line in the upper left corner of the screen. There are pixels plotted > there, but not a white line. It seems to be pulling other values from > $6000 and $6001 than what my DA statement should put in those addresses. > Even after going to the monitor and examining $6000 and $6001, neither are > $FF. > > Anyone have any idea what is going on here? It seems that there's > possibly > some point about how program memory is saved which I am missing here. > Below is an amended source code w/o having to deal with two separate object code that should also work. And yes, the Merlin assembler works as designed and is a great tool. ORG $0300 LDX #DATEND-DATBEG-1 ]LOOP LDA DATBEG,X STA $6000,X DEX BPL ]LOOP * Now you can play as if data was @ $6000 LDA $6000 STA $2000 DONE RTS DATBEG ORG $6000 DA $FFFF * The following ORG restore the original assembly PC (adjusted by the amount * of code assembled since the ORG $6000 directive above). ORG DATEND -- Growing old is mandatory.. growing up is optional.. But the other way round is as true.