fix: Encode constants using little endian

This commit is contained in:
Laborratte 5 2024-07-20 22:47:36 +02:00
parent 920251e99f
commit 780042035c
Signed by: Laborratte5
GPG key ID: 3A30072E35202C02

View file

@ -24,7 +24,7 @@ version1 = P.execPut $ B.putWord8 1
toBinary :: Command -> P.Put toBinary :: Command -> P.Put
toBinary (Const i) = do toBinary (Const i) = do
P.putWord8 0x0001 P.putWord8 0x0001
P.putInt32be ((fromIntegral i)::Int32) P.putInt32le ((fromIntegral i)::Int32)
toBinary Add = P.putWord8 0x0004 toBinary Add = P.putWord8 0x0004
toBinary Sub = P.putWord8 0x0005 toBinary Sub = P.putWord8 0x0005
toBinary Mult = P.putWord8 0x0006 toBinary Mult = P.putWord8 0x0006