Test your knowledge by trying to solve the problems listed below. If you can make it to the end then you are an expert level assembler programmer for the PIC12F508.
Write a program that turns an LED connected to GP0 on when a switch connected to GP4 is pressed, and off when the switch is released.View Solution >>
Write a program that flashes an LED connected to GP0 while a switch connected to GP4 is pressed. When the switch is released the LED is turned off.View Solution >>
Write a program that flashes an LED connected to GP0 a fixed number of times (for example 3) each time a switch connected to GP4 is pressed. Once the flashes have been performed the program should wait for the switch to be released and pressed again.View Solution >>
Write a program that implements the three main conditional tests (==, <, >) between a value in a test register (test_value) and a constant. To indicate the results of the tests, setup three LEDs that light up if each test condition is true.View Solution >>
Write a sub-routine that multiplies the values stored in two registers arg_a and arg_b, and stores the result into a 16-bit register pair called result_h and result_l.View Solution >>
Write a program that implements a simple stack library. The program should have two sub routines called StackPush and StackPop. StackPush takes the value in a register called arg and stores it onto the stack. If successful it returns 1 in the Working Register otherwise 0 to indicate that the stack is full. StackPop takes a value off the stack and copies it into arg. If successful it returns 1 in the Working Register otherwise 0 to indicate that the stack is empty.View Solution >>
Write a program that implements an 8-bit linear feedback shift register for generating psuedo random numbers. The resulting program should have a display register that cycles through the generated number sequence.View Solution >>
Write a sub-routine that returns (in the Working Register) the square of a number between 0 and 15. The value to square should also be passed to the sub-routine using the Working Register. Your solution should require only 18 lines of code or less.View Solution >>