program to get system time

4
HOME ARTICLES FORUM INTERVIEW FAQ ACTIVITIES NEWS VIDEOS POLL LINKS PEOPLE GROUPS Assembly Language Articles Submit Article Home » Articles » Assembly Language » General RSS Feeds Program to get and display the current system time. Posted By: Easy Tutor Category: Assembly Language Views: 18539 An AL Program to get and display the current system time. Download Sourcecode for Program to get and display the current system time. (Size: 1.23 KB) Code for Program to get and display the current system time. in Assembly Language .MODEL SMALL .STACK 100H .DATA PROMPT DB 'Current System Time is : $' TIME DB '00:00:00$' ; time format hr:min:sec .CODE MAIN PROC MOV AX, @DATA ; initialize DS MOV DS, AX LEA BX, TIME ; BX=offset address of string TIME CALL GET_TIME ; call the procedure GET_TIME LEA DX, PROMPT ; DX=offset address of string PROMPT MOV AH, 09H ; print the string PROMPT INT 21H LEA DX, TIME ; DX=offset address of string TIME MOV AH, 09H ; print the string TIME INT 21H MOV AH, 4CH ; return control to DOS INT 21H MAIN ENDP ;**************************************************************************; ;**************************************************************************; ; Procedure Definitions ; ;**************************************************************************; ;**************************************************************************; ;**************************************************************************; ; GET_TIME ; ;**************************************************************************; GET_TIME PROC ; this procedure will get the current system time ; input : BX=offset address of the string TIME ; output : BX=current time PUSH AX ; PUSH AX onto the STACK PUSH CX ; PUSH CX onto the STACK Assembly Language View All General Homework Help Artificial Intelligence C Programming C++ Programming Visual C++ OOAD Cobol Java SQL Server Asp.net MVC Rest and WCF Services Entity Framework Knockout.Js Unix / Linux / Ubuntu Networking OOPs Concept HTML Dos SQL System Analysis & Design Gadgets Internet CSS Javascript .Net Framework Asp.net C# VB.Net Python Perl Oracle Software Engineering Welcome Guest! Login / Register Now | Search: Search 2006 Maruti Suzuki Swift [20052010] VXi for sale in Ahmedabad. Rs.250,000 2006 Maruti Suzuki Swift [20052010] VXi for sale in Ahmedabad. The Green Petrol Maruti Suzuki… Contact Seller DailyFreeCode 3,761 Like

Upload: pankaj-sinha

Post on 10-Nov-2015

4 views

Category:

Documents


0 download

DESCRIPTION

NA

