Hi,
I have my exam on Tuesday and there is one question in the exam that I am really unsure about. The trouble is I cant learn the model way to answer the question, because im not even really able to answer it yet. Attached is the exact question.
So, im guessing the way to answer the first question is to do something like this:
================================
check_value equ 0x20
movlw .43
movwf check_value
<how do I get portb value into working?>
subwf check_value,w
btfsc STATUS, C ; If c bit is set, then there is a carry, then it wont be skipped
goto grtr_than
================================
Can someone please help me finished this question off. I dont know how to check a binary value on portB.
================================
================================
b) I literally have no idea about this question but here is my stab at it.
1) I's nibbles are swapped, and the result is stored in F. Therefore f is the file which is changed as the result. Its original value was A (.10) which is 0000 1010, and its binary value will now be 1010 0000.
2) The working register is affected. i is still 10, so it is 3+10, and the result 13 is stored in w (0000 1101).
3) 13 is still in the working register, so k is given the value (0000 1101)
Is this the kind of thing I should be doing?
================================
================================
Im stressing out about these, especially part one, any any help or advice would be much appreciated.
James
I have my exam on Tuesday and there is one question in the exam that I am really unsure about. The trouble is I cant learn the model way to answer the question, because im not even really able to answer it yet. Attached is the exact question.
So, im guessing the way to answer the first question is to do something like this:
================================
check_value equ 0x20
movlw .43
movwf check_value
<how do I get portb value into working?>
subwf check_value,w
btfsc STATUS, C ; If c bit is set, then there is a carry, then it wont be skipped
goto grtr_than
================================
Can someone please help me finished this question off. I dont know how to check a binary value on portB.
================================
================================
b) I literally have no idea about this question but here is my stab at it.
1) I's nibbles are swapped, and the result is stored in F. Therefore f is the file which is changed as the result. Its original value was A (.10) which is 0000 1010, and its binary value will now be 1010 0000.
2) The working register is affected. i is still 10, so it is 3+10, and the result 13 is stored in w (0000 1101).
3) 13 is still in the working register, so k is given the value (0000 1101)
Is this the kind of thing I should be doing?
================================
================================
Im stressing out about these, especially part one, any any help or advice would be much appreciated.
James
Last edited: