I'm using the SASM IDE using NASM as my assembler to produce a 32-bit program. How can I know the number of bytes (first parameter) I need for a given input when using the PRINT_DEC
macro? let's say I need to print 6518846, how many bytes do I need to declare for the size? I think this is why my program prints out the wrong data, it is out of range.
Once I exceed some numbers, it starts giving negative outputs.
the code below prints out "32767" perfectly. but if I changed it to 32768 or higher, the output changes into a negative one.
%include "io.inc"
section .text
global CMAIN
CMAIN:
PRINT_DEC 1, 32767
xor eax, eax
ret