mirror of
https://github.com/michaelcmartin/Ophis.git
synced 2024-12-21 12:29:46 +00:00
235 lines
3.3 KiB
HTML
235 lines
3.3 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>tutor4c.oph</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
|
REL="HOME"
|
|
TITLE="Programming with Ophis"
|
|
HREF="book1.html"><LINK
|
|
REL="UP"
|
|
TITLE="Example Programs"
|
|
HREF="a454.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="tutor4b.oph"
|
|
HREF="x481.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="tutor5.oph"
|
|
HREF="x489.html"></HEAD
|
|
><BODY
|
|
CLASS="SECTION"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
SUMMARY="Header navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>Programming with Ophis</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="x481.html"
|
|
ACCESSKEY="P"
|
|
><<< Previous</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
>Example Programs</TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="x489.html"
|
|
ACCESSKEY="N"
|
|
>Next >>></A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="SECTION"
|
|
><H1
|
|
CLASS="SECTION"
|
|
><A
|
|
NAME="TUTOR4C-SRC"
|
|
><TT
|
|
CLASS="FILENAME"
|
|
>tutor4c.oph</TT
|
|
></A
|
|
></H1
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><PRE
|
|
CLASS="PROGRAMLISTING"
|
|
>.include "c64-1.oph"
|
|
|
|
.macro print
|
|
ldx #0
|
|
_loop: lda _1, x
|
|
beq _done
|
|
jsr chrout
|
|
inx
|
|
bne _loop
|
|
_done:
|
|
.macend
|
|
|
|
.macro greet
|
|
lda #30
|
|
jsr delay
|
|
`print hello1
|
|
`print _1
|
|
`print hello2
|
|
.macend
|
|
|
|
lda #147
|
|
jsr chrout
|
|
lda #lower'case
|
|
jsr chrout
|
|
`greet target1
|
|
`greet target2
|
|
`greet target3
|
|
`greet target4
|
|
`greet target5
|
|
`greet target6
|
|
`greet target7
|
|
`greet target8
|
|
`greet target9
|
|
`greet target10
|
|
rts
|
|
|
|
.charmap 'A, "abcdefghijklmnopqrstuvwxyz"
|
|
.charmap 'a, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
|
|
hello1: .byte "Hello, ",0
|
|
hello2: .byte "!", 13, 0
|
|
|
|
target1: .byte "programmer", 0
|
|
target2: .byte "room", 0
|
|
target3: .byte "building", 0
|
|
target4: .byte "neighborhood", 0
|
|
target5: .byte "city", 0
|
|
target6: .byte "nation", 0
|
|
target7: .byte "world", 0
|
|
target8: .byte "Solar System", 0
|
|
target9: .byte "Galaxy", 0
|
|
target10: .byte "Universe", 0
|
|
|
|
; DELAY routine. Executes 2,560*(A) NOP statements.
|
|
delay: tax
|
|
ldy #00
|
|
* nop
|
|
nop
|
|
nop
|
|
nop
|
|
nop
|
|
nop
|
|
nop
|
|
nop
|
|
nop
|
|
nop
|
|
iny
|
|
bne -
|
|
dex
|
|
bne -
|
|
rts</PRE
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
SUMMARY="Footer navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="x481.html"
|
|
ACCESSKEY="P"
|
|
><<< Previous</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="book1.html"
|
|
ACCESSKEY="H"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="x489.html"
|
|
ACCESSKEY="N"
|
|
>Next >>></A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><TT
|
|
CLASS="FILENAME"
|
|
>tutor4b.oph</TT
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="a454.html"
|
|
ACCESSKEY="U"
|
|
>Up</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><TT
|
|
CLASS="FILENAME"
|
|
>tutor5.oph</TT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |