diff --git a/.gitignore b/.gitignore index ab22702..279ccc5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ sillymachine *.sib *.ali *.o +*.exe diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9f4c6d2 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ + +default: sillymachine + +sillymachine: ./src/sillymachine.adb + gnatmake ./src/sillymachine.adb + +sillymachine.exe: ./src/sillymachine.adb + x86_64-w64-mingw32-gnatmake src/sillymachine.adb -lwinmm -lgdi32 + +all: sillymachine sillymachine.exe + +clean: + rm *.o *.ali sillymachine.exe sillymachine diff --git a/src/shardware.adb b/src/shardware.adb index b9ddd24..328bb19 100644 --- a/src/shardware.adb +++ b/src/shardware.adb @@ -19,10 +19,7 @@ package body Shardware is function Bytes_To_I (Instruction : ByteArr) return Integer is begin - return Integer(My_ShiftI(Instruction (7), 24) - + My_ShiftI(Instruction (8), 16) - + My_ShiftI(Instruction (9), 8) - + Integer(Instruction (10))); + return Integer(Bytes_To_U(Instruction)); end Bytes_To_I; function Bytes_To_U (Instruction : ByteArr) return Unsigned_32 is