From 7c0f9d0477861bfe0356be3a538b89adcc8034ea Mon Sep 17 00:00:00 2001 From: Computer construction kit SmartyKit <42343604+smartykit@users.noreply.github.com> Date: Mon, 2 May 2022 20:07:14 +0300 Subject: [PATCH] Added demo of 6502 'Hello, World!' for a runtime Text pointer with 'Hello, World!' string is located at RAM and string could be changed during the runtime. Uses functions ECHO and RESET of Woz OS from Apple-1, so could be easily run in emulator. --- helloworld-wozos.asm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 helloworld-wozos.asm diff --git a/helloworld-wozos.asm b/helloworld-wozos.asm new file mode 100644 index 0000000..e40578a --- /dev/null +++ b/helloworld-wozos.asm @@ -0,0 +1,25 @@ +;printing 'Hello, World!' at a runtime demo +;More about 'Hello, World!' program: https://en.wikipedia.org/wiki/%22Hello,_World!%22_program + +RESET = $FF00 +ECHO = $FFEF + +TXTPTR = $1000 + +.org $1000 + .byte $0d + .ASCII "Hello, World!" + .byte $0d + .byte $00 + +.org $2000 + LDX #00 +PRINT_CHAR: + LDA TXTPTR,X + BEQ END_PRINT ;end printing at the end of the string (\n=0) + JSR ECHO + INX + JMP PRINT_CHAR +END_PRINT: + JMP RESET ;return to Woz Monitor +