80-Bus News

  

April–June 1982, Volume 1, Issue 2











Page 34 of 55











SIMPLE HANGMAN

OBDF ORE2 OBES ORES

OEE9 OBEA OEEB

CD OEE2 21 ODDO CD ORES cg

TE 23

MACRO-80 3.43

em em om

PAGE 1+7

REGRET

SAME SUBROUTINES FEHR IH Heme

MRKERRAEERRRERR ERE

; This subroutine sends one or two newlines

CRLF2: CRLF 1:

CALL CRLF1 LD HL, CRMSG CALL SNDTRT RET

; This subroutine sends a ; Enter with HL pointing SNDTXT: LD A, (HL) INC HL OR A

line of text up to a 0 to start

Get the character Point to the next

Test it for 0

SIMPLE HANGMAN

OFOF OF1O OF 13 OF15 OF18 OFTA OFIC OF1D OF1E OF20 OF21 OF22 OF24 OF 26 OF29

47 21 OE 3A E6 C6 17 17 cB 23 oD 20 10 3A 92

OCA6

03

OcAs

42 38

16

FA EA

OCA6

MACRO-80 3.43

RNDi:

SHIFT:

RND2:

LD B,A LD HL, RING LD C,3

LD A, (RING+2) AND 42H

ADD A, 38H RLA

RLA

RL (HL)

INC HL

DEC C

JR NZ, SHIFT DINZ RNDt

LD A, (RING) SUB D

PAGE 1-8

OEEC c8 OEED cD 0c93 OEFO 18 FT

RET 2 CALL OUTCHR JR SNDTXT

Return if go... OFZA 30 FD ++» otherwise send it OF2C 82 Get the next oF2eD B1

OF2E nM This subroutine outputs A in HEX OP2F ci

JR NC, RND2

ADD A,D

POP HL 3 Restore the registers POP DE

POP BC Originally from NAS-BUG, rewritten by OF30 cg RET

Yt

; Richard Beal and dealt with at length

; in episode 5 of Dodo’s guide.

OEF2 F5 BeHEX: PUSH AF Save the byte

OEF3 iF RRA Move high nibble ...

ORF4 iF RRA «+» into low nibble OEFS5 1F RRA

OEF6 1F RRA

OEF7 CD OERFB CALL BIHEX Call output routine OEFA Ft POP AF Get the byte back OF31 23

5 Output low half of A in HEX OF32 00 OEFB E6 OF BIHEX: AND OFH Strip the high nibble OF 33 4D 4F 55 53 OEFD c6e 90 ADD A,90H Do the ‘fiddles’ as .. OF37 45 00 OEFF 27 DAA +» described in episode 5 OF39 48 41 54 00 OFOO CE 40 ADC A, 40H OF3D 52 41 42 42 OFO2 27 DAA OFr4t 49 54 00 OFO3 eD 0093 CALL OUTCHR ; Display the nibble OF44 44 4F 4C 4C OFO6 cg RET OFr48 00

OF49 43 41 54 00

OF4D 48 4F 55 53 Originally written by Howard Birkett, rewritten by OFS51 45 00

5 ; ; Richard Beal and ultimately pinched by me! OF53 54 4F 59 53 ; ;

a

REEREEEEEER EERE RAE EERE EERE EEE EEE EHERIEANEEEEE TABLE OF WORDS teeta TET Te NE TE EEE EE EEE EE EE g

on em ee en em om

NOWRDS contains the number of words in the table.

The first byte must be 0, and each word must end in 0. No word should be more than 9 characters long.

NOWRDS: DEFB 35

WORDS: DEFB O

DEFB "MOUSE" ,O

on te en

sa ow

tn ee om

DEFB "HAT" ,O DEFB "RABBIT",O

DEFB "DOLL" ,O

DEFB "CAT" ,O This is the random subroutine. DEFB "HOUSE" ,O

DEFB "TOYS",O Detail explanation is complicated, we’ll leave OP57 00

it until some other time OF58 50 45 47 00 DEFB "PEG" ,O

OF5C 44 4F 47 00

Call with A=n OF60 50 52 41 4D Return A= 0 to n«1 OP64 00

3 OFOT BT RANDOM: OR A ; If the number is 0 reject it OF65 50 49 43 54 OFO8 C8 RET Z OF69 55 52 45 00

OFO9 cs PUSH BC ; Save the registers OF6D 44 49 4B 48 OFOA DS PUSH DE OFT71 45 52 00

OFOB ES PUSH HL OFT4 4% 40 AP 43 OFOC 57 LD D,A OF78 4B 00 OFOD «ED 5F LD AR OF7A 452 41 44 49’

OFTE 4F 00

DEFB "PICTURE" ,O DEFB “DINNER",O DEFB "CLOCK",O

DEFB "RADIO" ,O


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











Page 34 of 55