1
0
mirror of https://github.com/cc65/cc65.git synced 2025-03-01 11:29:27 +00:00

Moved the string that contains the ascii representation of LONG_MIN into its

own file.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5941 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2012-11-26 16:28:46 +00:00
parent c7d6712023
commit 6eefd591c1
3 changed files with 20 additions and 7 deletions

View File

@ -42,6 +42,7 @@ CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
# From C source-files # From C source-files
C_OBJS = _afailed.o \ C_OBJS = _afailed.o \
_hextab.o \ _hextab.o \
_longminstr.o \
_poserror.o \ _poserror.o \
_scanf.o \ _scanf.o \
abort.o \ abort.o \

View File

@ -0,0 +1,15 @@
/*
* Ullrich von Bassewitz, 2012-11-26
*
* Minimum value of a long. Is used in ascii conversions, since this value
* has no positive counterpart than can be represented in 32 bits. In C,
* since the compiler will convert to the correct character set for the
* target platform.
*/
const unsigned char _longminstr[] = "-2147483648";

View File

@ -7,14 +7,11 @@
.export _ltoa, _ultoa .export _ltoa, _ultoa
.import popax .import popax
.import __hextab .import __hextab, __longminstr
.importzp sreg, ptr1, ptr2, ptr3, tmp1 .importzp sreg, ptr1, ptr2, ptr3, tmp1
.rodata
specval:
.byte '-', '2', '1', '4', '7', '4', '8', '3', '6', '4', '8', 0
.code .code
; ;
@ -56,7 +53,7 @@ _ltoa: jsr dopop ; pop the arguments
bne L2 bne L2
ldy #11 ldy #11
L1: lda specval,y ; copy -2147483648 L1: lda __longminstr,y ; copy -2147483648
sta (ptr1),y sta (ptr1),y
dey dey
bpl L1 bpl L1