Total members 11890 |It is currently Sun May 12, 2024 8:03 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





multiply two numbers in PIC assembly at specific address ( N and M)
Code:

movwf N
,; "
movf M+1,W,A
mulwf N+1,A ; compute M(H) x N(H)
movff PRODL,PR+2
movff PRODH,PR+3
movf M,W,A ; compute M(L) x N(L)
mulwf N,A
movff PRODL,PR
movff PRODH,PR+1
movf M,W,A
mulwf N+1,A ; compute M(L) xN(H)
movf PRODL,W,A ; add M(L) x N(H) to P(R)
addwf PR+1,F,A ; "
movf PRODH,W,; "
addwfc PR+2,F,A ; "
movlw 0 ; "
addwfc PR+3,F,A ; add carry
movf M+1,W,A
mulwf N,A ; compute M(H) x N(L)
f PRODL WA dd M N t PR
movf PRODL,W,A ; add M(H) x N(L) to PR
addwf PR+1,F,A ; "
movf PRODH,W,; "
addwfc PR+2,F,A ; "
movlw 0 ; "
addwfc PR+3,F,A ; add carry
nop
end




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : multiply two numbers in PIC assembly
 PIC Assembly For Loop Example     -  
 macro usage PIC assembly     -  
 Control Directives usage PIC assembly     -  
 TEMPERATURE AND HEAT CONTROL Assembly     -  
 Elements of Assembly Language Instruction     -  
 MULTIPLEXING Seven SEGMENT DECODER Assembly     -  
 playfair cipher assembly code     -  
 Motor DC Speed Control by switching ON and OFF Assembly     -  
 Object File Directives Usage PIC Assembly     -  
 add two 24-bit numbers (sum two numbers)     -  









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com