[Coco] Hello World part2

Robert Gault robert.gault at worldnet.att.net
Wed Jan 21 08:32:03 EST 2004


Here is a slightly modified version of Theodore's Hello World program. 
It is selectable for true lowercase or color mode for text. 
Unfortunately numbers and punctuation have only one color set.

* SLIGHTLY MODIFIED PROGRAM POSTED BY THEODORE EVANS
* NEXT LINE SELECTS BLACK LETTERS GREEN BACKGROUND
* GREEN LETTERS BLACK BACKGROUND OR TRUE LOWERCASE
* ON GREEN BACKGROUND

LETTER  EQU     -1      0=BLACK ON GREEN, 1=GREEN ON BLACK, -1=TRUE

* NEXT LINE CAN BE CHANGED OR REMOVED
	ORG     $7000
* HELLO, WORLD
* CLEAR SCREEN
START    LDX #$0400
	LDA     #$20
	COND    LETTER.NEQ.0
	ADDA    #$40
	ENDC
CLRLP    STA ,X+
	CMPX #$0600
	BLO CLRLP
	COND    LETTER.EQU.-1
	LDA     $FF22
	ORA     #%00010000      ACTIVATE LOWERCASE
	STA     $FF22
	ENDC
* WRITE 'HELLO, WORLD' TO MIDDLE OF SCREEN
	LDX #$04EA
	LDY #HELLO
WRTLP    LDA ,Y+
	BEQ     QUIT
	COND    LETTER.EQU.0
	CMPA    #$20
	BEQ     NOFLP
	ENDC
	CMPA    #'@
	BLO     FLIP
	CMPA    #$60
	BLO     NOFLP
	ANDA    #$DF
FLIP    EORA    #$40
NOFLP   STA ,X+
	BNE WRTLP
QUIT    BRA     QUIT
HELLO	FCC 'Hello, World'
	FCB 0
	END START




More information about the Coco mailing list