TRANSCRIPT

  • 5/18/2015 Programtogetanddisplaythecurrentsystemtime.AssemblyLanguageExamplesandTutorials

    http://www.dailyfreecode.com/code/getdisplaycurrentsystemtime578.aspx 1/4

    HOME ARTICLES FORUM INTERVIEWFAQ ACTIVITIES NEWS VIDEOS POLL LINKS PEOPLE GROUPS

    AssemblyLanguageArticles SubmitArticle

    HomeArticlesAssemblyLanguageGeneral RSSFeeds

    Programtogetanddisplaythecurrentsystemtime.PostedBy:EasyTutorCategory:AssemblyLanguageViews:18539

    AnALProgramtogetanddisplaythecurrentsystemtime.

    DownloadSourcecodeforProgramtogetanddisplaythecurrentsystemtime.(Size:1.23KB)

    CodeforProgramtogetanddisplaythecurrentsystemtime.inAssemblyLanguage

    .MODELSMALL.STACK100H

    .DATAPROMPTDB'CurrentSystemTimeis:$'TIMEDB'00:00:00$'timeformathr:min:sec

    .CODEMAINPROCMOVAX,@DATAinitializeDSMOVDS,AX

    LEABX,TIMEBX=offsetaddressofstringTIME

    CALLGET_TIMEcalltheprocedureGET_TIME

    LEADX,PROMPTDX=offsetaddressofstringPROMPTMOVAH,09HprintthestringPROMPTINT21H

    LEADX,TIMEDX=offsetaddressofstringTIMEMOVAH,09HprintthestringTIMEINT21H

    MOVAH,4CHreturncontroltoDOSINT21HMAINENDP

    ****************************************************************************************************************************************************ProcedureDefinitions****************************************************************************************************************************************************

    **************************************************************************GET_TIME**************************************************************************

    GET_TIMEPROCthisprocedurewillgetthecurrentsystemtimeinput:BX=offsetaddressofthestringTIMEoutput:BX=currenttime

    PUSHAXPUSHAXontotheSTACKPUSHCXPUSHCXontotheSTACK

    AssemblyLanguageViewAllGeneralHomeworkHelp

    ArtificialIntelligence

    CProgramming

    C++Programming

    VisualC++

    OOAD

    Cobol

    Java

    SQLServer

    Asp.netMVC

    RestandWCFServices

    EntityFramework

    Knockout.Js

    Unix/Linux/Ubuntu

    Networking

    OOPsConcept

    HTML

    Dos

    SQL

    SystemAnalysis&Design

    Gadgets

    Internet

    CSS

    Javascript

    .NetFramework

    Asp.net

    C#

    VB.Net

    Python

    Perl

    Oracle

    SoftwareEngineering

    WelcomeGuest!Login/RegisterNow|

    Search: Search

    2006MarutiSuzukiSwift[20052010]VXiforsaleinAhmedabad.

    Rs.250,000 2006MarutiSuzukiSwift[20052010]VXiforsaleinAhmedabad.TheGreenPetrolMarutiSuzuki

    ContactSeller DailyFreeCode

    3,761Like

  • 5/18/2015 Programtogetanddisplaythecurrentsystemtime.AssemblyLanguageExamplesandTutorials

    http://www.dailyfreecode.com/code/getdisplaycurrentsystemtime578.aspx 2/4

    PreviousPost:Programthatpromptstheusertoenterastring,thencountsanddisplaythenumberofvowelsandco

    NextPost:Programtoconvertastringintouppercase/lowercase

    MOVAH,2CHgetthecurrentsystemtimeINT21H

    MOVAL,CHsetAL=CH,CH=hoursCALLCONVERTcalltheprocedureCONVERTMOV[BX],AXset[BX]=hr,[BX]ispointingtohrinthestringTIME

    MOVAL,CLsetAL=CL,CL=minutesCALLCONVERTcalltheprocedureCONVERTMOV[BX+3],AXset[BX+3]=min,[BX]ispointingtomininthestringTIMEMOVAL,DHsetAL=DH,DH=secondsCALLCONVERTcalltheprocedureCONVERTMOV[BX+6],AXset[BX+6]=min,[BX]ispointingtosecinthestringTIMEPOPCXPOPavaluefromSTACKintoCXPOPAXPOPavaluefromSTACKintoAX

    RETreturncontroltothecallingprocedureGET_TIMEENDPendofprocedureGET_TIME

    **************************************************************************CONVERT**************************************************************************

    CONVERTPROCthisprocedurewillconvertthegivenbinarycodeintoASCIIcodeinput:AL=binarycodeoutput:AX=ASCIIcode

    PUSHDXPUSHDXontotheSTACK

    MOVAH,0setAH=0MOVDL,10setDL=10DIVDLsetAX=AX/DLORAX,3030HconvertthebinarycodeinAXintoASCII

    POPDXPOPavaluefromSTACKintoDX

    RETreturncontroltothecallingprocedureCONVERTENDPendofprocedureCONVERT

    ****************************************************************************************************************************************************

    ENDMAIN

    Share:

    Didn'tfindwhatyouwerelookingfor?FindmoreonProgramtogetanddisplaythecurrentsystemtime.Orgetsearchsuggestionandlatestupdates.

    RDBMSTerms

    AJAXFramework

    DesignPattern

    UML

    WPF

    WCF

    SEO

    PowerShell

    VisualStudio

    WWF

    BizTalkServer

    Azure

    General

    Testing

    OnlineCertifications

    PHP

    MySQL

    LinQ

    ProjectManagement

    Silverlight

    XML

    MSOffice

    WindowsOS

    DHTML

    Sharepoint

    9Like

    066 0 6325

  • 5/18/2015 Programtogetanddisplaythecurrentsystemtime.AssemblyLanguageExamplesandTutorials

    http://www.dailyfreecode.com/code/getdisplaycurrentsystemtime578.aspx 3/4

    EasyTutorauthorofProgramtogetanddisplaythecurrentsystemtime.isfromUnitedStates.EasyTutorsays

    HelloFriends,

    IamFreeLanceTutor,whohelpedstudentincompletingtheirhomework.

    Ihave4Yearsofhandsonexperienceonhelpingstudentincompletingtheirhomework.Ialsoguidethemindoingtheirfinalyearprojects.

    Ihavesharemanyprogramsonthiswebsiteforeveryonetousefreely,ifyouneedfurtherassistance,thanpleasecontactmeoneasytutor.2ya[attherate]gmail[dot]com

    Ihavespecialdiscountschemeforprovidingtutorservices.Iamprovidingtutorservicetostudentsfromvariouscontries,currentlymostofmystudentsarefromUnitedStates,India,Australia,Pakistan,Germany,UKandCanada.

    Iamalsoheretoexpandmytechnicalnetworktoreceivemoreopportunityinmycareer,makefriendstohelptheminresolvingtheirtechnicalproblem,learnandsharemyknowledge,Ifyouliketobemyfriend,Pleasesendmefriendrequest.

    Thanks,HappyProgramming:)

    ViewAllArticles

    RelatedArticlesandCode:

    ProgramtodisplaycurrentdateandtimeSetordisplaynameofcurrenthostsystemhostnameProgramusingServlettoshowhowmanytimescurrentpagehasbeenaccessesandwhatisthecurrenttimeatserversideaswellasatclientsideFindCurrentDateandTimeProgramtoreadstringusinggets()functionanddisplayinuppercaseShellscriptwhichwhenevergetsexecuteddisplaysthemessageGoodMorning/Goodafternoon/GoodEveningdependingonthetimeitgetexecuted"ProgramtodisplayprogressbarasdisplayedinwindowssystemProgramtodisplaydifferenttypeofprogressbarasdisplayedinwindowssystemDisplayinformationaboutallthecurrentprogramsrunningDisplayyourcurrentworkingdirectoryDisplay2itemshavinglowestcurrentstockTCP/IPprogramofUDPclientforTIMEservicethatprintstheresultingtimeShellscripttodisplaytimeinwordWriteamenudrivenprogramtodisplaymessage,username,terminalname,logindateandtimeProgramtoshowanexampleofgettingatcharactersinaStringCORBAprogramfordisplayingthedateandtimeoftheservermachine,clientmachineandthedifferencebetweenthesetwodateandtimeProgramtodisplayfollowingthingsontheclientmachinea)dateandtimeoftheservermachineb)dateandtimeoftheclientmachineanddifferenceDisplaythealreadymountedfilesystemmountDisplayinformationaboutcomputersystemunameProgramtodisplaytheconventionalmemoryofthesystem

    OtherInterestingArticlesinAssemblyLanguage:

    Programtosearchwhetheragivennumberispresentinasortedarray,ifitisnotpresenttheninsertitatappropriateplaceProgramtoreadoneofthehexdigitsAF,anddisplayitonthenextlineindecimalPROGRAMTOCOMPARETWOMEMORYLOCATIONArticleof8051PINOUTPROGRAMTOCLEARTHESCREENANDMAKEBLUEFOREGROUNDPROGRAMTOADDACONSTANTTOEACHELEMENTOFANARRAYProgramthatdividethecontentsofALby4(usingSHRinstruction).ProgramtocheckgiventwovaluesareequalornotProgramtodisplaya"?",readtwocapitalletters,anddisplaythemonthenextlineinalphabeticalorder.ProgramtocheckwhethertheinputstringispalindromeornotProgramfordivide10ofarrayby10andcheckeachgreaterthan10add10andeachgreaterthan20add50

  • 5/18/2015 Programtogetanddisplaythecurrentsystemtime.AssemblyLanguageExamplesandTutorials

    http://www.dailyfreecode.com/code/getdisplaycurrentsystemtime578.aspx 4/4

    PleaseenteryourComment

    Commentshouldbeatleast30Characters.Pleaseputcodeinside[Code]yourcode[/Code].

    Pleaselogintopostcomment

    NoCommentFound,BetheFirsttopostcomment!

    Programwhichgives+,,/,*of28bitnumbersWritethefollowingprocedures:a.AprocedureREADthatletstheuserenterabinarynumberandstoresitinAX.b.AprocedureRANDOM..............ProgramtoacceptNnamesfromtheuserandsortthemindescendingorderProgramthatcomputesthesumofanarray.PlacethesuminAXandalsodisplayit.UseRegisterIndirectModetoaccessthearrayelementsProgramtoconvertastringintouppercase/lowercaseProgramthattakeanumberofcentsC,0&lt=C&lt=99,andexpressCashalfdollars,quarters,dimes,nickels,andpennies.UseINDECtoenterCProgramtoentertwostrings,Findthecharactersthatmatchinboththestrings,storethischaracteranddisplaythematcenterofscreenProgramtoreadtwodigitswhosesumislessthan0,computesanddisplaytheirsum(withoutusingvariables)PROGRAMWHICHWILLDISPLAYONECHARACTERONSCREENUNTIL$COMES

    RSSFeeds: Articles|Forum|NewUsers|Activities|InterviewFAQ|Poll|HotlinksSocialNetworking: HallofFame|Facebook|Twitter|LinkedInTerms: TermsofUse|PrivacyPolicy|Contactus

    Copyright20082012