I am making my first steps in lc3 assembly programming and I noticed that every time I try to store a negative value in memory, for example using "ST" instruction, there is some kind of error. In this memory location is stored "TRAP xFF" instead... Anybody know how can I get over it??
相关问题
- Python sorting list with negative number
- Compilers and negative numbers representations
- Why does right shifting -1 always gives -1 in PHP?
- Why does slice [:-0] return empty list in Python
- Is it possible to differentiate between 0 and -0?
相关文章
- Why does slice [:-0] return empty list in Python
- Is it possible to differentiate between 0 and -0?
- Format Negative numbers in parenthesis BUT NOT wit
- 1000 * 60 * 60 * 24 * 30 results in a negative num
- LC3汇编语言 - 创建2个阵列,乘,并添加总和(LC3 assembly language - c
- LC3 LEA指令和存储的值(LC3 LEA instruction and the value s
- 支柱2模型驱动的负整数(Struts 2 Model driven negative integer
- 导轨从0到-100 range_field(Rails range_field from 0 to
You're getting that error because your variables are apart of the run-time code. It's usually best practice to put your variables at the end of your code after the HALT command.
The reason you were getting those errors is because when you were storing numbers into your variables the simulator thought they were commands. The trap command has an opcode of 1111 which also a negative number. When the simulator ran into your variable it couldn't figure out what type of TRAP command it was, thus the error. By preventing the simulator from running your variables you won't get that error.