Pengwin Posted March 9, 2012 Share Posted March 9, 2012 I have this piece of code: ; Routine to load the next level level_vec .word $0000 scrn_vec .word GameScreen + $28 outchar .byte $00 loadlevel inc level ;Increment the level lda #$05 ;If the level is now 5, then set it back to 1 cmp level beq levelok lda #$01 sta level levelok ldx level ;Load the level and reduce it by 1 dex level txa ;Multiply the level by 2 for the offset asl tax lda lvlvectors,x ;Get the address of the level data sta level_vec lda lvlvectors+1,x sta level_vec+1 ldy #$00 getscrnchr lda (level_vec),y ; <---- THIS LINE HERE GENERATES THE ERROR cmp #$FF beq leveldone tax and #$0f clc adc #$40 sta outchar txa lsr lsr lsr lsr tax lda outchar rptscrnchr cpx #$00 beq getscrnchr sta (level_vec),y iny dex jmp rptscrnchr ; ++++++ HERE ++++++ leveldone lda #$00 ;Temporary instruction rts I know it's probablu quite messy, but this is my first real assembly project. However, when I try to run the assembler, it tells me that I have an illegal addressing mode on the indicated line. I though that indirect-indexed was allowed for LDA. Any help please Quote Link to comment Share on other sites More sharing options...
Pengwin Posted March 9, 2012 Author Share Posted March 9, 2012 Never mind, just found out that it is for zero-page addresses only. That will explain my error Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.