Search found 19 matches

by wstjohn
Fri Mar 16, 2007 2:16 pm
Forum: Programming
Topic: Newbie question: accessing a 16-bit memory address
Replies: 55
Views: 36382

epilogue

Well, my original problem ended up being my fault all along. I was hard coding a variable to memory location $FFAA (really $1FAA for the 6507), which is a ROM location. I did this to test the ability to access ROM memory from 16 bit pointers.
I eventually got the pointers to work in a real program ...
by wstjohn
Tue Mar 13, 2007 5:28 pm
Forum: Programming
Topic: Newbie question: accessing a 16-bit memory address
Replies: 55
Views: 36382

If you really want to run it on a real ATARI computer I can tell you that with:


*= $FFFA
.word Start ; NMI
.word Start ; RESET
.word Start ; IRQ


nothing will work, the ATARI will be completly dead!

The reset vector in $FFFC,$FFFD has to point to an adequate boot sequence and also the ...
by wstjohn
Tue Mar 13, 2007 1:23 pm
Forum: Programming
Topic: Newbie question: accessing a 16-bit memory address
Replies: 55
Views: 36382

Thanks for catching that error in the loop. I'll use bpl instead.
The thing is, I'm writing an atari game, so I need to have those directives, as far as I know. The PF1 is a register defined in vcs.h. Well, I guess I could just pull the info from that header file and dump it in with the rest of the ...
by wstjohn
Mon Mar 12, 2007 11:31 pm
Forum: Programming
Topic: Newbie question: accessing a 16-bit memory address
Replies: 55
Views: 36382

Oh no...

OK, I am really confused now.
I wrote another test program using the same indirect addressing mode, and it WORKS on Stella and Z26! The original example only works on PCAE.
Also - I could have sworn that the code:
ldy #7
.drawLine
lda (PF1_pointer),Y
sta PF1
sta WSYNC
dey
bne .drawLine
only ...
by wstjohn
Mon Mar 12, 2007 9:18 pm
Forum: Programming
Topic: Newbie question: accessing a 16-bit memory address
Replies: 55
Views: 36382

Then your simulator must be bullshit! Try the one of Kowalski! Your "short" code is absolutely correct and must give exactly the same result as the "long" version!

OK, so Im not crazy after all. good.

I tried to assembly it with kowalski, but it didnt like the syntax for these lines, and ...
by wstjohn
Mon Mar 12, 2007 6:31 pm
Forum: Programming
Topic: Newbie question: accessing a 16-bit memory address
Replies: 55
Views: 36382

Mats,
My mistake - i wrote that from memory and got it wrong. Here is the real code:
ldy #7
.drawLine
lda (PF1_pointer),Y
sta PF1
sta WSYNC
dey
bne .drawLine
PF1_pointer points to an 8 byte rom table containing a checkerboard pattern.
However what gets drawn to the screen is a single line of ...
by wstjohn
Mon Mar 12, 2007 2:04 pm
Forum: Programming
Topic: Newbie question: accessing a 16-bit memory address
Replies: 55
Views: 36382

Thanks Mats, I will try that one.
I will need to because I had tried just what you have in your example and it didnt work. If I did it manually, like this:

LDX #0
LDA (ZPpointer),X
STA PF0
;do something with PF0
LDX #1
LDA (ZPpointer),X
STA PF0
;do something with PF0
LDX #2
;etc

then it ...
by wstjohn
Tue Mar 06, 2007 7:41 pm
Forum: Programming
Topic: Newbie question: accessing a 16-bit memory address
Replies: 55
Views: 36382

Garth,
I don't have access to the actual hardware yet, but I can work on that. I tried it on two different emulators with the same effect...

AHA! I tried with a third emulator, and it works the way it should!!!

I guess this teaches me a lesson about real hardware vs. emulators.

I really ...
by wstjohn
Tue Mar 06, 2007 7:25 pm
Forum: Programming
Topic: Newbie question: accessing a 16-bit memory address
Replies: 55
Views: 36382

The test case is confusing because $AA is both one of the values stored and
part of the address. In general it's worth putting together such tests so that
each number can come from only one possible place in the code. So here, if you change
lda #%10101010
sta Screen_PF1
to
lda #%01010101
sta ...
by wstjohn
Tue Mar 06, 2007 3:02 pm
Forum: Programming
Topic: Newbie question: accessing a 16-bit memory address
Replies: 55
Views: 36382

I originally tried
LDA (pointer)
but dasm wouldnt compile it saying it was an unsupported address mode.
So the code I used is:
LDY #0
LDA (pointer),Y ;which is supported
STA PF1

Here's the actual code:
;------------------------------------------------
; Addressing Test ...
by wstjohn
Tue Mar 06, 2007 1:07 am
Forum: Programming
Topic: Newbie question: accessing a 16-bit memory address
Replies: 55
Views: 36382

I also used z26 and got the same result.
by wstjohn
Tue Mar 06, 2007 1:07 am
Forum: Programming
Topic: Newbie question: accessing a 16-bit memory address
Replies: 55
Views: 36382

I'm using DASM to compile it and Stella to simulate the Atari VCS...
by wstjohn
Mon Mar 05, 2007 11:56 pm
Forum: Programming
Topic: Newbie question: accessing a 16-bit memory address
Replies: 55
Views: 36382

BitWise,
Yeah, that is exactly what I'm trying to do, and exactly the code I used.
But, what gets loaded into A is only the low byte, not both together!!!

Is this what should happen?

pointer .word
data = $9955
...
LDA #<data
STA pointer
LDA #>data
STA pointer+1
...
;at this point I have ...
by wstjohn
Mon Mar 05, 2007 8:23 pm
Forum: Programming
Topic: Newbie question: accessing a 16-bit memory address
Replies: 55
Views: 36382

BitWise,
I'm not sure I understand you. In my example, PF1_pointer is a 2 byte pointer to some location past zero page memory, say $FFAA.
The first byte contains the low byte of the address #$AA and the second byte contains the high byte of the address #$FF.
I need to use the pointer to somehow load ...
by wstjohn
Mon Mar 05, 2007 3:18 pm
Forum: Programming
Topic: Newbie question: accessing a 16-bit memory address
Replies: 55
Views: 36382

SET_POINTER works, but...

OK, I changed the address to $0AAA.
I did some tests and it looks like both the low and high bytes are getting set,
but LDA (PF1_pointer),#0 only goes to the low byte $0A and
LDA (PF1_pointer+1),#0 only goes to the high byte $AA.
So I still cant get the data from $0AAA...