Hey everybody. I'm working on a project in which I need to at many points (279, to be precise) throughout the program set a registry to a certain value.

Here's how I've been doing it;
and R0, R0, #0 ; Set R0 to decimal zero.
add R0, R0, #10 ; Set R0 to decimal ten.

But, now I need to set my registries to very large values, like 1000;
and R0, R0, #0 ; Set R0 to decimal zero.
add R0, R0, #1000 ; Set R0 to decimal one thousand.

If I do it this way, however, I get a "constant outside of allowed range" error when I try to assemble my code. Further testing revealed that the allowed range is only #-16 to #31.

Another user included this string in their code for something, but I don't know what he's talking about in the comment part;
ADD R1, R0, #-68 ;will need to sub 68 to dec value of ascii

My question; Does anybody know an assembly code or pseudo code that will set a registry to a certain constant, or else a way I can add constants outside the 'allowed range' to my registries?

Wow guys, 46 views and NO REPLIES.
C'mon, somebody out there knows this!

LC3 only support a range between 256 and -255 that is why. 1000 is much greater than the range

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.