This preview shows page 1. Sign up to view the full content.
Unformatted text preview: movlw h’2A’ movwf DATA addlw h’06’ movwf TMR0 btfss STATUS, DC addlw -h’06’ incf DATA, f movlw h’30’ andwf DATA, w Q2. (a) Write an assembly program (using direct addressing) that reads a byte (X) from Port B and compares with the data (Y) stored in h’2A’. If X = Y, set RA0 high; If X > Y, replace Y with X in the same location; If X < Y, set RA1 high. Your code should include appropriate directives and initialization of the ports as needed at the beginning o f y o u r p r o g r a m . ( 4 m a r k s ) (b) Rewrite the program using indirect addressing. (2 marks)...
View Full Document
This note was uploaded on 01/20/2011 for the course EE 331 taught by Professor Wahid during the Fall '10 term at University of Saskatchewan- Management Area.
- Fall '10