Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
The code I provided is a subtraction code, but the whole process i am doing is division through subtraction, so i loop and subtract with incrementing a counter until i get a smaller number in dividend than the divisor
My problem is in the subtraction code, when i subtract 0x0005 from 0xFF00 ...
It's stuck because I am doing a division loop, which calls subtract each time, when dividend reaches 0xFF00 and divisor is 0x0005 , the dividend value becomes 0xFFFB, that means the borrow is not handled correctly in the subtraction, here an infinite loop occurs
Hi All, I got the following code to subtract 2-byte numbers in pic 16f877a assembly
"
SUB16 MACRO DST, SRC
MOVF (SRC),W ; Get low byte of subtrahend
SUBWF (DST),F ; Subtract DST(low) - SRC(low)
MOVF (SRC)+1,W ; Now get high byte of...
Guys, I am setting the decimal digit into each variable, then I am trying to write code like follows:
SPECIAL_COMBINE
clrf SPECIAL_COMB_HIGH_BYTE
clrf SPECIAL_COMB_LOW_BYTE
movlw 0x27
movwf TEMP_HIGH_BYTE
movlw 0x10
movwf TEMP_LOW_BYTE
movf DIGIT5, 0
call...
I need to complete a task and task is to implement an assembly code
pic16F877A
I tried the approach you are talking about, but my code wasn't strong enough to be able to achieve my goal, it didn't convert the number in the right way, so i am looking for someone who can write a valid function
it's unsigned,
I defined variable
RESULT RES 2 to reserve 2 bytes
actually I want to read 2 number (2 bytes each), and do calculations over them like addition and division, all of them unsigned
I have an example like :
movlw D'1'
movwf digit1
movlw D'2'
movwf digit2
movlw D'3'
movwf digit3
movlw D'4'
movwf digit4
movlw D'5'
movwf digit5
I want a function that converts these ascii digits to a decimal two bytes number which should be 12345, note that this is only an...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.