Logo 
Search:

Assembly Language Articles

Submit Article
Home » Articles » Assembly Language » Homework HelpRSS Feeds

PROGRAM TO DISPLAY DAY OF WEEK AND MONTH

Posted By: Matthew Bouchard     Category: Assembly Language     Views: 12052

WRITE A PROGRAM TO DISPLAY DAY OF WEEK AND MONTH.

Code for PROGRAM TO DISPLAY DAY OF WEEK AND MONTH in Assembly Language

        .MODEL  SMALL
        .STACK 64
        .DATA

SAVEDAY DB      ?
SAVEMON DB      ?
TEN     DB      10
ELEVEN  DB      11
TWELVE  DB      12
DAYSTAB DB      ' SUNDAY, $  ',  ' MONDAY, $ '
        DB      ' TUESDAY, $  ',  ' WEDNESDAY, $ '
        DB      ' THURSDAY, $  ',  ' FRIDAY, $ '
        DB      ' SATURDAY, $  '
MONTAB  DB      ' JANUARY $ ', ' FEBUARY $ ', ' MARCH $ '
        DB      ' APRIL $ ', ' MAY $ ', ' JUNE $ '
        DB      ' JULY $ ', ' AUGUST $ ', ' SEPTEMBER $ '
        DB      ' OCTOBER $ ', '  NOVEMBER $ ', ' DECEMBER $ '

        .CODE
BEGIN   PROC    FAR
        MOV     AX,@DATA
        MOV     DS,AX
        MOV     ES,AX
        MOV     AX,0600H
        CALL    Q10SCR
        CALL    Q20CURS
        MOV     AH,2AH
        INT     21H
        MOV     SAVEMON,DH
        MOV     SAVEDAY,DL
        CALL    B10DAYWK
        CALL    C10MONTH
        CALL    D10DAYMO
        CALL    E10INPT
        CALL    Q10SCR
        MOV     AX,4C00H
        INT     21H
BEGIN   ENDP

B10DAYWK        PROC    NEAR
        MUL     TWELVE
        LEA     DX,DAYSTAB
        ADD     DX,AX
        MOV     AH,09H
        INT     21H
        RET
B10DAYWK ENDP

C10MONTH PROC   NEAR
        MOV     AL,SAVEMON
        DEC     AL
        MUL     ELEVEN
        LEA     DX,MONTAB
        ADD     DX,AX
        MOV     AH,09H
        INT     21H
        RET
C10MONTH        ENDP

.386

D10DAYMO        PROC    NEAR
        MOVZX   AX,SAVEDAY
        DIV     TEN
        OR      AX,3030H
        MOV     BX,AX
        MOV     AH,02H
        MOV     DL,BL
        INT     21H
        MOV     AH,02H
        MOV     DL,BH
        INT     21H
        RET
D10DAYMO        ENDP

E10INPT PROC    NEAR
        MOV     AH,10H
        INT     16H
        RET
E10INPT ENDP

Q10SCR  PROC    NEAR
        MOV     AX,0600H
        MOV     BH,17H
        MOV     CX,0000
        MOV     DX,184FH
        INT     10H
        RET
Q10SCR  ENDP

Q20CURS     PROC    NEAR
        MOV     AH,02H
        MOV     BH,00
        MOV     DH,10
        MOV     DL,24
        INT     10H
        RET
Q20CURS ENDP
        END     BEGIN
  
Share: 


Didn't find what you were looking for? Find more on PROGRAM TO DISPLAY DAY OF WEEK AND MONTH Or get search suggestion and latest updates.

Matthew Bouchard
Matthew Bouchard author of PROGRAM TO DISPLAY DAY OF WEEK AND MONTH is from Montreal, Canada.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!