Clearly you are running an operating system, so why not try it yourself?
Processors only know how to run their instruction set and there are countless programming languages you can use to generate those instructions, including assembly language.
so.c
int fun ( int );
int main ( void )
{
return(fun(5));
}
fun.c
int fun ( int x )
{
return(x+3);
}
./so.elf ; echo $?
8
so
objdump -d fun.o
fun.o: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 <fun>:
0: 8d 47 03 lea 0x3(%rdi),%eax
3: c3 retq
So now let's use assembly language:
.globl fun
fun:
lea 0x7(%rdi),%eax
retq
./so.elf; echo $?
12
But now let us move it up a level:
int main ( int argc, char *argv[] )
{
return(argc+7);
}
0000000000001040 <main>:
1040: 8d 47 07 lea 0x7(%rdi),%eax
1043: c3 retq
Switching architectures, because I feel like it...
.globl _start
_start:
adds r0,#4
bx lr
and I get a seg fault (same with x86 doing a retq). As pointed out in the comments some will let you just return but you probably have to make an exit system call. Note I did not crash the operating system. I just crashed that program.
.globl _start
_start:
adds r0,#4
mov r7,#1
swi #0
./fun.elf; echo $?
4
Assembly language is not the real problem but getting the program into the OS and running it. And how you do that normally is creating a binary file that is a file format supported by the operating system (including various linker specific things as to memory space, entry point, etc). Otherwise you have to try to hack the operating system to shove it into memory and then convincing the operating system to run that code.
You could create or choose an operating system for your 8085 that allows a simple return as a way to exit a program, or modify the operating system to allow that, then you can just perform a return from subroutine/function call and it is just a few pure instructions with no system calls.
There is no magic to assembly language, just more freedom. The processor can only run its instructions, it does not know how to run C language or C++, or rust, or python, etc. Just its own instructions. And assembly language is just one programming language you can use. Most of the problem is not the program but the file format, the operating systems rules, and how to exit cleanly.