X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcc65%2Fcoptptrload.h;h=06790aee58b245104a29e200189aa5e575e45e0b;hb=9b7c16ec4cbb5282642c377272224e3fc825f860;hp=155ca0c88a512108756c9d8445f67bbe5c49f823;hpb=61195d914ee453620d29d1bc5541d2e9f89e15e4;p=cc65 diff --git a/src/cc65/coptptrload.h b/src/cc65/coptptrload.h index 155ca0c88..06790aee5 100644 --- a/src/cc65/coptptrload.h +++ b/src/cc65/coptptrload.h @@ -143,6 +143,77 @@ unsigned OptPtrLoad4 (CodeSeg* S); */ unsigned OptPtrLoad5 (CodeSeg* S); +/* Search for the sequence: + * + * jsr pushax + * ldx #$00 + * lda yyy + * jsr tosaddax + * ldy #$00 + * jsr ldauidx + * + * and replace it by: + * + * sta ptr1 + * stx ptr1+1 + * ldy yyy + * lda (ptr1),y + */ + +unsigned OptPtrLoad6 (CodeSeg* S); +/* Search for the sequence: + * + * jsr pushax + * ldy xxx + * ldx #$00 + * lda (sp),y + * jsr tosaddax + * ldy #$00 + * jsr ldauidx + * + * and replace it by: + * + * sta ptr1 + * stx ptr1+1 + * ldy xxx + * lda (sp),y + * tay + * lda (ptr1),y + */ + +unsigned OptPtrLoad7 (CodeSeg* S); +/* Search for the sequence: + * + * jsr aslax1/shlax1 + * clc + * adc xxx + * tay + * txa + * adc yyy + * tax + * tya + * ldy zzz + * jsr ldaxidx + * + * and replace it by: + * + * stx tmp1 + * asl a + * rol tmp1 + * clc + * adc xxx + * sta ptr1 + * lda tmp1 + * adc yyy + * sta ptr1+1 + * ldy zzz + * lda (ptr1),y + * tax + * dey + * lda (ptr1),y + */ + +unsigned OptPtrLoad11 (CodeSeg* S); /* Search for the sequence: * * clc @@ -161,8 +232,8 @@ unsigned OptPtrLoad5 (CodeSeg* S); * lda (ptr1),y */ -unsigned OptPtrLoad6 (CodeSeg* S); -/* Search for the sequence: +unsigned OptPtrLoad12 (CodeSeg* S); +/* Search for the sequence: * * lda regbank+n * ldx regbank+n+1 @@ -193,7 +264,7 @@ unsigned OptPtrLoad6 (CodeSeg* S); * */ -unsigned OptPtrLoad7 (CodeSeg* S); +unsigned OptPtrLoad13 (CodeSeg* S); /* Search for the sequence: * * lda zp @@ -208,7 +279,7 @@ unsigned OptPtrLoad7 (CodeSeg* S); * lda (zp),y */ -unsigned OptPtrLoad8 (CodeSeg* S); +unsigned OptPtrLoad14 (CodeSeg* S); /* Search for the sequence: * * lda zp @@ -229,7 +300,7 @@ unsigned OptPtrLoad8 (CodeSeg* S); * Must execute before OptPtrLoad10! */ -unsigned OptPtrLoad9 (CodeSeg* S); +unsigned OptPtrLoad15 (CodeSeg* S); /* Search for the sequence: * * lda zp @@ -246,7 +317,7 @@ unsigned OptPtrLoad9 (CodeSeg* S); * lda (zp),y */ -unsigned OptPtrLoad10 (CodeSeg* S); +unsigned OptPtrLoad16 (CodeSeg* S); /* Search for the sequence * * ldy ... @@ -263,7 +334,7 @@ unsigned OptPtrLoad10 (CodeSeg* S); * This step must be executed *after* OptPtrLoad1! */ -unsigned OptPtrLoad11 (CodeSeg* S); +unsigned OptPtrLoad17 (CodeSeg* S); /* Search for the sequence * * ldy ...