contiki/platform/c64/lib/logscr.S
Oliver Schmidt fb4c42a357 Added custom log function for CBM machines.
The log function writes directly to the screen. Combined with the usage of PFS this means that the POSIX layer of the C library isn't referenced anymore thus reducing the memory requirements.
2016-10-15 23:36:53 +02:00

39 lines
878 B
ArmAsm

; 2002-11-16, Ullrich von Bassewitz
; 2016-04-28, Greg King
;
; void logscr(const void *msg, unsigned len);
.export _logscr
.import BSOUT
.import popax
.importzp ptr1, ptr2
;--------------------------------------------------------------------------
.proc _logscr
eor #$FF
sta ptr2
txa
eor #$FF
sta ptr2+1 ; remember -count-1
jsr popax ; get buf
sta ptr1
stx ptr1+1
L1: inc ptr2 ; count the char that will be printed
bne L2
inc ptr2+1
beq L9
L2: ldy #$00
lda (ptr1),y
jsr BSOUT
inc ptr1
bne L1
inc ptr1+1
bne L1 ; branch always
L9: rts
.endproc