<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="https://wiki.nicksoft.com/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://wiki.nicksoft.com/feed.php">
        <title>NS Doc mcu:pic16</title>
        <description></description>
        <link>https://wiki.nicksoft.com/</link>
        <image rdf:resource="https://wiki.nicksoft.com/lib/images/favicon.ico" />
       <dc:date>2026-05-07T18:09:12+03:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://wiki.nicksoft.com/mcu:pic16:32bit-add"/>
                <rdf:li rdf:resource="https://wiki.nicksoft.com/mcu:pic16:32bit-math"/>
                <rdf:li rdf:resource="https://wiki.nicksoft.com/mcu:pic16:char2num"/>
                <rdf:li rdf:resource="https://wiki.nicksoft.com/mcu:pic16:num2hex"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://wiki.nicksoft.com/lib/images/favicon.ico">
        <title>NS Doc</title>
        <link>https://wiki.nicksoft.com/</link>
        <url>https://wiki.nicksoft.com/lib/images/favicon.ico</url>
    </image>
    <item rdf:about="https://wiki.nicksoft.com/mcu:pic16:32bit-add">
        <dc:format>text/html</dc:format>
        <dc:date>2010-03-30T15:32:24+03:00</dc:date>
        <title>32bit binary addition</title>
        <link>https://wiki.nicksoft.com/mcu:pic16:32bit-add</link>
        <description>movf    twofour0,w
        addwf   prod0,f

        movf    twofour1,w
        btfsc   STATUS,c
         incfsz twofour1,w
          addwf prod1,f

        movf    twofour2,w
        btfsc   STATUS,c
         incfsz twofour2,w
          addwf prod2,f

        movf    twofour3,w
        btfsc   STATUS,c
         incfsz twofour3,w
          addwf prod3,f</description>
    </item>
    <item rdf:about="https://wiki.nicksoft.com/mcu:pic16:32bit-math">
        <dc:format>text/html</dc:format>
        <dc:date>2010-03-30T16:02:29+03:00</dc:date>
        <title>32 bit signed math adapted from microchip AN</title>
        <link>https://wiki.nicksoft.com/mcu:pic16:32bit-math</link>
        <description>Note - Zero and Carry flags are not set!


;******************************************************************************
;
; Filename:   QUAD_MATH_TESTS.ASM
; Function:   Math routines using PIC16F87
; Created:    29-Jul-2009
; Author:     Brian Beard
; Company:    Lucid Technologies
;
;******************************************************************************
;
	list      p=16F87           ;list directive to define processor
	#include &lt;p16F87.inc&gt;       ;processor specific variable defini…</description>
    </item>
    <item rdf:about="https://wiki.nicksoft.com/mcu:pic16:char2num">
        <dc:format>text/html</dc:format>
        <dc:date>2010-03-28T23:27:12+03:00</dc:date>
        <title>char2num - Convert 1 character hex code to number</title>
        <link>https://wiki.nicksoft.com/mcu:pic16:char2num</link>
        <description>char2num
	local	noLowerCase
	local	convError
	local	digit

	movwf	temp

	sublw	'F'
	skipneg
	goto noLowerCase
	
	movlw	'a'-'A'
	subwf	temp, f
	movlw	temp

noLowerCase
	;test if the symbol i sless than '0': if sym - '0' &gt;= 0 -&gt; ok
	movlw	'0'
	subwf	temp, w	; temp - w
	skippz
	goto	convError

	; test if sym &gt; 'F': if sym-'F'+1 &gt;=0 -&gt; error
	movlw	'F'+1
	subwf	temp, w
	skipneg
	goto	convError

	movlw	'A'
	subwf	temp, w
	skippz
	goto	digit
	addlw	0x0A
	return
	
digit
	movlw	'0'
	subwf	temp, w
	retur…</description>
    </item>
    <item rdf:about="https://wiki.nicksoft.com/mcu:pic16:num2hex">
        <dc:format>text/html</dc:format>
        <dc:date>2010-03-30T15:31:38+03:00</dc:date>
        <title>num2hex - convert byte to 2 hexadecimal ascii characters</title>
        <link>https://wiki.nicksoft.com/mcu:pic16:num2hex</link>
        <description>Converts byte in WREG to hexadecimal “string” consisting of 2 characters - low and high. Result is written in variables hexL and hexH (which must be defined)


num2hex
	local	noAddL
	local	noAddH
	movwf	temp
	movlw	0x0F
	andwf	temp, w
	
	addlw	'0'	; 9 - WREG
	movwf	hexL
	movlw	'9'+1
	subwf	hexL, w
	skippz	; skip if hexL&gt;'9': hexL - ('9'+1) &gt;= 0
	goto	noAddL
	movlw	'A'-'9'-1		; 65-57-1 = 7; 58+7=65
	addwf	hexL, f
noAddL
	
	swapf	temp, w
	andlw	0x0F
	addlw	'0'
	movwf	hexH
	movlw	'9'+1
	subwf	hexH,…</description>
    </item>
</rdf:RDF>
