caramoan tour package

caramoan tour package

Author Topic: increment code to display in 2 7segments  (Read 359 times)

Offline coejayson

  • CR2032 Battery
  • **
  • Posts: 23
  • Pogi/Ganda Points: 0
increment code to display in 2 7segments
« on: April 09, 2012, 11:46:42 AM »
phelp naman po to derive a code to increment the value of the accumulator/register and to display in the 2 7segments...as in the queuing machine with 00 - 99...tnx

Philippine Electronics Forum

increment code to display in 2 7segments
« on: April 09, 2012, 11:46:42 AM »

Offline sbtech

  • LR44 Battery
  • *
  • Posts: 1
  • Pogi/Ganda Points: 0
Re: increment code to display in 2 7segments
« Reply #1 on: April 09, 2012, 12:29:28 PM »
do you write in ASM?

Philippine Electronics Forum

Re: increment code to display in 2 7segments
« Reply #1 on: April 09, 2012, 12:29:28 PM »

Offline coejayson

  • CR2032 Battery
  • **
  • Posts: 23
  • Pogi/Ganda Points: 0
Re: increment code to display in 2 7segments
« Reply #2 on: April 09, 2012, 12:47:12 PM »
yep po

Philippine Electronics Forum

Re: increment code to display in 2 7segments
« Reply #2 on: April 09, 2012, 12:47:12 PM »

Offline motion55

  • Technical People
  • Diesel Generator
  • *****
  • Posts: 1880
  • Pogi/Ganda Points: 244
  • Gender: Male
  • Been at this longer than you've been alive.
Re: increment code to display in 2 7segments
« Reply #3 on: April 09, 2012, 02:26:33 PM »
If you use packed BCD, then the lower nibble can be used to display the ones digit and upper nibble for the 10's digit.

To perform BCD increment, you add 1 to the accumulator and then execute DA (decimal adjust) instruction.

Code: [Select]
    MOV A,R1
    ADD A,#1
    DA  A
    MOV R1,A
"Set your mind free!"

Philippine Electronics Forum

Re: increment code to display in 2 7segments
« Reply #3 on: April 09, 2012, 02:26:33 PM »

 

Privacy Policy

Contact Us: elabph@yahoo.com