Ver 40 - Optimized PrintStrC

This commit is contained in:
Michaelangel007 2016-02-21 19:14:52 -07:00
parent def41ba95f
commit 3fe629b2f3

View File

@ -5,7 +5,7 @@
.feature leading_dot_in_identifiers
.PC02 ; 65C02
/* Version 39
/* Version 40
printm - a modular micro printf replacement for 65C02
Michael Pohoreski
Copyleft {c} Feb, 2016
@ -99,7 +99,7 @@ don't need "every" feature. Seriously, when was the last time
you _needed_ octal? :-)
printm() has manually been optimized for size. In gcc parlance, `-Os`.
With everything enabled printm() takes up $1B5 = 437 bytes
With everything enabled printm() takes up $1B4 = 436 bytes
(Plus 2 bytes in zero page.)
Whoa! I thought you said this was micro!?
@ -180,7 +180,7 @@ USE_OCT_6 = 0 ; $8C 140 /
USE_PTR_2 = 0 ; $A2 162 \. $A5 (165 bytes) sets ENABLE_HEX
USE_PTR_4 = 0 ; $A1 161 /
USE_STR_A = 1 ; $71 113 \
USE_STR_C = 0 ; $72 114 > $9F (159 bytes)
USE_STR_C = 0 ; $71 113 > $9E (158 bytes)
USE_STR_PASCAL = 0 ; $74 116 /
/*
@ -228,21 +228,21 @@ Demo (All features) + Library text dump:
4130:A2 F1 A0 42 20 8E 41 A2
4138:0F 86 FE 64 FF 8A 20 DA
4140:FD 20 AA 41 20 4C 41 A9
4148:8D 4C ED FD 9C 8E 44 9C
4150:8F 44 9C 90 44 A2 10 F8
4158:06 FE 26 FF A0 FD B9 91
4160:43 79 91 43 99 91 43 C8
4148:8D 4C ED FD 9C 8D 44 9C
4150:8E 44 9C 8F 44 A2 10 F8
4158:06 FE 26 FF A0 FD B9 90
4160:43 79 90 43 99 90 43 C8
4168:D0 F4 CA D0 EB D8 A2 05
4170:88 B9 91 43 4A 4A 4A 4A
4170:88 B9 90 43 4A 4A 4A 4A
4178:18 69 B0 20 ED FD CA B9
4180:91 43 29 0F 18 69 B0 20
4180:90 43 29 0F 18 69 B0 20
4188:ED FD CA 10 E3 60 86 FC
4190:84 FD A0 00 B1 FC F0 06
4198:20 ED FD C8 D0 F6 60 A2
41A0:08 85 FE 06 FE 6A CA D0
41A8:FA 60 A9 A0 4C ED FD 98
41B0:20 C1 FB A6 28 A4 29 8E
41B8:88 44 8C 89 44 60 D8 BD
41B8:87 44 8C 88 44 60 D8 BD
41C0:23 A0 D9 BD 64 A0 A4 BD
41C8:78 BA 40 A0 25 FE 3F 00
41D0:BE 41 27 00 BF 00 DE C0
@ -284,62 +284,62 @@ Demo (All features) + Library text dump:
42F0:00 A0 E2 F9 F4 E5 F3 8D
42F8:A0 A0 A0 A0 AE E6 E5 E1
4300:F4 F5 F2 E5 F3 A0 BD A0
4308:A4 A0 A0 00 B5 01 8E 24
4308:A4 A0 A0 00 B4 01 8E 24
4310:43 8C 25 43 20 1F 43 8E
4318:73 43 8C 74 43 80 53 20
4320:23 43 AA AD DE C0 EE 24
4328:43 D0 03 EE 25 43 A8 86
4330:FE 84 FF 60 18 20 1F 43
4338:90 03 20 62 44 8A 20 62
4338:90 03 20 61 44 8A 20 61
4340:44 80 27 18 20 1F 43 A0
4348:00 B1 FE 90 F1 AA C8 B1
4350:FE 80 E7 20 1F 43 B1 FE
4358:10 0B 20 87 44 E6 FE D0
4358:10 0B 20 86 44 E6 FE D0
4360:F5 E6 FF 80 F1 09 80 20
4368:87 44 EE 73 43 D0 03 EE
4368:86 44 EE 73 43 D0 03 EE
4370:74 43 AD DE C0 F0 BC 30
4378:EE A2 2D CA CA CA 30 EA
4380:DD 96 44 D0 F6 7C 97 44
4380:DD 95 44 D0 F6 7C 96 44
4388:A9 02 2C A9 01 2C A9 00
4390:8D B9 43 20 1F 43 9C 8E
4398:44 9C 8F 44 9C 90 44 A2
4390:8D B9 43 20 1F 43 9C 8D
4398:44 9C 8E 44 9C 8F 44 A2
43A0:10 F8 06 FE 26 FF A0 FD
43A8:B9 91 43 79 91 43 99 91
43A8:B9 90 43 79 90 43 99 90
43B0:43 C8 D0 F4 CA D0 EB D8
43B8:A0 03 F0 0A B9 8E 44 20
43C0:6F 44 20 87 44 88 B9 8E
43C8:44 20 62 44 88 10 F7 80
43B8:A0 03 F0 0A B9 8D 44 20
43C0:6E 44 20 86 44 88 B9 8D
43C8:44 20 61 44 88 10 F7 80
43D0:99 20 1F 43 8A 10 0A A9
43D8:AD 20 87 44 8A 49 FF AA
43D8:AD 20 86 44 8A 49 FF AA
43E0:E8 86 FE 64 FF A9 01 8D
43E8:B9 43 80 AA A9 31 2C A9
43F0:B1 8D 01 44 20 1F 43 A0
43F8:08 8A 0A AA A9 B0 90 02
4400:A9 B1 20 87 44 88 D0 F1
4400:A9 B1 20 86 44 88 D0 F1
4408:80 C5 A9 06 2C A9 03 8D
4410:2C 44 20 1F 43 A2 00 A5
4418:FE 29 07 18 69 B0 9D 8E
4418:FE 29 07 18 69 B0 9D 8D
4420:44 A0 03 46 FF 66 FE 88
4428:D0 F9 E8 E0 06 D0 E8 CA
4430:30 9D BD 8E 44 20 87 44
4438:80 F5 20 1F 43 A0 00 B1
4440:FE F0 8C 20 87 44 C8 D0
4448:F6 E6 FF 80 F2 20 1F 43
4450:A0 00 B1 FE F0 B2 AA C8
4458:B1 FE 20 87 44 CA D0 F7
4460:F0 A6 20 6F 44 A5 FE 20
4468:87 44 A5 FF 4C 87 44 48
4470:4A 4A 4A 4A 20 7A 44 85
4478:FE 68 29 0F C9 0A 90 02
4480:69 06 69 B0 85 FF 60 8D
4488:DE C0 EE 88 44 60 00 00
4490:00 00 00 00 00 00 3F EC
4498:43 25 EF 43 62 D1 43 75
44A0:88 43 64 8B 43 23 8E 43
44A8:78 35 43 24 34 43 26 44
44B0:43 40 43 43 4F 0A 44 6F
44B8:0D 44 70 4D 44 73 3A 44
44C0:61 53 43
4430:30 9D BD 8D 44 20 86 44
4438:80 F5 20 1F 43 B2 FE F0
4440:8E 20 86 44 E6 FE D0 F5
4448:E6 FF 80 F1 20 1F 43 A0
4450:00 B1 FE F0 B3 AA C8 B1
4458:FE 20 86 44 CA D0 F7 F0
4460:A7 20 6E 44 A5 FE 20 86
4468:44 A5 FF 4C 86 44 48 4A
4470:4A 4A 4A 20 79 44 85 FE
4478:68 29 0F C9 0A 90 02 69
4480:06 69 B0 85 FF 60 8D DE
4488:C0 EE 87 44 60 00 00 00
4490:00 00 00 00 00 3F EC 43
4498:25 EF 43 62 D1 43 75 88
44A0:43 64 8B 43 23 8E 43 78
44A8:35 43 24 34 43 26 44 43
44B0:40 43 43 4F 0A 44 6F 0D
44B8:44 70 4C 44 73 3A 44 61
44C0:53 43
*/
@ -1379,12 +1379,11 @@ DEBUG .sprintf( "PrintStrC() @ %X", * )
PrintStrC:
JSR NxtArgToTemp
LDY #$0
@_NextByte:
LDA (_temp),Y
LDA (_temp)
BEQ _JumpNextFormat1
JSR PutChar
INY
INC _temp+0
BNE @_NextByte
INC _temp+1 ; support strings > 256 chars
BRA @_NextByte