Added Float operations to main program
This commit is contained in:
parent
98e70c1898
commit
fb3ab7491c
@ -125,10 +125,8 @@ package body Shardware is
|
||||
Result := Sign * Mantissa * (2.0 ** (Exponent - 127));
|
||||
elsif Exponent = 255 and Mantissa = 0.0 then
|
||||
Result := 1.0 / Zero;
|
||||
elsif Exponent = 0 and (Mantissa > 0.0 or Mantissa < 0.0) then
|
||||
Result := Sign * Mantissa * (2.0 ** (Exponent - 127));
|
||||
elsif Exponent = 0 and Mantissa = 0.0 then
|
||||
Result := 0.0;
|
||||
elsif Exponent = 0 then
|
||||
Result := 1.0 + Sign * Mantissa * (2.0 ** (Exponent - 127));
|
||||
else
|
||||
Result := 0.0 / Zero;
|
||||
end if;
|
||||
|
@ -134,6 +134,15 @@ begin
|
||||
BytesToI(TempBytes(Instruction)));
|
||||
when 11 => AddI(RegisterI(Integer(Instruction (2))), -- Add Register to Register (Int)
|
||||
RegisterI(Integer(Instruction (3))));
|
||||
when 12 => MovF(RegisterF(Integer(Instruction (2))), -- Move Float to Register
|
||||
BytesToF(TempBytes(Instruction)));
|
||||
when 14 => MovF(RegisterF(Integer(Instruction (2))), -- Move Register to Register (Float)
|
||||
RegisterF(Integer(Instruction (3))));
|
||||
when 15 => null; -- TODO: Move Memory to Register (Float)
|
||||
when 16 => AddF(RegisterF(Integer(Instruction (2))), -- Add Float to Register
|
||||
BytesToF(TempBytes(Instruction)));
|
||||
when 17 => AddF(RegisterF(Integer(Instruction (2))), -- Add Register to Register (Float)
|
||||
RegisterF(Integer(Instruction (3))));
|
||||
when 65535 => goto THE_END; -- exit opcode
|
||||
when others => null;
|
||||
end case;
|
||||
|
Loading…
x
Reference in New Issue
Block a user