Ultra Job

Páginas: 2 (306 palabras) Publicado: 9 de octubre de 2011
0000000000000110

Undeclared Data Label: a
Illegal Opcode: Multiply
Number is too large
Illegal opcode: Addy
.End expected
Label must end with :
IllegalOpcode: y
Undeclared Data Label: subtract

Select the smaller number.

Undeclared Data Label: a

.begin
in first
in second
load first
compare second
jumpgtoutsecond
out first
jump done
outsecond: out second
done: halt
first: .data 0
second: .data 0
.end

The program counts from the biggest number to zero Yes

.beginin counter
while: load counter
compare Zero
jumpgt done
compare zero
jumpeq done
out counter
decrement counter
jump while
done: halt
counter: .data 0
zero:.data 0
.end

.begin
in x
in y
in c
load d
compare c
jumpeq loop
compare x
jumplt outt
out y
jump done
loop: store c
store d
compare x
jumpgt outx
outy
jump done
outx: out x
jump done
outt: out x
jump done
done: halt
halt
x: .data 0
y: .data 0
d: .data 1
c: .data 0
.end

.begin
in x
load x
loop:subtract y
store d
load d
compare c
jumpeq done
compare a
jumpeq done1
jump loop
done: out c
jump done2
done1: out a
jump done3
done2: halt
done3: halt
haltx: .data 0
y: .data 2
c: .data 0
a: .data 1
d: .data 0
.end

.begin
in x
in y
load x
load y
compare a
jumpeq done1
load x
compare z
jumpeq done2
loady
compare z
jumpeq done3
load x
add x
store w
load y
subtract z
store d
loop: load d
subtract z
store d
compare a
jumpeq outw
load w
add x
store w
jumploop
outw: out w
halt
done1: out a
halt
done2: out y
halt
done3: out x
halt
x: .data 0
y: .data 0
z: .data 1
d: .data 0
a: .data 0
w: .data 0
.end
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • ultra
  • ultra
  • ultra
  • Joba Joba
  • el joben
  • Mis job
  • Job
  • Ultra Vnc

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS