home *** CD-ROM | disk | FTP | other *** search
/ ticalc.org / ticalc_org_rev_b.iso / archives / 86 / asm / source / calendar.asm < prev    next >
Encoding:
Assembly Source File  |  2001-07-01  |  24.3 KB  |  755 lines

  1. ;Calander 86z 1.1
  2. ;By: Ahmed El-Helw
  3. ;Copyright (C) 1998
  4. ;ahmedre@worldnet.att.net
  5. ;http://members.xoom.com/ahmedre
  6.  
  7. #include "asm86.h"         
  8. #include "ti86asm.inc"
  9.  
  10. .org _asm_exec_ram
  11.  
  12. ;------------------------ASE 1.0+ / Rascall 0.9+ Description ----------------------------
  13.  
  14.         nop                     ;Identifies the table
  15.         jp Init                 ;Jump to Start of Program
  16. .dw $0000                       ;Version # of Table
  17. .dw Title                       ;Absolute pointer to program description
  18.  
  19. ;----------------------------------------------------------------------------------------
  20.  
  21. Init:
  22.         ld a,5                  ;4 into A [Wednesday]
  23.         ld (DayStart),a         ;Starting Day for Month  [The First was Wednesday]
  24.         ld a,2                  ;2 into A
  25.         ld (Leap),a             ;Leap Year = 5 [28 month Feb. this year, 1998]
  26.         ld a,28                 ;28 into A
  27.         ld (FebDays),a          ;A into FebDays
  28.         ld a,1                  ;Loads Month # into A 
  29.  
  30.         ld (Month),a            ;Loads A into Month      [Starting Month December]
  31.         ld hl,1998              ;Loads Year into HL
  32.         ld (Year),hl            ;Loads it into Year #
  33.         jr Start                ;Start!
  34.  
  35. Start:
  36.         call _clrLCD
  37.         xor a                   ;Same as ld a,0
  38.         ld (_curCol),a          ;Column of Text
  39.         ld (_curRow),a          ;Row for Text
  40.         ld hl,TitleString       ;TitleString into HL
  41.         call _puts              ;Send to screen! [Large Text]   
  42.         set 3,(iy+$05)          ;Text is now white on black
  43.         ld de,8*256+0           ;Loads Coordinates
  44.         ld hl,BlankDay          ;String into HL
  45.         call PutText             ;Display it!
  46.         ld de,8*256+5           ;Loads Coordinates
  47.         ld hl,Satday            ;String into HL
  48.         call PutText            ;Display it!
  49.         ld de,8*256+23          ;Loads Coordinates
  50.         ld hl,Monday            ;String into HL
  51.         call PutText            ;Display it!
  52.         ld de,8*256+43          ;Loads Coordinates
  53.         ld hl,Thuesday          ;String into HL
  54.         call PutText            ;Display it!
  55.         ld de,8*256+61          ;Loads Coordinates
  56.         ld hl,Wednesday         ;String into HL
  57.         call PutText            ;Display it!
  58.         ld de,8*256+81          ;Loads Coordinates
  59.         ld hl,Thuesday          ;String into HL
  60.         call PutText            ;Display it!
  61.         ld de,8*256+101         ;Loads Coordinates
  62.         ld hl,Friday            ;String into HL
  63.         call PutText            ;Display it!
  64.         ld de,8*256+119         ;Loads Coordinates
  65.         ld hl,Satday            ;String into HL
  66.         call PutText            ;Display it!
  67.         res 3,(iy+$05)          ;Text is now black on white
  68.         jp PutCal
  69.  
  70. PutCal:                         ;Routine to Display Calander
  71.         call PutMonth           ;Routine to Display Month
  72.         call _vputs             ;Put the String on Screen
  73.         call PutYear            ;Display the Year
  74.         ld a,(DayStart)         ;Starting Day into A
  75.         ld (Spot),a             ;A into Spot
  76.         ld a,1                  ;Load 1 into a
  77.         ld (Day),a              ;Make Day  = 1
  78.         ld (Week),a             ;Make Week = 1
  79.         jr Loop                 ;Goto Loop
  80.  
  81. Loop:                           ;Loop to Display the Numbers
  82.         ld a,(Spot)             ;Spot into A
  83.         cp 1                    ;Is it 1?
  84.         jp z,DispSun            ;Goto Display Sunday
  85.         cp 2                    ;Is it 2?
  86.         jp z,DispMon            ;Display Monday
  87.         cp 3                    ;Is it 3?
  88.         jp z,DispTue            ;Display Tuesday
  89.         cp 4                    ;Is it 4?
  90.         jp z,DispWed            ;Display Wednesday
  91.         cp 5                    ;Is it 5?
  92.         jp z,DispThur           ;Display Thursday
  93.         cp 6                    ;Is it 6?
  94.         jp z,DispFri            ;Display Friday
  95.         cp 7                    ;Is it 7?
  96.         jp z,DispSat            ;Display Saturday
  97.         
  98. DispSun:
  99.         call CheckWeek          ;Checks week to set 
  100.         ld a,1                  ;1 into A
  101.         ld (_penCol),a          ;A into Column
  102.         ld a,(Day)              ;Day into A
  103.         call DispA              ;Display A
  104.         jp CheckStatus          ;Checks Status of Days
  105.  
  106. DispMon:
  107.         call CheckWeek          ;Checks week to set 
  108.         ld a,18                 ;18 into A
  109.         ld (_penCol),a          ;A into Column
  110.         ld a,(Day)              ;Day into A
  111.         call DispA              ;Display A
  112.         jp CheckStatus          ;Checks Status of Days
  113.  
  114. DispTue:
  115.         call CheckWeek          ;Checks week to set 
  116.         ld a,38                 ;38 into A
  117.         ld (_penCol),a          ;A into Column
  118.         ld a,(Day)              ;Day into A
  119.         call DispA              ;Display A
  120.         jp CheckStatus          ;Checks Status of Days
  121.  
  122. DispWed:
  123.         call CheckWeek          ;Checks week to set 
  124.         ld a,56                 ;56 into A
  125.         ld (_penCol),a          ;A into Column
  126.         ld a,(Day)              ;Day into A
  127.         call DispA              ;Display A
  128.         jp CheckStatus          ;Checks Status of Days
  129.  
  130. DispThur:
  131.         call CheckWeek          ;Checks week to set 
  132.         ld a,76                 ;76 into A
  133.         ld (_penCol),a          ;A into Column
  134.         ld a,(Day)              ;Day into A
  135.         call DispA              ;Display A
  136.         jp CheckStatus          ;Checks Status of Days
  137.  
  138. DispFri:
  139.         call CheckWeek          ;Checks week to set 
  140.         ld a,96                 ;96 into A
  141.         ld (_penCol),a          ;A into Column
  142.         ld a,(Day)              ;Day into A
  143.         call DispA              ;Display A
  144.         jp CheckStatus          ;Checks Status of Days
  145.  
  146. DispSat:
  147.         call CheckWeek          ;Checks week to set 
  148.         ld a,113                ;113 into A
  149.         ld (_penCol),a          ;A into Column
  150.         ld a,(Day)              ;Day into A
  151.         call DispA              ;Display A
  152.         jp CheckStatus          ;Checks Status of Days
  153.  
  154. CheckStatus:
  155.         ld a,(TotalDays)        ;Total Days into A
  156.         ld b,a
  157.         ld a,(Day)              ;Days into A
  158.     sub b
  159.     or a
  160.         jp z,GetKeyLoop         ;Goto GetKeyLoop if equal
  161.         jp ContinueLoop         ;Otherwise, Continue Loop
  162.  
  163. ContinueLoop:
  164.         ld a,(Day)              ;Day into A
  165.         inc a                   ;Increase A
  166.         ld (Day),a              ;Back into Day
  167.         ld a,(Spot)             ;Loads Spot into a
  168.         inc a                   ;Increase it
  169.         ld (Spot),a             ;A into Spot
  170.         cp 8                    ;Is it 8
  171.         jp z,NewWeek            ;Do a NewWeek   
  172.         jp Loop                 ;Redo Loop
  173.  
  174. NewWeek:
  175.         ld a,(Week)             ;Week into A
  176.         inc a                   ;Increase it
  177.         ld (Week),a             ;A back into Week
  178.         ld a,1                  ;1 into A [Sunday]
  179.         ld (Spot),a             ;A into Spot
  180.         jp Loop                 ;Return
  181.  
  182. GetKeyLoop:
  183.         halt                    ;Save Energy
  184.         call GET_KEY            ;Wait for a key
  185.         cp K_EXIT               ;Is it Exit ?
  186.         jp z,_clrLCD            ;Clear Screen/Return
  187.         cp K_RIGHT              ;Is it Right?
  188.         jp z,IncreaseMonth      ;Increase the Month!
  189.     cp K_LEFT    
  190.     jp z,DecreaseMonth
  191.         cp K_UP                 ;Is it Up?
  192.         jp z,IncreaseYear       ;Increase the Year
  193.         cp K_DOWN               ;Is it Down?
  194.         jp z,DecreaseYear       ;Decrease the Year
  195.         jp nz,GetKeyLoop        ;No Key?  Reloop!
  196.  
  197. IncreaseYear:
  198.         ld a,(DayStart)         ;Load DayStart into A
  199.         inc a                   ;Increase A
  200.         ld (DayStart),a         ;A into DayStart
  201.         cp 8                    ;Is it 8?
  202.         call z,ResetStart       ;Reset to Sunday!
  203.         ld hl,(Year)            ;Year into HL
  204.         inc hl                  ;Increase it
  205.         ld (Year),hl            ;HL back into Year
  206.         ld a,28                 ;Load 28 into A
  207.         ld (FebDays),a          ;Febuary Days as a
  208.         ld a,(Leap)             ;Leap into A
  209.         dec a                   ;Decrease it
  210.         ld (Leap),a             ;Load A into Leap
  211.         or a                    ;Is it 0 ?
  212.         call z,LeapYear         ;Call LeapYear
  213.     call ResetVars
  214.         jp Start
  215.  
  216. DecreaseYear:
  217.         ld a,(DayStart)         ;Load DayStart into A
  218.         dec a                   ;Decrease A
  219.         ld (DayStart),a         ;A into DayStart
  220.         cp 0                    ;Is it 0?
  221.         call z,ResetSaturday    ;Reset to Saturday!
  222.         ld hl,(Year)            ;Year into HL
  223.         dec hl                  ;Decrease it
  224.         ld (Year),hl            ;HL back into Year
  225.         ld a,28                 ;Load 28 into A
  226.         ld (FebDays),a          ;Febuary Days as a
  227.         ld a,(Leap)             ;Leap into A
  228.         inc a                   ;Increase it
  229.         ld (Leap),a             ;Load A into Leap
  230.         cp 8                    ;Is it 8 ?
  231.         call z,LeapYear         ;Call LeapYear
  232.         cp 4                    ;Is it 4?
  233.         call z,LeapYear         ;Call LeapYear
  234.     call ResetVars        
  235.         jp Start
  236.  
  237. IncreaseMonth:
  238.         ld a,(Spot)             ;Day Spot into A
  239.         inc a                   ;Increase
  240.         ld (DayStart),a         ;A into DayStart
  241.         cp 8                    ;Is it 8?
  242.         call z,ResetStart       ;Reset to Sunday!
  243.         ld a,(Month)            ;Month # into A
  244.         inc a                   ;Increase it
  245.         ld (Month),a            ;A into Month
  246.         cp 13                   ;Is it 13??
  247.         call z,NewYear          ;NewYear!
  248.     call ResetVars
  249.         jp Start                ;Goto Start! [Display it!]
  250.  
  251. ;-------------------------------
  252. ;|Routines to Decrease the Month
  253. ;-------------------------------
  254. DecreaseMonth:
  255.     ld a,(Month)        ;Checks the month.. if it is
  256.     cp 3            ;March, your going to Feb
  257.     jp z,GotoFeb        ;If it is a 31 day month, your going to a 30 day month..
  258.     cp 5
  259.     jp z,Goto30
  260.     cp 7
  261.     jp z,Goto30
  262.     cp 11
  263.     jp z,Goto30
  264.     cp 8            ;August and July are 30 days, so special loop for them..
  265.     jp z,GotoJul
  266.     cp 1            ;If it is January, your going to switch years, so another
  267.     jp z,GotoDec        ;special loop for that...
  268.     cp 2            ;If it is February, we are dealing with a random number of 
  269.     jp z,GotoJan        ;days, so a special loop for that as well...
  270.  
  271.     ld b,29            ;If not,then we are going to a 31 day month.. Loop 29x to get
  272. Dec3031Days:            ;to the beginning of the month...
  273.     ld a,(Spot)
  274.     dec a
  275.     ld (Spot),a
  276.     or a
  277.     call z,ResDecSat
  278.     djnz Dec3031Days
  279.  
  280.     ld b,31            ;Then loop 31x to get to the beginning of the previous month..
  281. Dec31Days:
  282.     ld a,(Spot)
  283.     dec a
  284.     ld (Spot),a
  285.     or a
  286.     call z,ResDecSat
  287.     djnz Dec31Days
  288.     ld a,(Spot)
  289.     ld (DayStart),a
  290.     ld a,(Month)
  291.     dec a
  292.     ld (Month),a
  293.     or a
  294.     call z,OldYear
  295.     call ResetVars
  296.     jp Start
  297.  
  298. ResDecSat:                ;If spot is 0, this means that
  299.     ld a,7                ;we are really on a Saturday..
  300.     ld (Spot),a            ;so we make it Saturday.
  301.     ret
  302.  
  303. Goto30:
  304.     ld b,30
  305. Dec3130Days:
  306.     ld a,(Spot)
  307.     dec a
  308.     ld (Spot),a
  309.     or a
  310.     call z,ResDecSat
  311.     djnz Dec3130Days
  312.  
  313.     ld b,30
  314. Dec30Days:
  315.     ld a,(Spot)
  316.     dec a
  317.     ld (Spot),a
  318.     or a
  319.     call z,ResDecSat
  320.     djnz Dec30Days
  321.  
  322.     ld a,(Spot)
  323.     ld (DayStart),a
  324.     ld a,(Month)
  325.     dec a
  326.     ld (Month),a
  327.     call ResetVars
  328.     jp Start
  329.  
  330. GotoFeb:
  331.     ld b,30
  332. DecMarDays:
  333.     ld a,(Spot)
  334.     dec a
  335.     ld (Spot),a
  336.     or a
  337.     call z,ResDecSat
  338.     djnz DecMarDays
  339.  
  340.     ld a,(FebDays)
  341.     ld b,a
  342.  
  343. DecFebDays:
  344.     ld a,(Spot)
  345.     dec a
  346.     ld (Spot),a
  347.     or a
  348.     call z,ResDecSat
  349.     djnz DecFebDays
  350.     ld a,(Spot)
  351.     ld (DayStart),a
  352.     ld a,(Month)
  353.     dec a
  354.     ld (Month),a
  355.     call ResetVars
  356.     jp Start
  357.  
  358. GotoJul:
  359.     ld b,31
  360. DecJulDays:
  361.     ld a,(Spot)
  362.     dec a
  363.     ld (Spot),a
  364.     or a
  365.     call z,ResDecSat
  366.     djnz DecJulDays
  367.  
  368.     ld a,31
  369.     ld b,a
  370.  
  371. JulDays:
  372.     ld a,(Spot)
  373.     dec a
  374.     ld (Spot),a
  375.     or a
  376.     call z,ResDecSat
  377.     djnz JulDays
  378.     ld a,(Spot)
  379.     inc a
  380.     ld (DayStart),a
  381.     ld a,(Month)
  382.     dec a
  383.     ld (Month),a
  384.     call ResetVars
  385.     jp Start
  386.  
  387. GotoDec:
  388.     ld b,30
  389. DecJanDays:
  390.     ld a,(Spot)
  391.     dec a
  392.     ld (Spot),a
  393.     or a
  394.     call z,ResDecSat
  395.     djnz DecJanDays
  396.  
  397.     ld b,31
  398. DecDecDays:
  399.     ld a,(Spot)
  400.     dec a
  401.     ld (Spot),a
  402.     or a
  403.     call z,ResDecSat
  404.     djnz DecDecDays
  405.     ld a,(Spot)
  406.     ld (DayStart),a
  407.     ld a,12
  408.     ld (Month),a
  409.     call OldYear
  410.     jp Start
  411.  
  412. GotoJan:
  413.     ld a,(FebDays)
  414.     ld b,a
  415. DecFDays:
  416.     ld a,(Spot)
  417.     dec a
  418.     ld (Spot),a
  419.     or a
  420.     call z,ResDecSat
  421.     djnz DecFDays
  422.  
  423.     ld b,31
  424.  
  425. DectoJanDays:
  426.     ld a,(Spot)
  427.     dec a
  428.     ld (Spot),a
  429.     or a
  430.     call z,ResDecSat
  431.     djnz DectoJanDays
  432.     ld a,(Spot)
  433.     inc a
  434.     ld (DayStart),a
  435.     ld a,(Month)
  436.     dec a
  437.     ld (Month),a
  438.     call ResetVars
  439.     jp Start
  440.  
  441. OldYear:
  442.     ld hl,(Year)
  443.     dec hl
  444.     ld (Year),hl
  445.         ld a,(Leap)             ;Leap into A
  446.         inc a                   ;Increase it
  447.         ld (Leap),a             ;Load A into Leap
  448.         cp 8                    ;Is it 8 ?
  449.         call z,LeapYear         ;Call LeapYear
  450.         cp 4                    ;Is it 4?
  451.         call z,LeapYear         ;Call LeapYear
  452.     ret
  453.  
  454. ResetStart:
  455.         ld a,1                  ;Loads 1 into A
  456.         ld (DayStart),a         ;A into DayStart [Sunday]
  457.         ret                     ;Return
  458.  
  459. ResetSaturday:
  460.         ld a,7                  ;Loads 7 into A
  461.         ld (DayStart),a         ;A into DayStart [Saturday]
  462.         ret                     ;Return
  463.  
  464. NewYear:
  465.         ld a,1                  ;Loads 1 into A
  466.         ld (Month),a            ;A into Month [January]
  467.         ld hl,(Year)            ;Year into HL
  468.         inc hl                  ;Increase it
  469.         ld (Year),hl            ;HL into Year
  470.         ld a,(Leap)             ;Leap into A
  471.         dec a                   ;Decrease it
  472.         ld (Leap),a             ;Back into Leap
  473.         cp 0                    ;Is it 0?
  474.         jp z,LeapYear           ;LeapYear it is
  475.         ld a,28                 ;Loads 28 into A
  476.         ld (FebDays),a          ;A into FebDays
  477.         ret                     ;return
  478.  
  479. LeapYear:            ;Loop to find out if the year is 100x
  480.     ld hl,(Year)        ;Loads Year into HL
  481.     ld (TestYear),hl    ;Loads HL into TestYear
  482.     ld b,60            ;Loads 10 into b, starting a loop...
  483.  
  484. LeapLoop:
  485.     ld hl,(TestYear)    ;Load the Test Year into HL
  486.     ld de,0            ;We want to check if it is 0
  487.        call CP_HL_DE        ;So we check...
  488.        jp z,Test400x        ;if it is 0, then it is 100x, so test 400x
  489.     ld hl,(TestYear)    ;if not, then keep going... 
  490.     ld de,-100        ;Load -100 into bc
  491.     add hl,de        ;Add it w/the year [aka TestYear-500]
  492.     ld (TestYear),hl    ;Loads that into Year
  493.     djnz LeapLoop        ;Reloops until b = 0
  494.     ;---------------Real Leap Year!--------------------
  495. RLY:                ;Real Leap Year!
  496.         ld a,29                 ;Loads 29 into A
  497.         ld (FebDays),a          ;Loads A into FebDays
  498.         ld a,4                  ;Loads 4 into A
  499.         ld (Leap),a             ;A into Leap [LeapYear]
  500.         ret                     ;return
  501.  
  502. Test400x:
  503.     ld hl,(Year)        ;Loads Year into HL
  504.     ld (TestYear),hl    ;Loads HL into TestYear
  505.     ld b,60            ;Loads 10 into b, starting a loop...
  506.  
  507. LeapLoop2:
  508.     ld hl,(TestYear)    ;Load the Test Year into HL
  509.     ld de,0            ;We want to check if it is 0
  510.        call CP_HL_DE        ;So we check...
  511.        jp z,RLY        ;if it is 0, then it is 400x, so leap year
  512.     ld hl,(TestYear)    ;if not, then keep going... 
  513.     ld de,-400        ;Load -100 into bc
  514.     add hl,de        ;Add it w/the year [aka TestYear-400]
  515.     ld (TestYear),hl    ;Loads that into Year
  516.     djnz LeapLoop2        ;Reloops until b = 0
  517.  
  518. NotReal:            ;Not REALLY a Leap Year...
  519.     ld a,4            ;Loads 4 into A
  520.     ld (Leap),a        ;Reset LeapDays
  521.     ret            ;Return
  522.  
  523. ResetVars:
  524.         xor a                   ;Load 0 into a
  525.         ld (Week),a             ;A into Week
  526.         ld (Day),a              ;A into Day
  527.         ld (Spot),a             ;A into Spot
  528.     ret
  529. CheckWeek:
  530.         ld a,(Week)             ;Loads the week into A
  531.         cp 1                    ;Is it 1
  532.         jp z,Week1              ;Then set Week1 Coords
  533.         cp 2                    ;Is it 2
  534.         jp z,Week2              ;Then set Week2 Coords
  535.         cp 3                    ;Is it 3
  536.         jp z,Week3              ;Then set Week3 Coords
  537.         cp 4                    ;Is it 4
  538.         jp z,Week4              ;Then set Week4 Coords
  539.         cp 5                    ;Is it 5
  540.         jp z,Week5              ;Set Week5 Coords
  541.         jp nz,Week6             ;Otherwise .. Week6
  542.  
  543. Week1:
  544.         ld a,15                 ;Load into A
  545.         ld (_penRow),a          ;Set a as PenRow
  546.         ret                     ;Return
  547.  
  548. Week2:
  549.         ld a,22                 ;Load into A
  550.         ld (_penRow),a          ;Set a as PenRow
  551.         ret                     ;Return
  552.  
  553. Week3:
  554.         ld a,29                 ;Load into A
  555.         ld (_penRow),a          ;Set a as PenRow
  556.         ret                     ;Return
  557.  
  558. Week4:
  559.         ld a,36                 ;Load into A
  560.         ld (_penRow),a          ;Set a as PenRow
  561.         ret                     ;Return
  562.  
  563. Week5:
  564.         ld a,43                 ;Load into A
  565.         ld (_penRow),a          ;Set a as PenRow
  566.         ret                     ;Return
  567.  
  568. Week6:
  569.         ld a,50                 ;Loads into A
  570.         ld (_penRow),a          ;Set a as PenRow
  571.         ret
  572.  
  573.  
  574. PutMonth:
  575.         ld a,(Month)            ;Loads Month # into A
  576.         cp 1                    ;If it is 1
  577.         jp z,Month1             ;Goto Month1 [January]
  578.         cp 2                    ;Is it two?
  579.         jp z,Month2             ;Goto Month2 [Febuary]
  580.         cp 3                    ;Is it 3?
  581.         jp z,Month3             ;Goto Month3 [March]
  582.         cp 4                    ;Is it 4
  583.         jp z,Month4             ;Goto Month 4
  584.         cp 5                    ;Is it 5
  585.         jp z,Month5             ;Goto Month5
  586.         cp 6                    ;Is it 6
  587.         jp z,Month6             ;Goto Month 6
  588.         cp 7                    ;Is it 7
  589.         jp z,Month7             ;Goto Month7
  590.         cp 8                    ;Is it 8
  591.         jp z,Month8             ;Goto Month 8
  592.         cp 9                    ;Is it 9
  593.         jp z,Month9             ;Goto Month 9
  594.         cp 10                   ;Is it 10
  595.         jp z,Month10            ;Goto Month10
  596.         cp 11                   ;Is it 11
  597.         jp z,Month11            ;Goto Month11
  598.         jp nz,Month12           ;Otherwise, it has to be 12, so goto Month12
  599.  
  600. Month1:                         ;Month1 Label [January]
  601.         ld a,31                 ;31 into A
  602.         ld (TotalDays),a        ;A -> Total Days 
  603.         call SetText            ;Put coordinates for text
  604.         ld hl,January           ;String into HL
  605.         ret                     ;Return to Call
  606.  
  607. Month2:                         ;Month2 Label [February]
  608.         ld a,(FebDays)          ;February Days into A
  609.         ld (TotalDays),a        ;A => Total Days
  610.         call SetText            ;Put coordinates for text
  611.         ld hl,Febuary           ;String into HL
  612.         ret                     ;Return to Call
  613.  
  614.  
  615. Month3:                         ;Month3 Label [March]
  616.         ld a,31                 ;31 into A
  617.         ld (TotalDays),a        ;A -> Total Days 
  618.         call SetText            ;Put coordinates for text
  619.         ld hl,March             ;String into HL
  620.         ret                     ;Return to Call
  621.  
  622. Month4:                         ;Month4 Label [April]
  623.         ld a,30                 ;30 into A
  624.         ld (TotalDays),a        ;A -> Total Days 
  625.         call SetText            ;Put coordinates for text
  626.         ld hl,April             ;String into HL
  627.         ret                     ;Return to Call
  628.  
  629. Month5:                         ;Month5 Label [May]
  630.         ld a,31                 ;31 into A
  631.         ld (TotalDays),a        ;A -> Total Days 
  632.         call SetText            ;Put coordinates for text
  633.         ld hl,May               ;String into HL
  634.         ret                     ;Return to Call
  635.  
  636. Month6:                         ;Month6 Label [June]
  637.         ld a,30                 ;30 into A
  638.         ld (TotalDays),a        ;A -> Total Days 
  639.         call SetText            ;Put coordinates for text
  640.         ld hl,June              ;String into HL
  641.         ret                     ;Return to Call
  642.  
  643. Month7:                         ;Month7 Label [July]
  644.         ld a,31                 ;31 into A
  645.         ld (TotalDays),a        ;A -> Total Days 
  646.         call SetText            ;Put coordinates for text
  647.         ld hl,July              ;String into HL
  648.         ret                     ;Return to Call
  649.  
  650. Month8:                         ;Month8 Label [August]
  651.         ld a,31                 ;31 into A
  652.         ld (TotalDays),a        ;A -> Total Days 
  653.         call SetText            ;Put coordinates for text
  654.         ld hl,August            ;String into HL
  655.         ret                     ;Return to Call
  656.  
  657. Month9:                         ;Month9 Label [September]
  658.         ld a,30                 ;30 into A
  659.         ld (TotalDays),a        ;A -> Total Days 
  660.         call SetText            ;Put coordinates for text
  661.         ld hl,September         ;String into HL
  662.         ret                     ;Return to Call
  663.  
  664. Month10:                        ;Month1 Label [October]
  665.         ld a,31                 ;31 into A
  666.         ld (TotalDays),a        ;A -> Total Days 
  667.         call SetText            ;Put coordinates for text
  668.         ld hl,October           ;String into HL
  669.         ret                     ;Return to Call
  670.  
  671. Month11:                        ;Month11 Label [November]
  672.         ld a,30                 ;30 into A
  673.         ld (TotalDays),a        ;A -> Total Days 
  674.         call SetText            ;Put coordinates for text
  675.         ld hl,November          ;String into HL
  676.         ret                     ;Return to Call
  677.  
  678. Month12:                        ;Month12 Label [December]
  679.         ld a,31                 ;31 into A
  680.         ld (TotalDays),a        ;A -> Total Days 
  681.         call SetText            ;Put coordinates for text
  682.         ld hl,December          ;String into HL
  683.         ret                     ;Return to Call
  684.  
  685. SetText:
  686.     ld hl,57*256+32        ;Set Coordinates
  687.     ld (_penCol),hl        ;Into PenCol
  688.     ret            ;Return
  689.  
  690. PutYear:
  691.         ld hl,57*256+80         ;Set Coordinates
  692.         ld (_penCol),hl         ;Into PenCol
  693.         ld hl,(Year)            ;Load Year # into HL
  694.         call DispHL             ;Display It!
  695.     res 3,(iy+$05)
  696.     ret
  697.  
  698. PutText:
  699.     ld (_penCol),de
  700.     call _vputs
  701.     ret
  702.  
  703. ;-----------------Routine by SCaBBy-----------------------
  704. DispA:                          ;Routine to Display A
  705.  ld l,a                         ;Loads A into L
  706.  ld h,0                         ;Loads 0 into H
  707. DispHL:                         ;Routine to Display HL  
  708.  xor a                          ;Sets a to 0
  709.  ld de,-1                       ;Loads -1 into DE
  710.  ld (_curRow),de                ;De into Cursor Row
  711.  call 4A33h                     
  712.  dec hl                         ;Decrease HL
  713.  jp _vputs                      ;Put it on the screen!
  714. ;---------------------------------------------------------
  715.  
  716. Title:          .db     "Calendar 86z - By: ARE",0
  717. TitleString:    .db     "     Calendar 86z    ",0
  718. BlankDay:       .db     "                        ",0
  719.  
  720. Satday:         .db     "S                       ",0
  721. Monday:         .db     "M                       ",0
  722. Thuesday:       .db     "T                       ",0
  723. Wednesday:      .db     "W                       ",0
  724. Friday:         .db     "F                       ",0
  725.  
  726. January:        .db     "January",0
  727. Febuary:        .db     "February",0
  728. March:          .db     "March",0
  729. April:          .db     "April",0
  730. May:            .db     "May",0
  731. June:           .db     "June",0
  732. July:           .db     "July",0
  733. August:         .db     "August",0
  734. September:      .db     "September",0
  735. October:        .db     "October",0
  736. November:       .db     "November",0
  737. December:       .db     "December",0
  738.  
  739. ;-----------------------Variables-------------------------
  740. DayStart:       .db 0
  741. Month:          .db 0 
  742. Week:           .db 0
  743. Spot:           .db 0
  744. TotalDays:      .db 0
  745. Day:            .db 0
  746. Leap:           .db 0
  747. FebDays:        .db 0
  748. Year:           .db 0,0
  749. TestYear:    .db 0,0
  750. ;---------------------------------------------------------
  751.  
  752. .end                                    ;Tell TASM it is all over
  753. END                                     ;Tell TASM it is all over
  754.  
  755.