TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: AHEM A RIVET`S SHOT
from: MARTIN GREGORIE
date: 2020-03-09 13:31:00
subject: Re: self hosting on the P

On Mon, 09 Mar 2020 10:02:00 +0000, Ahem A Rivet's Shot wrote:

> Instead of 'next' the pointer field contains 'next xor previous'
> provided you know where you came from 'last' you go to 'last xor
> pointer'
> to continue in the same direction.
>
Very nice!

I hope it was well commented, though, for the benefit of whoever would
modify the code next (this included yourself!)

.....

The worst piece of tricksy, undocumented and uncommented code I remember
seeing was 60 lines (one lineprinter page) of 1900 assembler. It used no
variables or labels: all data was held in the 8 accumulators and all
control transfers were relative jumps. The only comment in the entire
mess was:

Calculate last day in month. Works until Feb 2100.


It was part of an accounting package and used this so statements could be
have the last day of the current month printed on them.

This piece of code was an unnecessary piece of pure bullshit and bravado
because the 1900 held dates as days since 31/12/1899 and had standard
subroutines for converting a "dd/mm/yy" string to the binary form and
back again, so all its author really had to do was

- set dd to O1

- add 1 to MM.

- if mm == 13, set mm to 01 and add 1 to YY
  We now have the first day of the next month

- call GDATEBIN to get a binary date

- subtract 1

- call GBINDATE to get the last day of the month as dd/mm/yy

This worked for any date including leap years in the range 1/1/1900 to
around 31/12/22966, so no need to guess how I calculated the statement
date in our then new replacement accounting system.


--
Martin    | martin at
Gregorie  | gregorie dot org

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.