home *** CD-ROM | disk | FTP | other *** search
/ ticalc.org / ticalc_org_rev_b.iso / archives / 83 / asm / source / ashell83 / zcal.z80 < prev   
Encoding:
Text File  |  2001-07-01  |  23.3 KB  |  773 lines

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