no carry: a=0-(hl)-0 a=0-(hl) If there is no carry, it shouldn’t matter. carry: a=0-(hl)-1 a=-1-(hl) This makes a difference 0-0-1 has a carry, but -1-0 doesn’t.
Looks like a duplicate.
Turning replace restart { jp NC,%1 jp %2 %1: } by { jp C,%2 ; common peephole 79 removed jp by using inverse jump logic %1: } if labelRefCountChange(%1 -1) into } by { jp C,%2 ; common peephole 79 removed jp by using inverse jump logic %1: } if operandsNotRelated(%2 '(hl)' '(ix)' '(iy)'), labelRefCountChange(%1 -1) might suffice, yes.
Though for 4.2.0 the .zxn workaround described above should work.
http://sdcc.sourceforge.net/doc/sdccman.pdf is the official manual. It’s probably also included in the downloads. I used an anchored link directly to the chapter, which doesn’t work anyways if you don’t use the builtin PDF viewer of firefox/chrome. edit: It could be that it generates that warning because sdcc.sourceforge.net doesn’t use https, but not sure. edit2: You probably got that warning because I linked a non-https file from a https site (this ticket system). So it might work when you go directly...
http://sdcc.sourceforge.net/doc/sdccman.pdf is the official manual. It’s probably also included in the downloads. I used an anchored link directly to the chapter, which doesn’t work anyways if you don’t use the builtin PDF viewer of firefox/chrome. It could be that it generates that warning because sdcc.sourceforge.net doesn’t use https, but not sure.
http://sdcc.sourceforge.net/doc/sdccman.pdf is the official manual. It’s probably also included in the downloads. I used an anchored link directly to the chapter, which doesn’t work anyways if you don’t use the builtin PDF viewer of firefox/chrome.
This is a know “bug”. Don’t use named labels, they don’t work when they get embedded into structures that gets translated into jumps. You have to use something like: void test( unsigned int count ) { if ( count == 0 ) return; __asm 2$: ret __endasm; } “3.11.4 Use of Labels within Inline Assembler” explicitly says: All labels defined within inline assembler code have to be of the form nnnnn$ where nnnnn is a number less than 100 The compiler internally uses reusable symbols for all jumps. By introducing...