as far as i understand register A is 16 bits wide, meaning i should be able to load a value of 65535 (2^16 - 1, i.e @65535) into it. however for some reason if i try to load any value larger than 32767 (2^15 - 1, i.e @32767) assembler automatically transforms it into 16. because of this whenever i try to blacken the screen i get the stripes on the screen. the image of my screen is attached to this post. has anyone encountered this problem and how did you solve it? any help is appreciated.
The value for @ instructions can only be unsigned numbers in the range 0 to 32767. The reason is that @ instructions are encoded as 0nnn nnnn nnnn nnnn so there are only 15 bits available for the value. The easiest way to get 65535 into a register is the C-instruction reg=-1.
(FWIW, I think that the assembler is interpreting the out of range value as a symbol name and assigning it the first available RAM address.)