From 92b87d92411736435882182d0beee0b6e66db627 Mon Sep 17 00:00:00 2001 From: spotlessmind1975 Date: Sat, 7 Dec 2024 20:56:03 +0000 Subject: [PATCH] Add support for Sharp PC 1403(H) #951 - implemented sc61860_less_than_and_branch_8bit_const --- ugbc/src/hw/sc61860.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/ugbc/src/hw/sc61860.c b/ugbc/src/hw/sc61860.c index 4a4ced576..14053da28 100755 --- a/ugbc/src/hw/sc61860.c +++ b/ugbc/src/hw/sc61860.c @@ -1799,7 +1799,43 @@ void sc61860_less_than_and_branch_8bit_const( Environment * _environment, char * if ( _signed ) { - CRITICAL_UNIMPLEMENTED( "sc61860_less_than_and_branch_8bit_const(signed)" ); + char positiveLabel[MAX_TEMPORARY_STORAGE]; + sprintf( positiveLabel, "%spos", label ); + + char doneLabel[MAX_TEMPORARY_STORAGE]; + sprintf( doneLabel, "%sb2", label ); + + op_lda( _environment, _source ); + + op_anda_direct( _environment, 0x80 ); + op_cp_direct( _environment, 0x00 ); + op_jz( _environment, positiveLabel ); + + op_cp_direct( _environment, _destination ); + + if ( _equal ) { + op_jz( _environment, label ); + } + op_jnc( _environment, label ); + + op_jp( _environment, doneLabel ); + + outhead1("%s:", positiveLabel); + + op_cp_direct( _environment, _destination ); + + op_jc( _environment, label ); + if ( _equal ) { + op_jnz( _environment, label ); + } + + op_jp( _environment, doneLabel ); + + outhead1("%s:", label); + + op_jp( _environment, _label ); + + outhead1("%s:", doneLabel); } else {