80-Bus News

  

November–December 1984, Volume 3, Issue 6











Page 51 of 55











3 MOVDY1: LD DE, STRING s;POINT DE TO PLACE IN “STRING” FOR sef R ;THE DAY NAME TO BE INSERTED ret LDIR sMOVE THE 3 BYTES

; INC DE ;SPACE BETWEEN DAY NAME AND DATE endif 5END OF ORIG, SYS I.V.C. ROUTINE ENDIF

IF CLOCK sEXTRA CODE TO READ AND DISPLAY CLOCK , IF NKBD ;START OF DATE AND TIME STRING

LD DE,STRNGI 3IN CASE DAY NAME NOT PROCESSED MAY BE CALLED FROM EXTERNAL PROGRAMS VIA JUMP TABLE. RETURNS WITH HL R

POINTING TO CLOCK DATA. ENDIF

EADIT: LD C,RTC+ ;CLOCK PORT 1 ADDRESS INTO -C* LD HL, REGS+7 sPOINTER TO TENS OF DAY OF MONTH LD B, NMRREG ;NUMBER OF REGISTERS TO READ R LD HL, REGS ;POINTER TO MEMORY STORE LD

32 BLOCKS TO MOVE (MONTHS AND DAYS) R MOVTIM: LD

3 MOVIMI: LD » (HL) ;GET BYTE FROM REGS. RDT1: INC c ;LOOP AND READ THEM INTO MEMORY LD E),A ;MOVE IT TO STRING

INI INC DE ;BUMP DESTINATION 5 JR NZ,RDT1 DEC HL ;REDUCE SOURCE POINTER

, DINZ MOVTM1 ;LOOP FOR 2 BYTES EACH TIME 5 LD B, NMRREG ;NOW SCAN THEM ALL IN TURN AND IF TNC DE 3SKIP OVER -/* CHAR.

LD HL,REGS ;ANY ARE ?FH, CLOCK WAS UPDATING, LD HL, REGS+10 sPOINTER TO TENS OF MONTHS R 380 READ “EM ALL AGAIN R

; DEC c ;IF -C” NOT ZERO, MONTHS NOT YET SCAN: LD A, CHL) JR NZ ,MOVTIM ;COPIED TO THE STRING AND OFH INC DE sMOVE PAST TENS OF YEAR cp OFH INC DE ;DITTO – UNITS JR Z,READIT INC DE ;NOW SKIP THE SPACE BETWEEN DATE & TIME

; LD HL, REGS+5 ;POINTER TO TENS OF HOURS ADD A, 30H 3AS EACH VALUE VERIFIED, MAKE ASCII R

LD (HL) A 3AND PUT BACK INTO MEMORY STORE LD c,3 s;HOURS, MINS., & SECS. TO MOVE INC HL MOVIM2: LD B,2 32 BYTES TO MOVE EACH TIME ROUND DINZ SCAN MOVIM3: LD A, CHL) 3;SAME AS ABOVE

LD (DE) ,A TORE NOW HOLDS VALID ASCII DATA SO PUT IT INTO A STRING BUFFER FOR SCREEN INC DE

s DISPLAY, STARTING WITH DAY NAME IF SUFFICIENT SPACE FOR THE CODE. DEC HL

DINZ MOVIM3 IF NOT NKBD INC DE

: DEC c MOVDAY: LD DE, DAYO ;POINT TO FIRST DAY NAME DATA. THIS JR NZ, MOVIM2 R 31S BLANK IN CASE ERROR IN CLOCK 0/P 3 LD BC,3 33 CHARS FOR EACH NAME ;CLOCK DATA NOW IN STRING/STRNG1, SO MOVE CURSOR AND PRINT IT LD A, (REGS+8) ;GET DAY OF WEEK DATA : R CSRSAV: LD HL, (CURSOR) ;SAVE EXISTING CONTENTS OF -CURSOR- AND OFH ;REMOVE -ASCII’ PART R ;IN CASE THEY ARE RELEVANT cP 8 PUSH AL Je P,MOVDYL ;IF >7, ERROR SO PRINT BLANK NAME CALL – SAVCUR ;NOW SAVE CURRENT POSITION IN “CURSOR’ R R LD HL, 0000 ;ELSE MULT. DATA BY 3 ; LD LA ; AND ADD TO DAYO POINTER SO AS TO CSROFF: LD A, O1BH ADD A,L ;POINT TO CORRECT DAY NAME CALL —- CRTX ADD A,L LD LA LD A,"D” ADD HL, DE 3HL NOW POINTS TO CORRECT NAME CALL —-CRTX

or -_

an en en on

;TURN OFF CURSOR WHILE PRINTING CLOCK


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











Page 51 of 55