80-Bus News

  

April–June 1982, Volume 1, Issue 2











Page 31 of 55











SIMPLE HANGMAN

0000 ‘

0001

0002 000A OO1A 0000 0005

0003 oooD 0012

0100

C3 ODDS

MACRO-80 3.43 PAGE = 1=1 TITLE SIMPLE HANGMAN

Demo program for ‘Dodo’s’ guide part 6 CP/M – RP/M version

on ae

29/05/82

3; D. R. Hunt ; 02 /06/82

Revision 0.1

+280 ASEG

; System equates for CP/M – RP/M

CONIN EQU 1 ; Get a character from keyboard CONOUT EQU 2 ; Send a character to display LF EQU OAH ; Send a line feed

cs EQU 1AH ; Clear screen character

WBOOT ; Warm boot jump address

BDOS ; BDOS jump address

EQU 0000H EQU 0005H

; Equates for the program CTRLC QU 3

CR BQU ODH NTRYS EQU 12H

The exit character New line character The max. number of trys (must be BCD)

tn on oe

ORG O100H

Start of code for CP/M – RP/M JP START

Skip round patch area and text

wn an

Start of program, to be compatible

ORG OC83H ; ; with Nascom min. config. memory.

JE EEEEHEE IEEE HEHE IEH HERREREREREER SER PATCHES HHH RERE JE E A HIHI HEHEHE IEEE IEEE I Ee

rd

3; The first patch goes to the keyboard and waits for a key ; press. The character is returned in A. The patch must ; preserve all registers and end with a RET. The patch may 3 be up to 16 bytes long. GETCHR: PUSH HL ‘ ; Save all the registers PUSH DE PUSH BC LD C,CONIN CALL BDOS ; POP BC ; POP DE POP HL RET DEFB 0,0,0,0 ;

Wait at keyboard for an input Get the registers back again

Pad the space to 16 bytes

3; The second patch is to send a character to the display. ; The patch must preserve all registers and end with a RET. ; The patch may be up to 16 bytes long.

SIMPLE HANGMAN

0c9% 0c94 0cgs 0696 OC9T 0c98 OC9A ocgoD OC9E OCOF OCAO OCA1 OCA2

OCAS

OCA6 OCAd OCBS OCB4 Occe ocDs

ocDs ocpe OCEO OCE4 OCcES OCEC OcFO OCR4 OCS Ocr9g OcFD ono1

0D05 oDpog opoD QDOE ODOF OD13 OD17 ODIB

PS ES D5 cs 5F OF cD C1 mM Bm Ft cg 00

C3

01

1A 20 20 20 4D 20 47

49 76 75 74 67 6F 20

20 14 TT

02

0005

0000

02

20 20 20 20 50 48 4D

20 65 13 68 68 66

6c 65 6F

03

20 20 20 53 4c 44 44

68 20 T4 6F T4 20

65 72 T2

20 20 20 49 45 4E 48

61 6A 20 715 20 64

74 20 64

MACRO-80 3.43 PAGE 1-2 QUTCHR: PUSH AF PUSH HL PUSH DE PUSH BC LD B,A LD C,CONOUT CALL BDOS POP BC POP DE POP HL POP AF RET DEFB O ;

Save all the registers

Put the char in EB (for CP/M or RP/M)

=

Send the character to the display Get the registers back again

oA on

Pad the space to 16 bytes

The third patch area is to exit from the program. No special precautions are required. The patch may be up to 3 bytes long. XIT: JP WBOOT ;

te on on fd

Jump to CP/M exit

JE HEHEHE HEHEHE HEHEHE HEHEHE RE JEHHEEEEEHEE WORKSPACES HHHHHMHEHEHEHEEE JEEPS EHEIHEI HEHEHE HEHEHE

an en en

RING: DEFB 1,2,3 WBUF: DEFS 10

; The ring counter used by RANDOM o 5

TRYS: DEFS 4 ; 5

The temporary word buffer Trys taken

Table of letters tried The stack space

CHRTRD: DEFS NTRYS DEFS 12H STACK:

RERERREEEREERNE EEE ER EEE EEE EEE EEE EEE EEE JAH EREEEIER OES SACS JHMRIME HME ete REEEEEEE EBERT EHIME Ee

on ae oe

TTLMSG: DEFB cs," SIMPLE HANGMAN",O

MSGi: DEFB "I have just thought of a “

CHRCNT: DEFS 3 DEFB " letter word",0O


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











Page 31 of 55