|
Post by C128Man on Aug 19, 2015 15:33:14 GMT
Hi,
I'm beginning to code in 6502 assembler. I'm using the build in monitor program to test my knowledge.
Here is one of my program:
monitor pc sr ac xr yr sp ; fb000 00 00 00 00 f8 d 0c00 0c18 . 00c00 a2 15 ldx #$15 . 00c02 a0 15 ldy #$15 . 00c04 8c 20 d0 sty $d020 . 00c07 88 dey . 00c08 c0 00 cpy #$00 . 00c0a d0 f8 bne $0c04 . 00c0c 8e 21 d0 stx $d021 . 00c0f ca dex . 00c10 e0 00 cpx #$00 . 00c12 d0 ee bne $0c02 . 00c14 4c 00 0c jmp $0c00 . 00c17 60 rts . 00c18 00 brk
My first problem is, to execute the code, I must alway go out the monitor ( with 'x') and type "sys dec("0c00")". If I try "g 0c00" or "j 0c00" inside the monitor, nothing happen.
Is it a problem with my code?
Ben
|
|
|
Post by VDC 8x2 on Aug 19, 2015 20:27:08 GMT
you need to specify the bank. j 00c00 or g 00c00.
0 - f in front of the address specifies bank number.
|
|
|
Post by C128Man on Aug 20, 2015 6:40:06 GMT
Even with 0 in front, nothing append. I'm working in VICE
|
|
|
Post by VDC 8x2 on Aug 20, 2015 16:30:50 GMT
hmm, that is weird.
|
|
|
Post by C128Man on Aug 20, 2015 18:04:30 GMT
Do you think it's a problem with VICE? I'm on Linux with version 2.4.9
|
|
|
Post by hydrophilic on Aug 21, 2015 13:06:39 GMT
Hey Bendevil,
Your program runs just fine!
In MONITOR just issue this command:
J F0C00
or G F0C00
The important thing is the leading "F" which means BANK 15... this "bank" (memory configuration) allows access to I/O registers.
I tested your code in multiple versions of VICE and it works great (with "F")... sorry I'm too lazy to copy to my real C128... but I'm am 100% sure it would work!
|
|
|
Post by C128Man on Aug 23, 2015 17:49:15 GMT
Thanks hydrophilic,
It works with the "f" before the memory address :-)
I've got a new version of my wonderful program ;-)
monitor pc sr ac xr yr sp ; fb000 00 00 00 00 f8 d 0c00 . 00c00 ee 20 d0 inc $d020 . 00c03 ee 21 d0 inc $d021 . 00c06 4c 00 0c jmp $0c00
|
|