[Coco] Julian Date

Walter Zambotti zambotti at iinet.net.au
Wed May 24 03:35:07 EDT 2017


Wayne

I have figured something out.

This works perfectly in BASIC09 as long as you use the 6809 version of basic09.

The problem only arises when the 6309 version is used!

Bug in the 6309 version which produces error in VCC 2.0

Hitting DIVQ_X

And then crashes VCC completely.

So what are you using...

A real CoCo or an emulator?
A 6309 or 6809 CPU?
The 6809 or 6309 version of Basic09?

Regards

Walter

-----Original Message-----
From: Coco [mailto:coco-bounces at maltedmedia.com] On Behalf Of Walter Zambotti
Sent: Wednesday, 24 May 2017 11:35 AM
To: 'CoCoList for Color Computer Enthusiasts' <coco at maltedmedia.com>
Subject: Re: [Coco] Julian Date

So unless one of those value is considered a byte...  However if as you say you are using constants in the expression this should never be the case.

-----Original Message-----
From: Coco [mailto:coco-bounces at maltedmedia.com] On Behalf Of Walter Zambotti
Sent: Wednesday, 24 May 2017 11:33 AM
To: 'CoCoList for Color Computer Enthusiasts' <coco at maltedmedia.com>
Subject: Re: [Coco] Julian Date

The result of 1900 MOD 400 should always be 300 as it 100 short of the next 400 at 2000.

-----Original Message-----
From: Coco [mailto:coco-bounces at maltedmedia.com] On Behalf Of Wayne Campbell
Sent: Wednesday, 24 May 2017 11:29 AM
To: CoCoList <coco at maltedmedia.com>
Subject: Re: [Coco] Julian Date

I have the procedure working, mostly. Two problems.

1. Result shows 1.5 days more than the correct Julian day.
2. I have found a bug in the MOD function (integer version). If you type:

PRINT MOD(1900,400)

The result is 0. It should not be 0 on 1900. There should be a remainder of 3, or .75.

You can verify this by running Basic09, creating a new procedure, typing in the above instruction, closing the editor and running the procedure. I was shocked when I found this. I never expected it.

Wayne


On May 23, 2017 7:37 PM, "Luis Fernández" <luis46coco at hotmail.com> wrote:

> OR
>
>
> FUNCTION FechaJulDMA (tjul, dd, mm, aa) T = tjul + 62
> t2 = FIX(T / 1461) * 4 + 1700
> t1 = T MOD 1461
> IF t1 > 365 THEN
> t1 = t1 - 1
> oa = FIX(t1 / 365)
> t1 = t1 MOD 365
> END IF
> aa = t2 + oa
> dias = t1 + 1
> dd = dias
> swb = 1 - SGN(oa)
> IF dd > 212 + swb THEN dd = dd + 30
> IF dd > 59 + swb THEN dd = dd + 2 - swb mm = FIX(dd / 61) * 2 + 1 dd = 
> dd MOD 61 IF dd > 31 THEN mm = mm + 1: dd = dd - 31 IF mm > 7 THEN mm 
> = mm - 1 FechaJulDMA = dias END FUNCTION
>
>
>
> ------------------------------------------------------------
> ---------------------
>
> Making  CoCoDskUtil V 1.X.X, Scan magazines and organize maltedmedia
>
> http://cococoding.com/cocodskutil/ Thank Aaron Wolfe
>
> http://www.tandycoco.com<http://www.tandycoco.com/> Thank Brian Blake
>
> My personal blog: http://www.luis45ccs.blogspot.com,
>
> Excuse my English, I use google translator, my language is Spanish, 
> I'm Spanish but I live in Venezuela
>
> ------------------------------------------------------------
> ---------------------
>
>
> ________________________________
> De: Coco <coco-bounces at maltedmedia.com> en nombre de phillip taylor < 
> ptaylor2446 at gmail.com>
> Enviado: martes, 23 de mayo de 2017 08:38 p.m.
> Para: CoCoList for Color Computer Enthusiasts
> Asunto: Re: [Coco] Julian Date
>
> Thank you but I did not write this code I got it off the internet.
>
> On Tue, May 23, 2017 at 8:15 PM, Mark McDougall 
> <msmcdoug at iinet.net.au>
> wrote:
>
> > On 24/05/2017 8:46 AM, phillip taylor wrote:
> >
> > I am not sure what you mean by this "At least those skilled in
> > BASIC09
> >> will be able to fund an early retirement! ;)" but there is nothing 
> >> wrong with Basic09 or most of the other compilers that run under 
> >> Rsdos or Microsoft Windows. Cbasic will compile a basic program to 
> >> machine lanuage and will run 1 to 1000 faster then a program written in Basic.
> >>
> >
> > Not sure how you took away that I was criticizing BASIC09 or any 
> > other language from that statement?!?
> >
> > I was referring to the COBOL programmers that retired off the back 
> > of the Y2K problem, implying that the situation would be the same in
> > 2400 (ignoring the fact that it has been pointed out that it isn't 
> > actually a leap year) for BASIC09 programmers.
> >
> > Anyway, if one has to explain one's jokes then I guess they've 
> > fallen flat. :( I tried...
> >
> > Regards,
> >
> > --
> > Mark McDougall
> > <http://retroports.blogspot.com.au>
> >
> > --
> > Coco mailing list
> > Coco at maltedmedia.com
> > https://pairlist5.pair.net/mailman/listinfo/coco
> >
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>

--
Coco mailing list
Coco at maltedmedia.com
https://pairlist5.pair.net/mailman/listinfo/coco


--
Coco mailing list
Coco at maltedmedia.com
https://pairlist5.pair.net/mailman/listinfo/coco


--
Coco mailing list
Coco at maltedmedia.com
https://pairlist5.pair.net/mailman/listinfo/coco



More information about the Coco mailing list