diff options
Diffstat (limited to 'Source/Applications')
-rw-r--r-- | Source/Applications/ASMApps/Makefile | 20 | ||||
-rw-r--r-- | Source/Applications/ASMApps/syscalls.asm | 7 | ||||
-rw-r--r-- | Source/Applications/ASMApps/test | bin | 0 -> 62 bytes | |||
-rw-r--r-- | Source/Applications/ASMApps/test.asm | 20 |
4 files changed, 47 insertions, 0 deletions
diff --git a/Source/Applications/ASMApps/Makefile b/Source/Applications/ASMApps/Makefile new file mode 100644 index 0000000..8cc8bfd --- /dev/null +++ b/Source/Applications/ASMApps/Makefile @@ -0,0 +1,20 @@ +.PHONY: clean, mrproper + +ASM = nasm + +Applications = test + +all: $(Applications) + echo "* Done with ASM applications : $(Applications)" + +rebuild: mrproper all + +%: %.asm + echo "* Compiling $<..." + $(ASM) -o $@ $< + +clean: + echo "* Removing files..." + rm -rf $(Applications) + +mrproper: clean diff --git a/Source/Applications/ASMApps/syscalls.asm b/Source/Applications/ASMApps/syscalls.asm new file mode 100644 index 0000000..cdd5cc6 --- /dev/null +++ b/Source/Applications/ASMApps/syscalls.asm @@ -0,0 +1,7 @@ +[bits 32] + +dd 0xFEEDBEEF ; magic number ^^ +dd end - start + +%define SC_PUTCH 0xFFFFFF01 +%define SC_SLEEP 0xFFFFFF02 diff --git a/Source/Applications/ASMApps/test b/Source/Applications/ASMApps/test Binary files differnew file mode 100644 index 0000000..397abf1 --- /dev/null +++ b/Source/Applications/ASMApps/test diff --git a/Source/Applications/ASMApps/test.asm b/Source/Applications/ASMApps/test.asm new file mode 100644 index 0000000..80965b4 --- /dev/null +++ b/Source/Applications/ASMApps/test.asm @@ -0,0 +1,20 @@ +%include "syscalls.asm" + +start: + mov ecx, ' ' + loop: + inc ecx + mov eax, SC_PUTCH ;temporarily defined for writing one char to screen + mov ebx, ecx + int 64 + mov eax, SC_SLEEP ;temporary syscall for sleeping + mov ebx, 30 ;20ms + int 64 + cmp ecx, 127 + jnz loop + mov eax, 0 + mov eax, SC_PUTCH + mov ebx, 10 ;newline + int 64 + int 66 ;finish task +end: |