clear tables
This commit is contained in:
@@ -22,6 +22,8 @@ start:
|
|||||||
|
|
||||||
call run_tests
|
call run_tests
|
||||||
|
|
||||||
|
call clear_token_table
|
||||||
|
|
||||||
jmp halt
|
jmp halt
|
||||||
|
|
||||||
; ------------------------------------------------------------------------------
|
; ------------------------------------------------------------------------------
|
||||||
@@ -178,6 +180,34 @@ elemb:
|
|||||||
.f db "found", 0x0D, 0x0A, 0x00
|
.f db "found", 0x0D, 0x0A, 0x00
|
||||||
.nf db "not found", 0x0D, 0x0A, 0x00
|
.nf db "not found", 0x0D, 0x0A, 0x00
|
||||||
|
|
||||||
|
; ------------------------------------------------------------------------------
|
||||||
|
; clear_token_table
|
||||||
|
;
|
||||||
|
; description:
|
||||||
|
; clears the token table as specified by TOKEN_TABLE_SIZE and TOKEN_TABLE_ADDR
|
||||||
|
; ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
clear_token_table:
|
||||||
|
xor rax, rax ; value to write
|
||||||
|
mov rcx, TOKEN_TABLE_SIZE / 4 ; number of double words
|
||||||
|
mov rdi, TOKEN_TABLE_ADDR ; address to start
|
||||||
|
rep stosd
|
||||||
|
ret
|
||||||
|
|
||||||
|
; ------------------------------------------------------------------------------
|
||||||
|
; clear_test_arena
|
||||||
|
;
|
||||||
|
; description:
|
||||||
|
; clears the test arena as specified by TEST_ARENA_SIZE and TEST_ARENA_ADDR
|
||||||
|
; ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
clear_test_arena:
|
||||||
|
xor rax, rax ; value to write
|
||||||
|
mov rcx, TOKEN_TABLE_SIZE / 4 ; number of double words
|
||||||
|
mov rdi, TOKEN_TABLE_ADDR ; address to start
|
||||||
|
rep stosd
|
||||||
|
ret
|
||||||
|
|
||||||
; ------------------------------------------------------------------------------
|
; ------------------------------------------------------------------------------
|
||||||
; tests
|
; tests
|
||||||
; ------------------------------------------------------------------------------
|
; ------------------------------------------------------------------------------
|
||||||
@@ -193,8 +223,13 @@ run_tests:
|
|||||||
mov rsi, .msg
|
mov rsi, .msg
|
||||||
call print
|
call print
|
||||||
|
|
||||||
|
call clear_test_arena
|
||||||
call test_copy_byte
|
call test_copy_byte
|
||||||
|
|
||||||
|
call clear_test_arena
|
||||||
call test_copy_token
|
call test_copy_token
|
||||||
|
|
||||||
|
call clear_test_arena
|
||||||
call test_elemb
|
call test_elemb
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
|||||||
Reference in New Issue
Block a user