summaryrefslogtreecommitdiff
path: root/Source/Applications
diff options
context:
space:
mode:
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