Browse Source

Do not compile writing code at all in non-debug build.

Giovanni Mascellani 5 years ago
parent
commit
77c6d1c211
3 changed files with 6 additions and 11 deletions
  1. 1 0
      .travis.yml
  2. 0 8
      lib/io.asm
  3. 5 3
      lib/kernel.asm

+ 1 - 0
.travis.yml

@@ -17,3 +17,4 @@ addons:
 script:
 - make
 - qemu-system-i386 -hda build/boot_asmg.x86 -serial stdio -device isa-debug-exit -display none -m 256M | ./test/decode_tests.py
+- ls -l build/asmg.x86.exe build/asmg_dbg.x86.exe

+ 0 - 8
lib/io.asm

@@ -201,12 +201,4 @@ stdout_setup:
   call serial_setup
   ret
 
-%else
-
-write_console:
-  ret
-
-stdout_setup:
-  ret
-
 %endif

+ 5 - 3
lib/kernel.asm

@@ -34,16 +34,13 @@ str_exit:
   db 'The execution has finished, bye bye...'
   db NEWLINE
   db 0
-%endif
 
 str_panic:
   db 'PANIC!'
 str_newline:
   db NEWLINE
-str_empty:
   db 0
 
-%ifdef DEBUG
 str_hello_asmc:
   db 'Hello, asmc!'
   db NEWLINE
@@ -60,6 +57,7 @@ str_done:
 
 str_platform_panic:
   db 'platform_panic'
+str_empty:
   db 0
 str_platform_allocate:
   db 'platform_allocate'
@@ -99,8 +97,10 @@ entry:
   mov esp, edx
   mov [heap_ptr], edx
 
+%ifdef DEBUG
   ;; Initialize stdout
   call stdout_setup
+%endif
 
 %ifdef DEBUG
   ;; Log
@@ -149,6 +149,7 @@ panic:
   jmp shutdown
 
 
+%ifdef DEBUG
   ;; Input character in CL
   ;; Destroys: EAX, EDX
 write:
@@ -164,6 +165,7 @@ log:
   call write
   inc esi
   jmp log
+%endif
 
 
 platform_allocate: