summaryrefslogtreecommitdiff
path: root/Source/Applications
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-10-18 10:34:11 +0200
committerAlexis211 <alexis211@gmail.com>2009-10-18 10:34:11 +0200
commit22c06556ccbd07f4ef7da39a62d10e03fbee3fe0 (patch)
tree8b45002ef347b625c9134091a7dfad9ed16c5274 /Source/Applications
parent7dc8c19f7d6220c9e3dac43796faf77c4f11974f (diff)
downloadMelon-22c06556ccbd07f4ef7da39a62d10e03fbee3fe0.tar.gz
Melon-22c06556ccbd07f4ef7da39a62d10e03fbee3fe0.zip
Loading binaries now is done through a much more unified interface.
Diffstat (limited to 'Source/Applications')
-rw-r--r--Source/Applications/ASMApps/syscalls.asm11
-rw-r--r--Source/Applications/ASMApps/testbin62 -> 92 bytes
-rw-r--r--Source/Applications/ASMApps/test.asm16
3 files changed, 24 insertions, 3 deletions
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
--- a/Source/Applications/ASMApps/test
+++ b/Source/Applications/ASMApps/test
Binary files 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