Execute SNUSP/Ada: Difference between revisions
m
Fixed syntax highlighting.
m (add Ada category) |
m (Fixed syntax highlighting.) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1:
<span style='font-family: "Linux Libertine",Georgia,Times,serif;font-size:150%;'>[[Ada]]</span><hr>
{{works with|Ada 2005}}
Line 7 ⟶ 8:
memory.ads:
<
generic
type Byte is mod <>;
Line 40 ⟶ 41:
procedure Finalize (Storage : in out Memory);
end Memory;</
memory.adb:
<
with Ada.Unchecked_Deallocation;
package body Memory is
Line 114 ⟶ 115:
end Finalize;
end Memory;</
Next is a Machine for interpreting SNUSP code.
snusp.ads:
<
with Ada.Strings.Fixed;
with Ada.Text_IO;
Line 152 ⟶ 153:
end record;
end SNUSP;</
snusp.adb:
<
procedure Move_IP (IP : in out Code_Pointer) is
Line 286 ⟶ 287:
end Run;
end SNUSP;</
Sample usage:
main.adb:
<
with SNUSP;
procedure Main is
Line 309 ⟶ 310:
SNUSP.Run (My_SNUSP_Machine, Test_Code);
end Main;</
Output:
<pre>Goodbye, World!</pre>
|