M
mxYaYa
Unregistered / Unconfirmed
GUEST, unregistred user!
问题:求函数值。函数y定义如下:
y = a + b - c (当d=2时)
a - b - c (当d=3时)
a 与 b - c (当d=4时)
a 或 b - c (当d=5时)
a 异或 b - c (当d=其它时)
程序填空:
SB START
PUSH 0,GR1
PUSH 0,GR2
LD GR0,A
LD GR1,D
SUB GR1,C2
JMI DXOR
CPA GR1,C4
JPZ DXOR
SLL GR1,1
(!!!填空行!!!)
DXOR EOR GR0,B
BACK SUB GR0,C
POP GR2
POP GR1
RET
DADD ADD GR0,B
JMP BACK
DSUB SUB GR0,B
JMP BACK
DAND AND GR0,B
JMP BACK
DOR OR GR0,B
JMP BACK
A DS 1
B DS 1
C DS 1
D DS 1
C2 DC 2
C4 DC 4
ENTRY JMP DADD
JMP DSUB
JMP DAND
JMP do
R
END
y = a + b - c (当d=2时)
a - b - c (当d=3时)
a 与 b - c (当d=4时)
a 或 b - c (当d=5时)
a 异或 b - c (当d=其它时)
程序填空:
SB START
PUSH 0,GR1
PUSH 0,GR2
LD GR0,A
LD GR1,D
SUB GR1,C2
JMI DXOR
CPA GR1,C4
JPZ DXOR
SLL GR1,1
(!!!填空行!!!)
DXOR EOR GR0,B
BACK SUB GR0,C
POP GR2
POP GR1
RET
DADD ADD GR0,B
JMP BACK
DSUB SUB GR0,B
JMP BACK
DAND AND GR0,B
JMP BACK
DOR OR GR0,B
JMP BACK
A DS 1
B DS 1
C DS 1
D DS 1
C2 DC 2
C4 DC 4
ENTRY JMP DADD
JMP DSUB
JMP DAND
JMP do
R
END