80-Bus News

  

September-October 1984, Volume 3, Issue 5











Page 34 of 47











Listing One

10

20 7

30 40 50

60 ‘

70

80 *

90 100

wk CALENDAR *** By D. R. Hunt. 2 October 1979

Suitable for Nascom 1/2 fitted with NASBUG “T’ or NAS-SYS monitors. This program occupies approx. 1.5K.

Modified for Gemini CP/M and MBASIC. 22 March 1981

CLS$=CHR$(26): PRINT CLS$;"Calendar"

“ ** Get inputs

RESTORE: F=0;: F1l=0

PRINT: PRINT "Do you require continuous output ? "3 IS=INKEYS: IF IS=""" THEN 160 ELSE IF I$=CHR$(3) THEN END TS=CHRS(ASC(1$) AND SHDF): PRINT 15

IF IS="Y" THEN Fl=1: GOTO 190 ELSE IF 1$<>"N" THEN 140 INPUT “What year "3Y: IF Y>=1753 AND Y=<2999 THEN 230 PRINT "Out of range !": GOTO 190

’ ** Calculate starting day J#YY:GOSUB 490

* ** Print calendar FOR M=] TO 12 READ MS: PRINT CLSS: PRINT TAB(34—INT((LEN(MS)+6)/2))3;MS3" "sY PRINT" =ssa2202 " PRINT" SUN MON TUE WED THU PRI SAT " PRINT" " READ DY: IF F=1 THEN IF M=2 THEN DY=DY+1 FOR D=1 TO DY PRINT TAB(LO*C+1);: IF D<LO THEN PRINT” "; PRINT D;: C=C+l: IF C=7 THEN PRINT: PRINT: PRINT: C=0 NEXT D IF C<>O THEN PRINT PRINT" cay IF Fl=1 OR M=12 THEN 410 PRINT: PRINT TAB(42) "Hit any key to continue.”

IS=INKEY$: IF I$="" THEN 400 ELSE IF I$=CHR$(3) THEN END NEXT M: GOTO 140

*

** Data for months and days

DATA "JANUARY", 31," FEBRUARY", 28, "MARCH" , 31," APRIL" ,30,"MAY", 31, "JUNE", 30 DATA "JULY", 31,""AUGUST", 31,"SEPTEMBER", 30," OCTOBER", 31,"NOVEMBER" , 30 DATA "DECEMBER", 31

“ ** Is it a leap year ? F=l says yes. IF J/1000=INT(J/1000) THEN 550

IF J/400INT(J/400) THEN Fel: GOTO 550 IF J/100*INT(J/100) THEN 550

IF J/4*INT(J/4) THEN F=1 ELSE GOTO 550

540 “ ** What*s the first day ? 550 JisJ-i

560 K=2+J1+INT(J1/4)-INT(J1/100) 570 K#K+INT(J1/400)-INT(J1/1000) 580 C#=K=INT(K/7)*7

590 RETURN

600 *

610 END

Listing Two To Load the IVC/SVC Cursor register

+280 9000” aseg

org

phase

OO1LB esc equ

co000 06 04 ld co02 21 COLL ld coos DB B2 rdy: in C007 OF rrea C008 38 FB jr COOA TE 1d COOB 23 ine co0c D3 Bl out cQ0E 10 F5 djnz colo co ret

coll 1B 59 48 08 chars: defb

end

Listing Three

MACRO-80 3.44 PAGE 1

0100h 0cc000h

lbh

b,4 : Four chars to send hl ,chars a,(Ob2h) ; See if Ivc/SvC ready

e,rdy

a,(hi) 3 Get the character hi

(Oblh) ,a

rdy

esc,"Y",48h,8h ; Cursor control

GM816 Clock Read Routine MACRO-80 3.44 09-Dec-82 PAGE 1

«Z80 0000” aseg

org

»phase

0020 clock equ 000B narreg equ

co00 c3 C014 4p c003 defs co09 regs: defs

100h 0c000h

20h ; Base port of clock 11 3; Number of regs to read

start 6 ; Workspace for results ll 3; Workspace for registers

34


This is an OCR’d version of the scanned page and likely contains recognition errors.











Page 34 of 47