<?xml version="1.0" encoding='utf-8'?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="KERNAL - Page 6 - Wikipedia">
<p>
<a accesskey="1" href="page.php?w=KERNAL&amp;p=5">1.Previous</a><br />
<a accesskey="3" href="page.php?w=KERNAL&amp;p=7">3.Next</a>
</p>
<p>assembler format/syntax), implementing the classic "<a href="page.php?w=Hello_world_program">Hello, world!</a>" program:</p>

<p><syntaxhighlight lang="ca65">    CHROUT  = $ffd2          ; CHROUT is the address of the character output routine    CR      = $0d            ; PETSCII code for Carriage Return     ;    hello:            ldx #0           ; start with character 0 by loading 0 into the x index register    next:            lda message,x    ; load byte from address message+x into the accumulator            beq done         ; if the accumulator holds zero, we're done and want to branch out of the loop            jsr CHROUT       ; call CHROUT to output char to current output device (defaults to screen)            inx              ; increment x to move to the next character            bne next         ; loop back while the last character is not zero (max string length 255 bytes)    done:            rts              ; return from subroutine    ;    message:            .byte "Hello, world!"            .byte CR, 0      ; Carriage Return and zero marking end of string</syntaxhighlight></p><p>
<a accesskey="1" href="page.php?w=KERNAL&amp;p=5">1.Previous</a><br />
<a accesskey="3" href="page.php?w=KERNAL&amp;p=7">3.Next</a>
</p>

<do type="prev" label="Search">
        <go href="search.wml"/>
</do>

</card>
</wml>
