Why not I can't put 65535 in RAM

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

Why not I can't put 65535 in RAM

liangke
example:
@SCREEN
M=65535
The assembeler tell me "Expression expected"

anybody can tell me why?
thanks
Reply | Threaded
Open this post in threaded view
|

Re: Why not I can't put 65535 in RAM

cadet1620
Administrator
liangke wrote
example:
@SCREEN
M=65535
The assembeler tell me "Expression expected"
The only expressions allowed on the right side of '=' are those computable by the ALU, as shown in Figure 4.5. To set RAM to an arbitrary value you need to use multiple statements.

    @12345
    D=A
    @SCREEN
    M=D

Note that the '@' command only handles numbers in the range 0–32767 (15-bit unsigned integers).

What you need to do is set RAM to the negative number that has the same bit pattern as 65535. There is a legal M= command to do that.

--Mark