Next: example with LEDs, PORTB, rotate, carry:
If you write software, you must exact know what must be done and how a device like RAM, EEPROM, Displays, etc. operates (read the datasheets very carefully, you must understand the device exactly) you really must see through it. Lets start with a little test. Take 8 LEDs and connect them with a resistor (330 ohm) to PORTB of the AT90S1200 (pins 12 to 19), suppose you want to make the LEDs walk back and forth... now you must see what needs to be done to get it working. The program starts by jumping to 'RESET:' (rjmp RESET ;reset handle) , here an example:

The instruction 'ser' sets all 8 bits in register 'reset' (11111111), then put them to the DDRB and PORTB, now you did set all i/o's of PORTB high, means all LEDs off to start with. Now comes the main program, and the sequence is as follows, 1. First LED on, then first LED off after lets say 0.25 seconds, then second LED on for 0.25 seconds, etc. When the last LED goes off reverse the sequence. You can switch the LEDs on and off with clearing or setting bits in de PORTB i/o register, an easier way is to use an instruction like 'ror' (rotate right through carry) or 'rol' (rotate left through carry), by first clearing (clearing because the LEDs go on when a bit in the i/o register become zero) the carry with 'clc' (clear carry), and next start to 'rol' one time, start like this:

Now recall (rcall) a delay (longDelay), so the LED stays on for a while (e.g. 0.25 seconds), after this rotate left (rol) again, and if everything is ok, the second LED will go on. After repeating this 8 times you have the part which walks the LED visually from left to right, if you repeat so many times you can better use a so called 'bitCounter', you simply let the counter do 8 rounds, this saves alot of program lines (flash memory) Here the whole walk-Left part:

As you see now the bitCount is no more 8 times but 7 times, because when you should put the 'clc' (and also bitCount) after the label 'go_Forth', the carry everytime would be cleared, so then the LEDs will stay on, and we don't want that. The rjmp go_Forth causes the loop, the branch (breq) instruction is testing the bitCount for zero, if zero then it jumps to the label 'go_Back'. Click here for the complete 'back and forth flasher' program.
Next: examples with 'sbic' , 'sbis' , 'sbrc' and 'sbrs':
Here an important trick with sbic (skip next instruction if bit in i/o register cleared) and sbis (skip next instruction if bit in i/o register set), suppose you want wait for an i/o become high, do this:
wait:
sbis PIND, input
rjmp wait
The instruction 'rjmp' will be skiped if PIND becomes high. (if input was defined as 6 then it would be bit 6 of PORTD, so PD6) Here an example with these instructions, this commands a LED on and off with a pushbutton. Next another very usefull trick, this is often used for serial data transmissions (bitbanging):
sbrc temp, output
cbi PORTD, output
sbrs temp, output
sbi PORTD, output
This is what happens; suppose output was defined as 7, then if the 7th bit of 'temp' was high (1) it would make 'output' low (0), if not then it would skip the second instruction and passed the thirth (not skipped) and then 'output' would become high. You must watch this trick very good. You can also take the i/o instructions 'sbic' or 'sbis' , then you can directly send a digital signal through 2 i/o's, e.g. MIDI signals. (e.g. you can make a MIDI direction-box, or MIDI bulk unit, simply let check if one of the i/o's is busy, etc.)