Skip to content

Commit

Permalink
Add support for Sharp PC 1403(H) #951 - implemented sc61860_less_than…
Browse files Browse the repository at this point in the history
…_and_branch_8bit_const
  • Loading branch information
spotlessmind1975 committed Dec 7, 2024
1 parent 421d18b commit 92b87d9
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion ugbc/src/hw/sc61860.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down

0 comments on commit 92b87d9

Please sign in to comment.