我们在和大会一起工作。我有点迷路了。这是一个关于学习指南的实践问题:
使用假想的机器(3-地址、2-地址、1-地址和0-地址)和以下命令:
load= puts value in address
add = +
mult = *
sub = -
lda=load in accumulator
sta = loads from accumulator to memory
push=copies to the stack
pop=copies from the stack为每台机器显示执行以下任务的指令:
F=E+(A-C) – (B*E)有人能解释一下这四种不同的机器类型在代码上有什么不同吗?有人能告诉我怎么把这四个中的一个作为起点吗?
发布于 2012-03-12 11:47:51
3-Addr. (Result and ops from memory)
mult b, b, e
sub f, a, c
sub f, f, b
add f, e, f
2-Addr (Shared result and one op)
mult b, e
sub a, c
load f, e
add f, a
sub f, b
1-Addr (Accu only)
lda b
mult e
sta b
lda a
sub c
sta a
lda e
add a
sub b
sta f
0-Addr (Stack only)
push e
push a
push c
sub
add
push b
push e
mult
sub
pop fhttps://stackoverflow.com/questions/9630307
复制相似问题