Dman95 / SASM

SASM - simple crossplatform IDE for NASM, MASM, GAS and FASM assembly languages

Home Page:http://dman95.github.io/SASM/

Repository from Github https://github.comDman95/SASMRepository from Github https://github.comDman95/SASM

Debug mode / Functions C do not work

darioradu opened this issue · comments

I'm trying to run a basic program that prints a hello world message to the console using the puts function.The program works fine while executing it with "Build and run" option, I mean the message is displayed in the Output.
image

But if i use the "Debug" option, the program runs but the message is not displayed in the output
image

I'm working on Windows 10 64 bits
SASM  version 3.12.2
See the Build tab options configured:
image

It's because output is buffered. You need to call fflush(stdin) to get output immediately like this:

%include "io64.inc"

global main
extern puts
extern fflush
extern get_stdout

section .data
message db "Hello World", 0

section .text
main:
    mov rbp, rsp
    sub rsp, 32
    mov rcx, message
    call puts
    call get_stdout
    mov rcx, rax
    call fflush
    add rsp, 32
    ret