-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.asm
48 lines (42 loc) · 1.06 KB
/
main.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
;
; main.asm - Main entry point for HelloWorld2
;
; HelloWorld2 is a modified version of the typical Hello, World! application but
; instead of simply displaying the customary message, this application will first
; prompt the user for their name, then say "Hello, Name!"
;
; The primary intent for writing this application is trying to understand how input
; and output routines work
;
; This code is written for the 65xx processor primarily targeting the Commander X16
; architecture.
;
; include CX16 constants
.include "x16.inc"
; Set SYS2061 BASIC code
.org $080D
.segment "STARTUP"
.segment "INIT"
.segment "ONCE"
.segment "CODE"
; Jump to starting point
jmp start
; Include application-specific globals
.include "globals.asm"
; Include my shared/common routines
.include "common.asm"
;
; Application start
;
start:
jsr _writemsg_prompt
jsr inputmsg
jsr writenl
jsr _writemsg_greeting
lda INPUTMSG_PTR
ldx #<(INPUTMSG_PTR+1)
ldy #>(INPUTMSG_PTR+1)
jsr writemsg
lda #EXCLAMATION
jsr CHROUT
rts