Hello world/Standard error is part of Short Circuit's Console Program Basics selection.
A common practice in computing is to send error messages
to a different output stream than normal text console messages.

The normal messages print to what is called "standard output" or "standard out".

The error messages print to "standard error".

This separation can be used to redirect error messages to a different place than normal messages.



Task

Show how to print a message to standard error by printing     Goodbye, World!     on that stream.




.equ STDERR, 2
.equ SVC_WRITE, 64
.equ SVC_EXIT, 93
 
.text
.global _start
 
_start:
	stp x29, x30, [sp, -16]!
	mov x0, #STDERR
	ldr x1, =msg
	mov x2, 15
	mov x8, #SVC_WRITE
	mov x29, sp
	svc #0 // write(stderr, msg, 15);
	ldp x29, x30, [sp], 16
	mov x0, #0
	mov x8, #SVC_EXIT
	svc #0 // exit(0);
 
msg:	.ascii "Goodbye World!\n"