*** empty log message ***
This commit is contained in:
34
mach/6500/libem/write.s
Normal file
34
mach/6500/libem/write.s
Normal file
@@ -0,0 +1,34 @@
|
||||
.define Mwrite
|
||||
|
||||
! This subroutine performs the monitor call write.
|
||||
! Writing is always done to standardoutput.
|
||||
! A zero is returned on exit.
|
||||
! The subroutine WRCH is a special routine of the BBC
|
||||
! microcomputer.
|
||||
|
||||
|
||||
Mwrite:
|
||||
jsr Pop ! get fildes
|
||||
jsr Pop ! get address of characterbuffer
|
||||
stx ADDR ! bufferaddress (lowbyte)
|
||||
sta ADDR+1 ! bufferaddress (highbyte)
|
||||
jsr Pop ! number of characters to be writen.
|
||||
ldy #0
|
||||
1: lda (ADDR),y
|
||||
cmp #10
|
||||
bne 2f
|
||||
pha
|
||||
lda #13
|
||||
jsr WRCH
|
||||
pla
|
||||
2: jsr WRCH
|
||||
iny
|
||||
dex
|
||||
bne 1b
|
||||
tya
|
||||
tax
|
||||
lda #0
|
||||
jsr Push
|
||||
tax
|
||||
rts
|
||||
|
||||
Reference in New Issue
Block a user