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

  • Home
  • SEARCH
  • 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 7031657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:49:57+00:00 2026-05-28T00:49:57+00:00

I want to create a file in x86 assembler, with a filename from a

  • 0

I want to create a file in x86 assembler, with a filename from a system time.
I know that in order to get time I have to use function 2 from interrupt 1Ah – it returns the time in registers. The problem I have is with creating a file with contents of this registers.
Function 3ch from interrupt 21h uses filename, that is stored in DX register, but the filename has to be in ASCII.
How can I convert the data to ASCII? Or is there some other way?
Thanks.

  • 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-28T00:49:57+00:00Added an answer on May 28, 2026 at 12:49 am

    If you read the real time clock time with int 1Ah fn 2, you will get the time in 55 millisecond intervals since midnight, and you are going to have to do all the necessary computations by yourself in order to compute hours, minutes and seconds out of it. It is not rocket science, but why not avoid it if you can?

    Luckily, you can use int 21h, fn 2C “DOS Get Time” which returns the hour in CH, the minutes in CL, the seconds in DH, and even (a miserable approximation of) hundredths of a second in DL. (Okay, ignore DL.) So then, all you have to do is convert these numbers to a string, in order to build your filename.

    Now, it is not correct to say that the filename is stored in the DX register; the filename is going to have to be stored in a buffer, and the DX register will need to point to that buffer upon entry to int 21h fn 3Ch.

    Converting a number to ASCII is tricky business, but luckily it has been answered before on SO: Problem converting integer to ASCII code in x86 assembly

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

Sidebar

Related Questions

I want to create XML file from my Excel file through .NET (c#). My
I want to create a file that only resides in memory... In looking through
I want to create a file using C++, but I have no idea how
I want to create a log file in SSIS. I know how to create
I want to create simple file viewer. What control should i use to view
I want to create a .NET assembly that can be accessed from unmanaged code
I want to create a pdf file from Binary data. I looked around and
I want to create xml file. I have three text fields and one button
i want create XML file here is my following code String fileName = jasstech.xml;
i want to create a hardlink from a file C:\xxx.log to C:\mklink\xxx.log . In

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.