home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 1
/
GoldFishApril1994_CD1.img
/
d1xx
/
d183
/
pcq
/
runtime
/
writeint.asm
< prev
next >
Wrap
Assembly Source File
|
1989-02-25
|
801b
|
55 lines
* WriteInt.asm (of PCQ Pascal runtime library)
* Copyright (c) 1989 Patrick Quaid
* Write an integer to a text file. Actually this routine, as
* written, can only be properly applied to Short values.
SECTION one
XREF outbuffer
XREF _p%DOSBase
XREF _LVOWrite
XREF _p%padout
XDEF _p%writeint
_p%writeint:
move.l #outbuffer+31,a0
tst.l d0
bge.s 1$
move.w #-1,-(sp)
neg.l d0
bra.s 2$
1$ move.w #1,-(sp)
2$ divu #10,d0
move.l d0,d1
ext.l d0
swap d1
add.b #'0',d1
move.b d1,(a0)
subq.l #1,a0
tst.l d0
bgt 2$
move.w (sp)+,d0
bgt.s 3$
move.b #'-',(a0)
subq.l #1,a0
3$ move.l a0,d3
sub.l #outbuffer+31,d3
neg.l d3
move.l 6(sp),d1
move.w 4(sp),d0
ext.l d0
sub.l d3,d0
ble 4$
jsr _p%padout
4$ move.l a0,d2
addq.l #1,d2
move.l _p%DOSBase,a6
jsr _LVOWrite(a6)
rts
END