Ultimate Guide to Digit Extraction in Programming

instructions n.w
1 / 7
Embed
Share

Learn how to extract digits efficiently in programming through detailed instructions, examples, and macros. Master the process step-by-step for accurate results in your coding projects.

  • Programming
  • Digit Extraction
  • Macros
  • Instructions
  • Coding

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Instructions

  2. Instructions

  3. Instructions

  4. Instructions

  5. Digit extractions d 234 = b 11101010 Hunnreds=2 (var_100) Tens=3 (var_10) Ones=4 (var_1)

  6. Digit extraction (getnums.asm) PROCESSOR 16f84 #include "p16f84.inc" __CONFIG _XT_OSC & _WDT_OFF & _PWRTE_ON & _CP_OFF #include "bank.inc" #include "digit.inc" cblock 0x0c var_100 var_10 var_1 rez temp endc Main bank1 clrf movlw b'00000001 movwf TRISA bank0 clrf PORTB TRISB movlw d'234' movwf rez digit rez Loop goto Loop org goto 0x00 main end org goto 0x04 main

  7. Macro for digit extraction (digit.inc) digit macro rez movlw d'10' Loop10 incf var_10, f subwf temp, f btfsc STATUS, C goto Loop10 decf var_10, f addwf temp, f local local Loop100 Loop10 clrf clrf clrf var_100 var_10 var_1 movf movwf temp movlw d'100 Loop100 incf subwf temp, f btfsc goto decf addwf temp, f rez, W movf temp, W movwf var_1 endm var_100, f STATUS, C Loop100 var_100, f

More Related Content