flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > MenuetOS > To print on terminal

Author
Thread Post new topic Reply to topic
C.H.R



Joined: 28 Jul 2017
Posts: 3
Location: Colombia
To print on terminal
Hello

Actually I try to make a little dbg on MeOS, (im begginner) at first, I wanna to start a process from terminal. Ez task, but I want to print a number on terminal (processID), after to print buffer or string.


Code:

buffer:
    db "Process launched succesfully"10,13
    db "PID: ",0
buffer_end:

....
code
....

mov rax256           ; syscall to start process
mov rbxfilename
mov rcx0
syscall

cmp rax0
jnz   errr
mov [debugee_pid], rbx

mov rdxbuffer
mov r8,  buffer_end - buffer
call send_line_to_terminal





How to match the buffer and pid. I dont know how to do.
To convert pid to ascii? How to do it ?

Someone that can help me.

Where to search more info about debuggers ?

thanks in advance...Sorry my bad english.
Post 07 Dec 2017, 10:10
View user's profile Send private message Send e-mail Reply with quote
Ville



Joined: 17 Jun 2003
Posts: 202
You need to convert the number one character at a time into a string and then send it to terminal. Just devide the number by ten, add ascii base ( 48 ) to the remainder in dl (rdx), write dl into a position in string, and repeat until there is no integer part left in rax. Then send the string to the terminal. See the DIV instruction.
Post 12 Dec 2017, 17:25
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.