ASM Expression expected error

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ASM Expression expected error

ysh443
Hi

i dont understand what im doing wrong
i i simply want to define a variable like counter

i first set some address to the a register
then i increment ot decrement M which point to the RAM at address A

but the CPU_Sim  keep giving me this error (whiel trying to load my ASM file):
(SHL)
        @100
        M=M-1  <--- line 13
        D=D+D
        R0=R0&D

In Line 13 Expression expected

what is wrong?

regards
Reply | Threaded
Open this post in threaded view
|

Re: ASM Expression expected error

cadet1620
Administrator
ysh443 wrote
(SHL)
        @100
        M=M-1  <--- line 13
        D=D+D
        R0=R0&D

In Line 13 Expression expected
The actual error is on the next line, D=D+D is not a legal instruction.

Look at figure 4.3; those are the only computations the ALU can perform. Hence, the mnemonics in the left and right columns are the only legal computations allowed on the right side of the "=".

To compute D=D+D you need to move D into A and then compute D=D+A. To compute R0=R0&D, set A to R0's address then compute M=D&M.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: ASM Expression expected error

ysh443
thx Mark
that really helped


where can i find more example for correct A and C instructions?
i find it confusing to determine what should i code in order to manipulate some register\sdrees\value

regards