Execute SNUSP/Ada: Difference between revisions
m
Fixed syntax highlighting.
Thundergnat (talk | contribs) m (Further edita) |
m (Fixed syntax highlighting.) |
||
Line 8:
memory.ads:
<
generic
type Byte is mod <>;
Line 41:
procedure Finalize (Storage : in out Memory);
end Memory;</
memory.adb:
<
with Ada.Unchecked_Deallocation;
package body Memory is
Line 115:
end Finalize;
end Memory;</
Next is a Machine for interpreting SNUSP code.
snusp.ads:
<
with Ada.Strings.Fixed;
with Ada.Text_IO;
Line 153:
end record;
end SNUSP;</
snusp.adb:
<
procedure Move_IP (IP : in out Code_Pointer) is
Line 287:
end Run;
end SNUSP;</
Sample usage:
main.adb:
<
with SNUSP;
procedure Main is
Line 310:
SNUSP.Run (My_SNUSP_Machine, Test_Code);
end Main;</
Output:
|