Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6836017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:18:12+00:00 2026-05-26T23:18:12+00:00

What is serial copy? Is it different from deep-copy and shallow-copy? According to the

  • 0

What is serial copy? Is it different from deep-copy and shallow-copy?

According to the wiki entry under Duff’s device, it is traditionally implemented as:

do {                //count > 0 assumed
    *to = *from++;  //Note that the 'to' pointer is NOT incremented
} while(--count > 0);

And then it makes a note, saying

Note that to is not incremented because Duff was copying to a single memory-mapped output register.

I didn’t really understand this note.

If to pointer is not incremented, then what is the point of the loop? Why then it is implemented as:

*to = from[count-1]; //does it not do the same thing?

I suspect that it has something to do with the definition of serial copy.

How can we allocate memory for to so that the loop would make some difference?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:18:13+00:00Added an answer on May 26, 2026 at 11:18 pm

    The point of such a copy is that it is not made to normal memory, but to a serial register.

    So, each time a write is made to the address of the register (to), the hardware associated with the register will do something like send the bits over a serial link, or push them onto a queue for some other hardware to deal with.

    Typically you cannot even read from register addresses like this, so they are very unlike normal memory, and best thought of as an interface to a particular piece of hardware that just happens to be located at a memory address.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From Windows I can communicate with a serial port device using the following commands:
I have 3 values that I need to copy from one table to another
When a byte from the serial port is received, it enters this handler correctly,
I would like make an java app that communicates with a serial device(handheld scanner)
I am using a serial port to communicate with a remote diagnostics device. The
I am reading from serial port using string messaga = _serialPort.ReadLine(); When i Console.WriteLine(messaga);
I'm developing an application in C# to capture info from the serial port. The
import serial import imaplib from time import sleep IMAP_SERVER='imap.gmail.com' IMAP_PORT=993 ser= serial.Serial ('/dev/ttyACM0',9600) M
import serial import imaplib from time import sleep IMAP_SERVER='imap.gmail.com' IMAP_PORT=993 ser= serial.Serial ('/dev/ttyACM0',9600) while
I am trying to copy text from list item in unordered list to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.