** EDIT: Problem described below now solved **
Sorry if this is the wrong place to post newbie questions like the one that follows. I've been trying to learn 6502 assembly, but it hasn't taken me long to get stuck.
I was trying one of the examples from "Machine Language for Beginners", which was supposed to put ten "A"s on the screen. I soon realised that the code in the book needed tweaking to work, and so after a bit of trial and error came up with this...
*=20000
ldy #10
loop lda #33
sta (88),Y
dey
cpy #0
bne loop
brk
(Excuse the tab spacing, it was lined up properly in the code edit window!)
If I compile this in ATasm and then attempt to run the object code in the Atari800Win emulator using DOS Option L, it will display 10 "A"s as intended but then crash straight away. Changing the compile address from $4E20 (for example to $0600) or changing the last instruction to "brk" (or removing it completely) leads to the emulated machine crashing as soon as the object code is started.
But switching to WUDSN (with the opening statement changed to "org" for the MADS compiler) makes the code behave differently; there, it causes nothing to happen except the debugger opening with a message about an "illegal operation". Sometimes, if I run it and then start Altirra separately then it will behave the same way as Atari800Win did. Changing "brk" to "rts" though will cause WUDSN to open up Altirra automatically, which will then display the As but immediately reboot into BASIC - which makes sense...I think?
All this is leaving me scratching my head, but I'm guessing there's a simple solution. Any suggestions please?