小编Ken*_*oto的帖子

汇编将 al 寄存器值移入 ax

我对程序集完全陌生,在搜索之后我仍然对寄存器有一些疑问。目前我正在尝试通过执行以下操作一遍又一遍地划分值:

1.将 ax 与 bl 相除(似乎余数去 ah,商去 al)

2.move al(quotient) to ax

3. 如果 ax 小于或等于 0,则跳转到 5

4.跳到1

5.结束

问题出现在指令 2 上,因为我试图将 8 位值移动到 16 位值。有人知道如何解决问题吗?

我使用的是 emu8086,所以寄存器只有 x、h 和 l。

assembly x86-16 emu8086

1
推荐指数
1
解决办法
5794
查看次数

错误:使用'func'产生的模糊类型变量't0'可以防止约束'(Show t0)'被解决

我正在研究Haskell.而我正在尝试制作一个while循环,每次运行它都会使得'a'的值在之后的地板上缩小2倍.

这很好用:

func a = 
    if a > 0 then 
      func (a/2)
    else 
      print (a)
Run Code Online (Sandbox Code Playgroud)

现在添加楼层功能.

func a = 
    if a > 0 then 
        func (floor (a/2))
    else 
        print (a)
Run Code Online (Sandbox Code Playgroud)

现在运行它

func 5
Run Code Online (Sandbox Code Playgroud)

并且有一个错误:

Ambiguous type variable ‘t0’ arising from a use of ‘func’
      prevents the constraint ‘(Show t0)’ from being solved.
      Probable fix: use a type annotation to specify what ‘t0’ should be.
      These potential instances exist:
        instance Show Ordering -- Defined in ‘GHC.Show’
        instance Show Integer -- Defined …
Run Code Online (Sandbox Code Playgroud)

haskell

0
推荐指数
1
解决办法
169
查看次数

标签 统计

assembly ×1

emu8086 ×1

haskell ×1

x86-16 ×1