什么是错的这条线LC3 code的? [英] What is wrong with this line of Lc3 code?

查看:247
本文介绍了什么是错的这条线LC3 code的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做模拟考试的问题。

问题是


  

这有什么错在此行LC3 code的? (出演线)


  ADD R3,R3,0;
** BRNZ ISPOS **

.BLKW 250
ISPOS不R3,R3 ....

我看到星号线是和条件codeS为负,零,基本上去标签ISPOS如果条件code为负或零或以其他方式阻止该程序。

我要说的是,这条线LC3 code有什么不妥的地方。有没有人看到它的任何问题?


解决方案

是的,有这个code段几个不同的错误。

运算codeS不能有什么比一个标签$ P $其他pceding他们。

  ** BRNZ ISPOS **

必须成为:

  BRNZ ISPOS **

你不能有任何随机字符运算后,除非他们被注释掉

  ISPOS不R3,R3 ....

必须更改为:

  ISPOS不R3,R3; ....

I am doing a practice exam question.

The Question is

Is there anything wrong in this line of LC3 code? (The starred line)

ADD R3, R3, 0;
**BRNZ ISPOS;**
HALT
.BLKW 250
ISPOS NOT R3, R3 ....

I saw that the starred line is Branch and the condition codes are negative and zero, basically go to label ISPOS if the condition code is negative or zero or halt the program otherwise.

I would say that this line of LC3 code has nothing wrong with it. Does anyone see any problems with it?

解决方案

Yes, there are a couple different errors with this code segment.

Opcodes cannot have anything other than a label preceding them.

**BRNZ ISPOS;**

Must become:

BRNZ ISPOS;**

You cannot have any random characters after operands, unless they are commented out

ISPOS NOT R3, R3 ....

Must change to:

ISPOS NOT R3, R3 ;....

这篇关于什么是错的这条线LC3 code的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