aboutsummaryrefslogtreecommitdiffstats
path: root/c/libc.s
diff options
context:
space:
mode:
Diffstat (limited to 'c/libc.s')
-rw-r--r--c/libc.s10
1 files changed, 9 insertions, 1 deletions
diff --git a/c/libc.s b/c/libc.s
index 5b81dca..c245bbd 100644
--- a/c/libc.s
+++ b/c/libc.s
@@ -200,7 +200,7 @@ _reap:
rst #0x30
ret
- .globl _bfill, _bpeek
+ .globl _bfill, _bpeek, _bpeek2
;; void bfill(unsigned char block /*A*/, unsigned char byte /*E*/)
_bfill:
ld b, a
@@ -210,6 +210,14 @@ _bfill:
;; unsigned char bpeek(unsigned char block /*A*/) -> A
_bpeek:
ld b, a
+ ld e, #0
ld c, #24 ; SYS_BPEEK
rst #0x30
ret
+ ;; unsigned char bpeek2(unsigned char block /*A*/, unsigned char off /*E*/) -> A
+_bpeek2:
+ ld b, a
+ ld c, #24 ; SYS_BPEEK (off already in E)
+ rst #0x30
+ ret
+