From 7c367f95c9a46983ed1b97e9ea892f233d592cdf Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Sun, 29 Oct 2023 16:55:26 +0000 Subject: Added some examples to instruction-test for positive/negative literals Use the push.* instructions to see this. --- examples/instruction-test.asm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'examples/instruction-test.asm') diff --git a/examples/instruction-test.asm b/examples/instruction-test.asm index dcc0cc2..6a8f172 100644 --- a/examples/instruction-test.asm +++ b/examples/instruction-test.asm @@ -48,3 +48,24 @@ jump.if.byte 1 jump.if.hword 2 jump.if.word 3 + + ;; Testing if overflows work correctly + ;; Format is: + ;; -1 All bits are turned on + ;; UINT_MAX All bits are turned on + ;; INT_MAX All bits but the most significant are on + ;; INT_MIN Only the most significant bit is on + push.byte -1 + push.byte 255 + push.byte 127 + push.byte -128 + + push.hword -1 + push.hword 4294967295 + push.hword 2147483647 + push.hword -2147483648 + + push.word -1 + push.word 18446744073709551615 + push.word 9223372036854775807 + push.word -9223372036854775808 -- cgit v1.2.3-13-gbd6f