remove superfluous wrapper function
This commit is contained in:
@@ -390,7 +390,8 @@ assemble:
|
|||||||
mov cx, di
|
mov cx, di
|
||||||
mov di, [.first_argument]
|
mov di, [.first_argument]
|
||||||
mov si, cx
|
mov si, cx
|
||||||
call get_direct_addressing_ModRM
|
mov dl, 11b
|
||||||
|
call get_ModRM
|
||||||
; al = ModR/M byte
|
; al = ModR/M byte
|
||||||
push rax
|
push rax
|
||||||
mov al, [.pending_operator_opcode]
|
mov al, [.pending_operator_opcode]
|
||||||
@@ -546,26 +547,6 @@ get_tte_typed_metadata:
|
|||||||
and rax, 0xFF
|
and rax, 0xFF
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; ------------------------------------------------------------------------------
|
|
||||||
; get_direct_addressing_ModRM
|
|
||||||
;
|
|
||||||
; description:
|
|
||||||
; given 2 register tokens, returns the ModR/M byte in direct addressing
|
|
||||||
; (mod = 11b) mode
|
|
||||||
;
|
|
||||||
; parameters:
|
|
||||||
; di = token table entry `reg`
|
|
||||||
; si = token table entry `R/M`
|
|
||||||
;
|
|
||||||
; returned:
|
|
||||||
; al = ModR/M byte; the rest of rax is zeroed
|
|
||||||
; ------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
get_direct_addressing_ModRM:
|
|
||||||
mov dl, 11b
|
|
||||||
call get_ModRM
|
|
||||||
ret
|
|
||||||
|
|
||||||
; ------------------------------------------------------------------------------
|
; ------------------------------------------------------------------------------
|
||||||
; get_ModRM
|
; get_ModRM
|
||||||
;
|
;
|
||||||
@@ -1449,7 +1430,7 @@ elemb:
|
|||||||
; djb2
|
; djb2
|
||||||
;
|
;
|
||||||
; description:
|
; description:
|
||||||
; gets the djb2 hash of a given string
|
; gets the 64-bit djb2 hash of a given string
|
||||||
;
|
;
|
||||||
; parameters:
|
; parameters:
|
||||||
; rdi = size of string
|
; rdi = size of string
|
||||||
|
|||||||
@@ -25,9 +25,6 @@ run_tests:
|
|||||||
call clear_test_arena
|
call clear_test_arena
|
||||||
call test_get_tte_typed_metadata
|
call test_get_tte_typed_metadata
|
||||||
|
|
||||||
call clear_test_arena
|
|
||||||
call test_get_direct_addressing_ModRM
|
|
||||||
|
|
||||||
call clear_test_arena
|
call clear_test_arena
|
||||||
call test_get_opcode
|
call test_get_opcode
|
||||||
|
|
||||||
@@ -257,51 +254,6 @@ test_get_tte_typed_metadata:
|
|||||||
ret
|
ret
|
||||||
.msg db "test_get_tte_typed_metadata...", 0x00
|
.msg db "test_get_tte_typed_metadata...", 0x00
|
||||||
|
|
||||||
; ------------------------------------------------------------------------------
|
|
||||||
; test_get_direct_addressing_ModRM
|
|
||||||
;
|
|
||||||
; description:
|
|
||||||
; tests get_direct_addressing_ModRM described functionality
|
|
||||||
; ------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
test_get_direct_addressing_ModRM:
|
|
||||||
mov rsi, .msg
|
|
||||||
call print.test
|
|
||||||
|
|
||||||
mov di, 0x0000 ; rax
|
|
||||||
mov si, 0x0000 ; rax
|
|
||||||
call get_direct_addressing_ModRM
|
|
||||||
cmp al, 11000000b ; Mod Reg R/M: 11b 000b 000b
|
|
||||||
jne .fail
|
|
||||||
|
|
||||||
mov di, 0x0000 ; rax
|
|
||||||
mov si, 0x0003 ; rdx
|
|
||||||
call get_direct_addressing_ModRM
|
|
||||||
cmp al, 11000010b ; Mod Reg R/M: 11b 000b 010b
|
|
||||||
jne .fail
|
|
||||||
|
|
||||||
mov di, 0x0003 ; rdx
|
|
||||||
mov si, 0x0000 ; rax
|
|
||||||
call get_direct_addressing_ModRM
|
|
||||||
cmp al, 11010000b ; Mod Reg R/M: 11b 010b 000b
|
|
||||||
jne .fail
|
|
||||||
|
|
||||||
mov di, 0x0003 ; rdx
|
|
||||||
mov si, 0x0003 ; rdx
|
|
||||||
call get_direct_addressing_ModRM
|
|
||||||
cmp al, 11010010b ; Mod Reg R/M 11b 010b 010b
|
|
||||||
jne .fail
|
|
||||||
|
|
||||||
.pass:
|
|
||||||
mov rsi, msg_pass
|
|
||||||
call print
|
|
||||||
ret
|
|
||||||
.fail:
|
|
||||||
mov rsi, msg_fail
|
|
||||||
call print
|
|
||||||
ret
|
|
||||||
.msg db "test_get_direct_addressing_ModRM...", 0x00
|
|
||||||
|
|
||||||
; ------------------------------------------------------------------------------
|
; ------------------------------------------------------------------------------
|
||||||
; test_get_opcode
|
; test_get_opcode
|
||||||
;
|
;
|
||||||
|
|||||||
Reference in New Issue
Block a user