Question: Question 1 Program Memory Machine LINE SOURCE Address Code 00022 CBLOCK 0x000 00023 u_arg 00024 u_res 00025 v_arg 00026 v_res 00027 g_arg 00028 g_res 00029

Question 1

Program Memory Machine LINE SOURCE Address Code 00022 CBLOCK 0x000 00023 u_arg 00024 u_res 00025 v_arg 00026 v_res 00027 g_arg 00028 g_res 00029 fcomb_arg 00030 fcomb_res 00031 endc 00032 00033 org 0x000000 000000 EF?? F??? 00034 goto Main 00035 org 0x000036 000036 0E4F 00036 Main: movlw d'79' 000038 6E06 00037 movwf fcomb_arg, A 00003A D??? 00038 rcall fcomb 00003C D??? 00039 Over: bra Over 00040 00003E 6A01 00041 u: clrf u_res, A 000040 C000 F000 00042 movff u_arg, g_arg

000044 D??? 00043 rcall g 000046 C005 FFE8 00044 movff g_res, WREG 00004A 0F18 00045 addlw 0x18 00004C 6E01 00046 movwf u_res 00004E 0012 00047 return 00048 000050 6A05 00049 g: clrf g_res, A 000052 5004 00050 movf g_arg, W, A 000054 0F05 00051 addlw 0x05 000056 6E05 00052 movwf g_res, A 000058 0012 00053 return 00054 00055 org 0x000100 000100 0EEF 00056 v: movlw 0xEF 000102 6002 00057 cpfslt v_arg, A 000104 EF?? F??? 00058 goto SetFF 000108 0E10 00059 movlw 0x10 00010A 6E03 00060 movwf v_res, A 00010C 5002 00061 movf v_arg, W, A 00010E 2603 00062 addwf v_res, F, A 000110 D002 00063 bra Exit 000112 0EFF 00064 SetFF: movlw 0xFF 000114 6E03 00065 movwf v_res, A 000116 0012 00066 Exit: return 00067 000118 C006 F002 00068 fcomb: movff fcomb_arg, v_arg 00011C EC?? F??? 00069 call v 000120 C003 F000 00070 movff v_res, u_arg 000124 EC?? F??? 00071 call u 000128 C001 F007 00072 movff u_res, fcomb_res 00012C 0012 00073 return 00074 END What is the machine code for line 34,38, 39, 43, 58,69?

Line 34

Line 38

Line 39

Line 43

Line 58

Line 69

Question 2

Line

Number

14 cblock 0x20

15 MyReg1

16 MyReg2

17 endc

18

19 ORG 0x000000

20 Main: clrf MyReg1, A

21 clrf MyReg2, A

22

23 lfsr 0, 0x020

24

25 movlw 0x78

26 movwf POSTINC0

27

28 movlw 0xFF

29 movwf POSTDEC0

30

31 movlw 0x99

32 movwf PREINC0

33

34 end

Identify the contents of the file registers FSR0, 0x020, 0x021:

after Line 26 has been executed

FSRO =

0x020 =

0x21 =

after Line 29 has been executed:

FSRO =

0x020 =

0x21 =

after Line 32 has been executed:

FSRO =

0x020 =

0x21 =

Question 3

13 MyReg Eq 0x40

14 Org 0x0000

15 Main: movlb 0x5

16 clrf MyReg, A

17 clrf MyReg, BANKED

18 movlb 0x0

19 clrf MyReg, A

20 clrf MyReg, BANKED

21 movlb 0x7

22 clrf MyReg, A

23 clrf MyReg, BANKED

end

Line 17 clears the content of a file register in the data memory. Please identify the full addressof the file register

Line 18 clears the content of a file register in the data memory. Please identify the full addressof the file register.

Line 20 clears the content of a file register in the data memory. Please identify the full address of the file register.

Line 23 clears the content of a file register in the data memory. Please identify the full address of the file register.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!