1 / 2

CMPE12c Homework #5 Spring 2003

CMPE12c Homework #5 Spring 2003. 1) (20 pts) Write an HC11 procedure that calculates the factorial of the number stored in accumulator A. It needs to be recursive and the end number needs to be returned in the accumulator D. fact: cmpa #1 blt no_fact psha deca jsr fact pula

gore
Download Presentation

CMPE12c Homework #5 Spring 2003

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CMPE12c Homework #5 Spring 2003 1) (20 pts) Write an HC11 procedure that calculates the factorial of the number stored in accumulator A. It needs to be recursive and the end number needs to be returned in the accumulator D fact: cmpa #1 blt no_fact psha deca jsr fact pula mul rts no_fact: ldd #1 rts Assuming only works to fact(6)=720, and not 16 bits for the result. 2) (10 pts) Write an HC11 code to implement the following “C” type code. Assume that a, b, i, and count are all “words” declared already in the .data section. for (i=0; i<=10; i++) begin if (a < b) a = a + 1; if (a == 3 || b =5) count = count - 1; end ldab #0 loop: ldx a cpx b bge no_add inx stx a no_add: cpx #3 beq yes_sub ldx b cpx #5 beq yes_sub bra no_sub ldx count dex stx count no_sub: incb cmpb #10 ble loop clra std i

  2. 3) (20 pts) Research and list 5 different microcontrollers and their configurations (speed, RAM, EEPROM, IO, ADC, etc) for different manufactures. Motorola, Intel, Zilog, Amtel, TI, NI, Microchip, Rabbit, ect.

More Related