Page 1 of 1

Machine language issue

Posted: Wed Mar 27, 2019 9:10 pm
by 20questions
Why is it that when I write an instruction such as LDA #$01 that it changes to jsr $2020? it does that for every single instruction. what Is going on. My only Vicmon experience is on this website:https://techtinkering.com/2013/04/16/be ... re-vic-20/
and everything there worls ok on my end but the moment I try to make something of my own, the above happens. please help.
Vicmon is set at $6000 Sys 24576

Re: Machine language issue

Posted: Thu Mar 28, 2019 1:11 am
by srowe
What address are you assembling at? If the result "changes" that suggests you're using an address that isn't RAM.

Re: Machine language issue

Posted: Thu Mar 28, 2019 5:38 am
by Mike
srowe wrote:you're using an address that isn't RAM.
... or no memory at all.

Most probably the OP wanted to assemble the instruction at address $20xx. Read accesses from "open" address ranges quite often (but not reliably) return the high byte of the address as data. That means, even though LDA #$01 ($A9 $01) was written to $2000 and $2001, what got read back was $20 $20 $20 ... and this is disassembled (as control mechanism of the direct assembler) as JSR $2020.

Solution: Enable RAM in BLK1 ($2000..$3FFF) in VICE or add the necessary RAM expansion on real hardware.
20questions wrote:My only Vicmon experience is on this website:https://techtinkering.com/2013/04/16/be ... re-vic-20/
There's also the thread "A sample programming session in VICMON" you have already replied to. :?

Re: Machine language issue

Posted: Thu Mar 28, 2019 12:52 pm
by 20questions
Mike wrote:
srowe wrote:you're using an address that isn't RAM.
... or no memory at all.

Most probably the OP wanted to assemble the instruction at address $20xx. Read accesses from "open" address ranges quite often (but not reliably) return the high byte of the address as data. That means, even though LDA #$01 ($A9 $01) was written to $2000 and $2001, what got read back was $20 $20 $20 ... and this is disassembled (as control mechanism of the direct assembler) as JSR $2020.

Solution: Enable RAM in BLK1 ($2000..$3FFF) in VICE or add the necessary RAM expansion on real hardware.
20questions wrote:My only Vicmon experience is on this website:https://techtinkering.com/2013/04/16/be ... re-vic-20/
There's also the thread "A sample programming session in VICMON" you have already replied to. :?
so, not enough memory? got it. thanks :D

Re: Machine language issue

Posted: Thu Mar 28, 2019 1:31 pm
by OmegaMax
Working on your first Hello World! in assembly?

Re: Machine language issue

Posted: Fri Mar 29, 2019 12:53 am
by 20questions
OmegaMax wrote:Working on your first Hello World! in assembly?
I've been absorbin as much as possible about the 6502, using Assembly Lines (Great book) and others. I use AppleWin when i want to do serious programming (even though I have no idea how to Use Merlin (no how to docs were released with the other stuff) nor how to exit the Editor/assembler.
I then try to replicate the code on the C64 or the Vic 20. So my day is usually full.