Skip to content

Commit 30e3b1e

Browse files
Added support for BIN with 0/1 parameters.
1 parent ae39c9b commit 30e3b1e

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

ugbc/src/hw/8086.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4577,20 +4577,19 @@ void cpu_bits_to_string_vars( Environment * _environment ) {
45774577
variable_import( _environment, "BINTOSTRDIGIT1", VT_BYTE, '1' );
45784578
}
45794579

4580-
void cpu_bits_to_string( Environment * _environment, char * _number, char * _string, char * _string_size, int _bits ) {
4580+
void cpu_bits_to_string( Environment * _environment, char * _number, char * _string, char * _string_size, int _bits, char * _zero, char * _one ) {
45814581

45824582
deploy_with_vars( bitsToString,src_hw_8086_bits_to_string_asm, cpu_bits_to_string_vars );
45834583

45844584
if ( _zero ) {
4585-
outline1("MOV AL, [%s]", zero->realName);
4585+
outline1("MOV AL, [%s]", _zero);
45864586
} else {
45874587
outline0("MOV AL, '0'" );
45884588
}
45894589
outline0("MOV [BINTOSTRDIGIT0], AL" );
45904590

45914591
if ( _one ) {
4592-
Variable * one = variable_retrieve( _environment, _one );
4593-
outline1("MOV AL, [%s]", one->realName);
4592+
outline1("MOV AL, [%s]", _one);
45944593
} else {
45954594
outline0("MOV AL, '1'" );
45964595
}

ugbc/src/hw/8086/bits_to_string.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ BINSTRXZ:
5454
BINSTRL:
5555
SHR AX, 1
5656
ROR BX, 1
57-
JC, BINSTRO1
57+
JC BINSTRO1
5858
JP BINSTRO0
5959
BINSTRO0:
6060
MOV CL, '0'

0 commit comments

Comments
 (0)