From 22c06556ccbd07f4ef7da39a62d10e03fbee3fe0 Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Sun, 18 Oct 2009 10:34:11 +0200 Subject: Loading binaries now is done through a much more unified interface. --- Source/Applications/ASMApps/syscalls.asm | 11 +++++++++++ Source/Applications/ASMApps/test | Bin 62 -> 92 bytes Source/Applications/ASMApps/test.asm | 16 +++++++++++++--- 3 files changed, 24 insertions(+), 3 deletions(-) (limited to 'Source/Applications') diff --git a/Source/Applications/ASMApps/syscalls.asm b/Source/Applications/ASMApps/syscalls.asm index cdd5cc6..1a634d7 100644 --- a/Source/Applications/ASMApps/syscalls.asm +++ b/Source/Applications/ASMApps/syscalls.asm @@ -1,7 +1,18 @@ [bits 32] +%ifidn __OUTPUT_FORMAT__, bin + +%define MEM_ORIGIN 0x10000000 + dd 0xFEEDBEEF ; magic number ^^ dd end - start +dd MEM_ORIGIN + +; the ($-$$) permits not taking into account the header above +[org MEM_ORIGIN - ($-$$)] + +%endif %define SC_PUTCH 0xFFFFFF01 %define SC_SLEEP 0xFFFFFF02 +%define SC_WHEX 0xFFFFFF03 diff --git a/Source/Applications/ASMApps/test b/Source/Applications/ASMApps/test index 397abf1..781a4b6 100644 Binary files a/Source/Applications/ASMApps/test and b/Source/Applications/ASMApps/test differ diff --git a/Source/Applications/ASMApps/test.asm b/Source/Applications/ASMApps/test.asm index 80965b4..a79d4a3 100644 --- a/Source/Applications/ASMApps/test.asm +++ b/Source/Applications/ASMApps/test.asm @@ -1,7 +1,13 @@ %include "syscalls.asm" -start: - mov ecx, ' ' +start: ; label used for calculating app size + mov ecx, [data] + mov ebx, ecx + mov eax, SC_WHEX + int 64 + mov eax, SC_PUTCH + mov ebx, 10 + int 64 loop: inc ecx mov eax, SC_PUTCH ;temporarily defined for writing one char to screen @@ -17,4 +23,8 @@ start: mov ebx, 10 ;newline int 64 int 66 ;finish task -end: + +data: +dd 0x00000020 + +end: ; label used for calculating app size -- cgit v1.2.3