Put debug code behind DEBUG define

This commit is contained in:
Juhani Krekelä 2022-02-24 21:19:02 +02:00
parent b000857bb4
commit 0661eb0f06
1 changed files with 29 additions and 25 deletions

View File

@ -19,7 +19,7 @@ select_target:
mov bp, rng_output
call store32
; Multiply rng output by number of targer words
; Multiply rng output by number of target words
xor si, si
xor dx, dx
xor ax, ax
@ -31,8 +31,10 @@ select_target:
loop .multiply_loop
mov ax, si
%ifdef DEBUG
call hexprint16
call newline
%endif
load_target:
shl si, 1
@ -657,37 +659,39 @@ add32:
adc dx, [addr32 + 2]
ret
hexprint32:
xchg ax, dx
call hexprint16
xchg ax, dx
hexprint16:
xchg ah, al
call hexprint8
xchg ah, al
hexprint8:
%ifdef DEBUG
hexprint32:
xchg ax, dx
call hexprint16
xchg ax, dx
hexprint16:
xchg ah, al
call hexprint8
xchg ah, al
hexprint8:
%rep 4
rol al, 1
rol al, 1
%endrep
call hexprint4
call hexprint4
%rep 4
rol al, 1
rol al, 1
%endrep
hexprint4:
push ax
and al, 0xf
cmp al, 10
jb .digit09
hexprint4:
push ax
and al, 0xf
cmp al, 10
jb .digit09
add al, 'a' - 10 - '0'
add al, 'a' - 10 - '0'
.digit09:
add al, '0'
mov ah, 0xe
int 0x10
.digit09:
add al, '0'
mov ah, 0xe
int 0x10
pop ax
ret
pop ax
ret
%endif
section .data
target times 5 db 0