add print.* modes
This commit is contained in:
@@ -793,6 +793,38 @@ print:
|
|||||||
pop rax
|
pop rax
|
||||||
pop rdx
|
pop rdx
|
||||||
ret
|
ret
|
||||||
|
.debug:
|
||||||
|
push rsi
|
||||||
|
mov rsi, .debug_msg
|
||||||
|
call print
|
||||||
|
pop rsi
|
||||||
|
call print
|
||||||
|
ret
|
||||||
|
.error:
|
||||||
|
push rsi
|
||||||
|
mov rsi, .error_msg
|
||||||
|
call print
|
||||||
|
pop rsi
|
||||||
|
call print
|
||||||
|
ret
|
||||||
|
.test:
|
||||||
|
push rsi
|
||||||
|
mov rsi, .test_msg
|
||||||
|
call print
|
||||||
|
pop rsi
|
||||||
|
call print
|
||||||
|
ret
|
||||||
|
.warn:
|
||||||
|
push rsi
|
||||||
|
mov rsi, .warn_msg
|
||||||
|
call print
|
||||||
|
pop rsi
|
||||||
|
call print
|
||||||
|
ret
|
||||||
|
.debug_msg db "[DEBUG]: ", 0x00
|
||||||
|
.error_msg db "[ERROR]: ", 0x00
|
||||||
|
.test_msg db "[TEST]: ", 0x00
|
||||||
|
.warn_msg db "[WARN]: ", 0x00
|
||||||
|
|
||||||
; ------------------------------------------------------------------------------
|
; ------------------------------------------------------------------------------
|
||||||
; halt
|
; halt
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
run_tests:
|
run_tests:
|
||||||
mov rsi, .msg
|
mov rsi, .msg
|
||||||
call print
|
call print.test
|
||||||
|
|
||||||
call clear_test_arena
|
call clear_test_arena
|
||||||
call test_copy_byte
|
call test_copy_byte
|
||||||
@@ -55,7 +55,7 @@ run_tests:
|
|||||||
|
|
||||||
test_copy_byte:
|
test_copy_byte:
|
||||||
mov rsi, .msg
|
mov rsi, .msg
|
||||||
call print
|
call print.test
|
||||||
|
|
||||||
mov rdi, test_byte ; byte to be copied
|
mov rdi, test_byte ; byte to be copied
|
||||||
mov rsi, TEST_ARENA_ADDR ; location of test
|
mov rsi, TEST_ARENA_ADDR ; location of test
|
||||||
@@ -88,7 +88,7 @@ test_copy_byte:
|
|||||||
|
|
||||||
test_copy_token:
|
test_copy_token:
|
||||||
mov rsi, .msg
|
mov rsi, .msg
|
||||||
call print
|
call print.test
|
||||||
|
|
||||||
; test case: space terminated
|
; test case: space terminated
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ test_copy_token:
|
|||||||
|
|
||||||
test_elemb:
|
test_elemb:
|
||||||
mov rsi, .msg
|
mov rsi, .msg
|
||||||
call print
|
call print.test
|
||||||
|
|
||||||
; [0]
|
; [0]
|
||||||
mov rdi, 5
|
mov rdi, 5
|
||||||
@@ -204,7 +204,7 @@ test_elemb:
|
|||||||
|
|
||||||
test_identify_token:
|
test_identify_token:
|
||||||
mov rsi, .msg
|
mov rsi, .msg
|
||||||
call print
|
call print.test
|
||||||
|
|
||||||
; length1 token that exists
|
; length1 token that exists
|
||||||
mov byte [TEST_ARENA_ADDR], "*"
|
mov byte [TEST_ARENA_ADDR], "*"
|
||||||
@@ -305,7 +305,7 @@ test_identify_token:
|
|||||||
|
|
||||||
test_identify_next_token:
|
test_identify_next_token:
|
||||||
mov rsi, .msg
|
mov rsi, .msg
|
||||||
call print
|
call print.test
|
||||||
|
|
||||||
; length1 token that exists
|
; length1 token that exists
|
||||||
mov word [TEST_ARENA_ADDR], "* "
|
mov word [TEST_ARENA_ADDR], "* "
|
||||||
@@ -400,7 +400,7 @@ test_identify_next_token:
|
|||||||
|
|
||||||
test_get_tte_type:
|
test_get_tte_type:
|
||||||
mov rsi, .msg
|
mov rsi, .msg
|
||||||
call print
|
call print.test
|
||||||
|
|
||||||
mov di, 0x0053 ; xor
|
mov di, 0x0053 ; xor
|
||||||
call get_tte_type
|
call get_tte_type
|
||||||
@@ -441,7 +441,7 @@ test_get_tte_type:
|
|||||||
|
|
||||||
test_get_tte_typed_metadata:
|
test_get_tte_typed_metadata:
|
||||||
mov rsi, .msg
|
mov rsi, .msg
|
||||||
call print
|
call print.test
|
||||||
|
|
||||||
mov di, 0x0053 ; xor
|
mov di, 0x0053 ; xor
|
||||||
call get_tte_typed_metadata
|
call get_tte_typed_metadata
|
||||||
@@ -483,7 +483,7 @@ test_get_tte_typed_metadata:
|
|||||||
|
|
||||||
test_get_direct_addressing_ModRM:
|
test_get_direct_addressing_ModRM:
|
||||||
mov rsi, .msg
|
mov rsi, .msg
|
||||||
call print
|
call print.test
|
||||||
|
|
||||||
mov di, 0x0000 ; rax
|
mov di, 0x0000 ; rax
|
||||||
mov si, 0x0000 ; rax
|
mov si, 0x0000 ; rax
|
||||||
@@ -528,7 +528,7 @@ test_get_direct_addressing_ModRM:
|
|||||||
|
|
||||||
test_get_opcode:
|
test_get_opcode:
|
||||||
mov rsi, .msg
|
mov rsi, .msg
|
||||||
call print
|
call print.test
|
||||||
|
|
||||||
mov di, 0x0053 ; xor
|
mov di, 0x0053 ; xor
|
||||||
call get_opcode
|
call get_opcode
|
||||||
@@ -569,7 +569,7 @@ test_get_opcode:
|
|||||||
|
|
||||||
test_get_reg_bits:
|
test_get_reg_bits:
|
||||||
mov rsi, .msg
|
mov rsi, .msg
|
||||||
call print
|
call print.test
|
||||||
|
|
||||||
mov di, 0x0000 ; rax
|
mov di, 0x0000 ; rax
|
||||||
call get_reg_bits
|
call get_reg_bits
|
||||||
|
|||||||
Reference in New Issue
Block a user