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
|
;;
;; .bac loader test program
;;
defc CONWRITE=000Bh
defc IPSAV=65338
_start:
;; After this, do CHAIN "NUL:"
ld de,chain_nul-1
ld a,e
sub l
ld (hl),a
ld a,d
sbc h
inc hl
ld (hl),a
ld hl,hello
ld c,hello_len
ld b,0
call CONWRITE
ld hl,world
ld c,world_len
ld b,0
call CONWRITE
ret
hello:
defm "Hello, "
hello_end:
defc hello_len=hello_end-hello
defm "BAD"
world:
defm "World!\r\n"
world_end:
defc world_len=world_end-world
defm "BAD"
;; BASIC bytecode for CHAIN "NUL:"
chain_nul:
defb 134, 11 ; CHAIN
defb 203, 4 ; String, 4 bytes
defm "NUL:"
defb 185 ; POP string (end expression)
|