From 1afc55ca84856cf651ba5e5068fad482dda82745 Mon Sep 17 00:00:00 2001 From: _xeroxz Date: Thu, 19 Aug 2021 18:50:50 -0700 Subject: [PATCH] fixed small bug.. --- include/transform.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/transform.hpp b/include/transform.hpp index 5ada35a..2b5e875 100644 --- a/include/transform.hpp +++ b/include/transform.hpp @@ -157,6 +157,11 @@ namespace vm::transform return _byteswap_ulong( a ); if constexpr ( std::is_same_v< T, std::uint16_t > ) return _byteswap_ushort( a ); + // XCHG AL, AH... the size will be "8 bits" because it only + // looks at the first operand but this is truly a "BSWAP 16"... + // which btw: BSWAP on 16bit registers isnt a thing... + if constexpr ( std::is_same_v< T, std::uint8_t > ) + return _byteswap_ushort( a ); throw std::invalid_argument( "invalid type size..." ); };