Help to understand src rom code
Posted: 19 Nov 2019, 06:22
I started to learn src rom code and difficulties appeared.
I do not understand line 0012 ? Please give me a hint.
------------------- 0003 0001 ld $01--------------;
.countMem0:----0004 d601 st [$01],y---------;
------------------- 0005 00ff ld $ff---------------;
------------------- 0006 6900 xora [y,$00]------- ;
------------------------------------------------------- ;
--------------------0007 ca00 st [y,$00]---------;
--------------------0008 c200 st [$00]-----------;
------------------- 0009 6900 xora [y,$00]------- ;
--------------------000a ec0a bne $000a--------- ;
---------------------------------------------------------;
---------------------------------------------------------;
---------------------------------------------------------;
---------------------------------------------------------;
---------------------------------------------------------;
--------------------000b 00ff ld $ff-----------------;
------------------- 000c 6900 xora [y,$00]---------;
------------------- 000d ca00 st [y,$00]-----------;
------------------- 000e 6100 xora [$00]-----------;
------------------- 000f f013 beq .countMem1----;
--------------------0010 0101 ld [$01]-------------;
--------------------0011 fc04 bra .countMem0----; branch always
------------------- 0012 8200 adda ac--------------; AC+$00 I do not understand how this instructions
--------------------------------------------------------; is started, if before it branch always instruction,and
--------------------------------------------------------; not other link to it ?!?!
.countMem1:----0013 00ff ld $ff-----------------------------------------------------------------------------------
I do not understand line 0012 ? Please give me a hint.
------------------- 0003 0001 ld $01--------------;
.countMem0:----0004 d601 st [$01],y---------;
------------------- 0005 00ff ld $ff---------------;
------------------- 0006 6900 xora [y,$00]------- ;
------------------------------------------------------- ;
--------------------0007 ca00 st [y,$00]---------;
--------------------0008 c200 st [$00]-----------;
------------------- 0009 6900 xora [y,$00]------- ;
--------------------000a ec0a bne $000a--------- ;
---------------------------------------------------------;
---------------------------------------------------------;
---------------------------------------------------------;
---------------------------------------------------------;
---------------------------------------------------------;
--------------------000b 00ff ld $ff-----------------;
------------------- 000c 6900 xora [y,$00]---------;
------------------- 000d ca00 st [y,$00]-----------;
------------------- 000e 6100 xora [$00]-----------;
------------------- 000f f013 beq .countMem1----;
--------------------0010 0101 ld [$01]-------------;
--------------------0011 fc04 bra .countMem0----; branch always
------------------- 0012 8200 adda ac--------------; AC+$00 I do not understand how this instructions
--------------------------------------------------------; is started, if before it branch always instruction,and
--------------------------------------------------------; not other link to it ?!?!
.countMem1:----0013 00ff ld $ff-----------------------------------------------------------------------------------