@ARISTOS, please elaborate on what you need, and what you have tried. The question leaves a lot of details out that we will need in order to answer it, starting with, what code have you already seen that works for rebooting, but not shutting down? It is unusual for a code example or tutorial to cover one but not the other, without at least a link to a parallel one for the other problem. Also, the answers would require details about the platform; since you mentioned NASM, we can probably assume x86 protected mode, but if you are in either real mode or long mode, the answers will be different.
LtG wrote:
onlyonemac wrote:
Maybe you should first figure out why it is rebooting the computer? Are you just triggering a protection fault and letting the system reset itself?
I took it the OP isn't interested how to reboot, and thus made the distinction.
I think that you missed OnlyOneMac's point, though I am not sure that OOM understood the OP's point either.
Onlyonemac seems to be reading this as 'the code I wrote to shut the system off is causing it to reboot instead', and concluded that the code in question is causing a segfault, making it look as if it were running 'correctly' but doing the wrong thing (that is, that the information the OP had was given as being for shutting down but was actually the code for a soft reboot) when in fact it is buggy.
However, that seems to assume facts not in evidence. The OP never stated that the code in use is rebooting the OS, or mentioned any existing code at all. There just isn't enough information in the original post, period.
So, I repeat:
@ARISTOS, please elaborate on what you need, and what you have tried.