From 47e691cb0b7a49a797c622b6c79162428358fbe1 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 19 Jun 2018 00:54:43 -0400 Subject: Implement builtin terminal commands * Reboot * Exit * Echo --- builtin_echo.asm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 builtin_echo.asm (limited to 'builtin_echo.asm') diff --git a/builtin_echo.asm b/builtin_echo.asm new file mode 100644 index 0000000..1b4af89 --- /dev/null +++ b/builtin_echo.asm @@ -0,0 +1,20 @@ +%ifndef _BUILTIN_ECHO_ASM +%define _BUILTIN_ECHO_ASM + +builtin_echo: + push bp + mov bp, sp + + mov bx, word [bp + 4] + add bx, 2 + push word [bx] + push .msg_fmt + call printf + add sp, 2 * 2 + + mov sp, bp + pop bp + ret + .msg_fmt db '%s\n', 0 + +%endif -- cgit