From 2ffa57c9c4fb18a615c96d24a0b02209c877603d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Szostak?= Date: Fri, 26 Apr 2024 18:41:51 +0200 Subject: [PATCH] Added a Makefile --- .gitignore | 1 + Makefile | 13 +++++++++++++ src/shardware.adb | 5 +---- 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 Makefile 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