-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprint.asm
More file actions
42 lines (38 loc) · 1.1 KB
/
print.asm
File metadata and controls
42 lines (38 loc) · 1.1 KB
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
include "globals.inc"
org printbase
; Print text on screen
;
; Parameters:
; screen address
; character base address (characters starting at $20)
; null terminated ASCII string
ld ix,printparam+4
plp: ld a,(ix+0) ; Read ASCII
inc ix
sub $20
ret c
ld h,0 ; Calculate character base address
ld l,a
add hl,hl
add hl,hl
add hl,hl
ld de,(printparam)
add hl,de
ld de,(printparam+2) ; Screen address
ld b,8
clp: ld a,(hl)
ld (de),a
inc hl
inc d
djnz clp
ld hl,$1-$800
add hl,de
ld (printparam+2),hl
jr plp
printparam:
;dw $3d00 ; Character set address
;dw $4000 ; Screen base address
;db "Hello world",0
; Passed to Python payload builder
PRINT_ROUTINE equ printbase
PRINT_PARAM equ printparam