1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-01 13:41:34 +00:00

Merge pull request #132 from greg-king5/high-zero

Change "#>0" into "#>$0000".
This commit is contained in:
Oliver Schmidt 2014-09-11 08:57:50 +02:00
commit d75f9c2051
16 changed files with 75 additions and 69 deletions

View File

@ -1,9 +1,9 @@
;
; 2003-03-07, Ullrich von Bassewitz
; 2011-01-28, Stefan Haubenthal
; 2013-12-22, Greg King
; 2014-09-10, Greg King
;
; Setup arguments for main
; Set up arguments for main
;
.constructor initmainargs, 24
@ -80,7 +80,7 @@ setterm:sta term ; Set end of argument marker
txa ; Get low byte
add #<args
sta argv,y ; argv[y]= &arg
lda #>0
lda #>$0000
adc #>args
sta argv+1,y
iny
@ -99,7 +99,7 @@ argloop:lda BASIC_BUF,x
; A contains the terminating character. To make the argument a valid C string,
; replace the terminating character by a zero.
lda #0
lda #$00
sta args-1,x
; Check if the maximum number of command line arguments is reached. If not,
@ -130,4 +130,4 @@ args: .res SCREEN_XSIZE * 2 - 1
.data
argv: .addr name
.res MAXARGS * 2, 0
.res MAXARGS * 2, $00

View File

@ -2,7 +2,7 @@
; Graphics driver for the 228x200x3 palette mode on the Atmos
;
; Stefan Haubenthal <polluks@sdf.lonestar.org>
; 2013-07-15, Greg King <gregdk@users.sf.net>
; 2014-09-10, Greg King <gregdk@users.sf.net>
;
.include "zeropage.inc"
@ -275,7 +275,7 @@ mymode: sta PARAM3
lda X1
add #2 * XSIZE ; Skip screen attribute columns
sta PARAM1
lda #0
lda #>$0000
sta PARAM1+1
sta PARAM2+1
sta PARAM3+1
@ -291,13 +291,13 @@ GETPIXEL:
sta PARAM1
lda Y1
sta PARAM2
lda #0
lda #>$0000
sta PARAM1+1
sta PARAM2+1
jsr POINT
lda PARAM1
and #%00000001
ldx #0
ldx #>$0000
rts
; ------------------------------------------------------------------------
@ -323,7 +323,7 @@ LINE:
sta PARAM2+1
lda MODE
sta PARAM3
ldx #>0
ldx #>$0000
stx PARAM3+1
jmp DRAW
@ -359,7 +359,7 @@ BAR:
; ------------------------------------------------------------------------
; TEXTSTYLE: Set the style used when calling OUTTEXT. Text scaling in the x
; and y directions is passend in X/Y, the text direction is passed in A.
; and y directions is passed in X/Y, the text direction is passed in A.
;
; Must set an error code: NO
;
@ -369,7 +369,7 @@ TEXTSTYLE:
; ------------------------------------------------------------------------
; OUTTEXT: Output text at X/Y = ptr1/ptr2 using the current color and the
; OUTTEXT: Output text at x/y = ptr1/ptr2, using the current color and the
; current text style. The text to output is given as a zero-terminated
; string with its address in ptr3.
;

View File

@ -2,7 +2,7 @@
; Graphics driver for the 240x200x2 monochrome mode on the Atmos
;
; Stefan Haubenthal <polluks@sdf.lonestar.org>
; 2013-07-16, Greg King <gregdk@users.sf.net>
; 2014-09-10, Greg King <gregdk@users.sf.net>
;
.include "zeropage.inc"
@ -254,7 +254,7 @@ SETPIXEL:
mymode: sta PARAM3
lda X1
sta PARAM1
lda #0
lda #>$0000
sta PARAM1+1
sta PARAM2+1
sta PARAM3+1
@ -270,13 +270,13 @@ GETPIXEL:
sta PARAM1
lda Y1
sta PARAM2
lda #0
lda #>$0000
sta PARAM1+1
sta PARAM2+1
jsr POINT
lda PARAM1
and #%00000001
ldx #0
ldx #>$0000
rts
; ------------------------------------------------------------------------
@ -302,7 +302,7 @@ LINE:
sta PARAM2+1
lda MODE
sta PARAM3
ldx #>0
ldx #>$0000
stx PARAM3+1
jmp DRAW

View File

@ -8,7 +8,7 @@
.proc _toascii
; .X must be zero, on return.
ldx #>0
ldx #>$0000
rts
.endproc

View File

@ -2,7 +2,7 @@
; Driver for the Inkwell Systems 170-C and 184-C lightpens.
;
; 2014-04-26, Christian Groessler
; 2014-05-01, Greg King
; 2014-09-10, Greg King
;
.include "zeropage.inc"
@ -118,6 +118,8 @@ old_irq: .res 2
; Default Inkwell calibration.
; The first number is the width of the left border;
; the second number is the actual calibration value.
; See a comment below (at "Calculate the new X co-ordinate")
; for the reason for the third number.
XOffset: .byte (24 + 24) / 2 ; x-offset
@ -190,11 +192,11 @@ INSTALL:
; Because it's called via "rts", we must decrement it by one.
iny
lda old_irq
sub #<1
sub #<$0001
sta (ptr3),y
iny
lda old_irq+1
sbc #>1
sbc #>$0001
sta (ptr3),y
cli
@ -334,7 +336,7 @@ MOVE: sei ; No interrupts
BUTTONS:
lda Buttons
ldx #>0
ldx #>$0000
; Make the lightpen buttons look like a 1351 mouse.
@ -434,7 +436,7 @@ IRQ: jsr CPREP
sub #50
tay ; Remember low byte
ldx #>0
ldx #>$0000
; Limit the Y co-ordinate to the bounding box.
@ -475,7 +477,7 @@ IRQ: jsr CPREP
asl a
tay ; Remember low byte
lda #>0
lda #>$0000
rol a
tax ; Remember high byte

View File

@ -1,7 +1,7 @@
;
; Driver for the Inkwell Systems 170-C and 184-C lightpens.
;
; 2013-07-01, Greg King
; 2014-09-10, Greg King
;
.include "zeropage.inc"
@ -102,6 +102,8 @@ OldPenY: .res 1
; Default Inkwell calibration.
; The first number is the width of the left border;
; the second number is the actual calibration value.
; See a comment below (at "Calculate the new X co-ordinate")
; for the reason for the third number.
XOffset: .byte (24 + 24) / 2 ; x-offset
@ -260,7 +262,7 @@ MOVE: sei ; No interrupts
BUTTONS:
lda Buttons
ldx #>0
ldx #>$0000
; Make the lightpen buttons look like a 1351 mouse.
@ -360,7 +362,7 @@ IRQ: jsr CPREP
sub #50
tay ; Remember low byte
ldx #>0
ldx #>$0000
; Limit the Y co-ordinate to the bounding box.
@ -401,7 +403,7 @@ IRQ: jsr CPREP
asl a
tay ; Remember low byte
lda #>0
lda #>$0000
rol a
tax ; Remember high byte

View File

@ -3,7 +3,7 @@
; 2003-03-07, Ullrich von Bassewitz,
; based on code from Stefan A. Haubenthal, <polluks@web.de>
; 2005-02-26, Ullrich von Bassewitz
; 2014-04-02, Greg King
; 2014-09-10, Greg King
;
; Scan a group of arguments that are in BASIC's input-buffer.
; Build an array that points to the beginning of each argument.
@ -106,7 +106,7 @@ setterm:sta term ; Set end-of-argument marker
txa ; Get low byte
add #<BASIC_BUF
sta argv,y ; argv[y]= &arg
lda #>0
lda #>$0000
adc #>BASIC_BUF
sta argv+1,y
iny
@ -125,7 +125,7 @@ argloop:lda BASIC_BUF,x
; A contains the terminating character. To make the argument a valid C string,
; replace the terminating character by a zero.
;
lda #0
lda #$00
sta BASIC_BUF-1,x
; Check if the maximum number of command-line arguments is reached. If not,
@ -153,4 +153,4 @@ name: .res NAME_LEN + 1
.data
argv: .addr name
.res MAXARGS * 2, 0
.res MAXARGS * 2, $00

View File

@ -3,7 +3,7 @@
;
; This driver reads only the main button on the 184-C.
;
; 2013-09-05, Greg King
; 2014-09-10, Greg King
;
.include "zeropage.inc"
@ -103,6 +103,8 @@ OldPenY: .res 1
; Default Inkwell calibration.
; The first number is the width of the left border;
; the second number is the actual calibration value.
; See a comment below (at "Calculate the new X co-ordinate")
; for the reason for the third number.
XOffset: .byte (24 + 24) / 2 ; x-offset
@ -280,7 +282,7 @@ BUTTONS:
asl a ; ... to fire-button bit
eor #MOUSE_BTN_LEFT
and #MOUSE_BTN_LEFT
ldx #>0
ldx #>$0000
rts
;----------------------------------------------------------------------------
@ -362,7 +364,7 @@ IRQ: jsr CPREP
sub #50
tay ; Remember low byte
ldx #>0
ldx #>$0000
; Limit the Y co-ordinate to the bounding box.
@ -408,7 +410,7 @@ IRQ: jsr CPREP
asl a
tay ; Remember low byte
lda #>0
lda #>$0000
rol a
tax ; Remember high byte

View File

@ -2,7 +2,7 @@
; Driver for a "joystick mouse".
;
; 2009-09-26, Ullrich von Bassewitz
; 2013-09-05, Greg King
; 2014-09-10, Greg King
;
.include "zeropage.inc"
@ -266,7 +266,7 @@ BUTTONS:
; Bits go up when buttons go down.
eor #MOUSE_BTN_LEFT | MOUSE_BTN_RIGHT
ldx #>0
ldx #>$0000
rts
;----------------------------------------------------------------------------
@ -358,11 +358,11 @@ IRQ: jsr CPREP
and #JOY::RIGHT << 4 ; Check RIGHT bit
bnz @Right
lda #<-1
lda #<-$0001
tax
bnz @AddX ; Branch always
@Right: lda #<1
ldx #>1
@Right: lda #<$0001
ldx #>$0001
; Calculate the new x co-ordinate (--> .YA).
@ -401,11 +401,11 @@ IRQ: jsr CPREP
and #JOY::UP << 4 ; Check UP bit
bze @Down
lda #<-1
lda #<-$0001
tax
bnz @AddY
@Down: lda #<1
ldx #>1
@Down: lda #<$0001
ldx #>$0001
; Calculate the new y co-ordinate (--> .YA).

View File

@ -3,7 +3,7 @@
; 2003-03-07, Ullrich von Bassewitz,
; based on code from Stefan A. Haubenthal, <polluks@web.de>
; 2005-02-26, Ullrich von Bassewitz
; 2014-04-02, Greg King
; 2014-09-10, Greg King
;
; Scan a group of arguments that are in BASIC's input-buffer.
; Build an array that points to the beginning of each argument.
@ -106,7 +106,7 @@ setterm:sta term ; Set end-of-argument marker
txa ; Get low byte
add #<BASIC_BUF
sta argv,y ; argv[y]= &arg
lda #>0
lda #>$0000
adc #>BASIC_BUF
sta argv+1,y
iny
@ -125,7 +125,7 @@ argloop:lda BASIC_BUF,x
; A contains the terminating character. To make the argument a valid C string,
; replace the terminating character by a zero.
;
lda #0
lda #$00
sta BASIC_BUF-1,x
; Check if the maximum number of command-line arguments is reached. If not,
@ -153,4 +153,4 @@ name: .res NAME_LEN + 1
.data
argv: .addr name
.res MAXARGS * 2, 0
.res MAXARGS * 2, $00

View File

@ -2,7 +2,7 @@
** _scanf.c
**
** (c) Copyright 2001-2005, Ullrich von Bassewitz <uz@cc65.org>
** 2005-01-24, Greg King <greg.king5@ver5z6n.net>
** 2014-09-10, Greg King <greg.king5@verizon.net>
**
** This is the basic layer for all scanf-type functions. It should be
** rewritten in assembly, at some time in the future. So, some of the code
@ -275,7 +275,7 @@ static void __fastcall__ Error (unsigned char /* Code */)
(char*) __AX__ = JumpBuf;
asm ("jsr pushax");
asm ("pla");
asm ("ldx #>0");
asm ("ldx #>$0000");
asm ("jmp %v", longjmp);
}
@ -474,7 +474,7 @@ static char GetFormat (void)
++format;
asm ("ldy #0");
asm ("lda (regsave),y");
asm ("ldx #>0");
asm ("ldx #>$0000");
return (F = (char) __AX__);
}

View File

@ -1,6 +1,6 @@
;
; 1998-06-02, Ullrich von Bassewitz
; 2013-05-01, Greg King
; 2014-09-10, Greg King
;
; int isgraph (int c);
;
@ -9,7 +9,7 @@
.include "ctype.inc"
_isgraph:
cpx #>0 ; Char range OK?
cpx #>$0000 ; Char range OK?
bne @L1 ; Jump if no
tay
lda __ctype,y ; Get character classification

View File

@ -1,6 +1,6 @@
;
; 1998-06-02, Ullrich von Bassewitz
; 2013-05-01, Greg King
; 2014-09-10, Greg King
;
; int ispunct (int c);
;
@ -9,7 +9,7 @@
.include "ctype.inc"
_ispunct:
cpx #>0 ; Char range OK?
cpx #>$0000 ; Char range OK?
bne @L1 ; Jump if no
tay
lda __ctype,y ; Get character classification

View File

@ -3,7 +3,7 @@
; /* Standard C function */
;
; 2004-11-28, Ullrich von Bassewitz
; 2004-12-21, Greg King
; 2014-09-10, Greg King
;
.export _vsscanf
@ -65,7 +65,7 @@
; Return EOF if we are at the end of the string
bne L1
lda #$FF
lda #<-1
tax
rts
@ -74,17 +74,17 @@
L1: tax ; Save return value
tya ; Low byte of index
ldy #SSCANFDATA::INDEX
add #<1
add #<$0001
sta (ptr1),y
iny
lda (ptr1),y
adc #>1
adc #>$0001
sta (ptr1),y
; Return the char just read
txa
ldx #>0
ldx #>$0000
rts
.endproc
@ -111,11 +111,11 @@ L1: tax ; Save return value
ldy #SSCANFDATA::INDEX
lda (ptr1),y
sub #<1
sub #<$0001
sta (ptr1),y
iny
lda (ptr1),y
sbc #>1
sbc #>$0001
sta (ptr1),y
; Return c

View File

@ -1,7 +1,7 @@
;
; int fastcall vcscanf(const char* format, va_list ap);
;
; 2005-01-02, Greg King
; 2014-09-10, Greg King
;
.export _vcscanf
@ -44,7 +44,7 @@ get: ldx pushed
; Return the old, pushed-back character (instead of getting a new one).
;
dex ; ldx #>0
dex ; ldx #>$0000
stx pushed
lda back
rts
@ -58,7 +58,7 @@ L1: jsr _cgetc
pha
jsr _cputc
pla
ldx #>0
ldx #>$0000
rts

View File

@ -1,6 +1,6 @@
;
; 2010-11-02, Ullrich von Bassewitz
; 2014-05-10, Greg King
; 2014-09-10, Greg King
;
; CC65 runtime: 8x8 => 16 signed multiplication
;
@ -23,13 +23,13 @@ imul8x8r16:
sta ptr3
imul8x8r16m:
ldx #>0
ldx #>$0000
bit ptr3
bpl @L7
dex
@L7: stx ptr3+1 ; Extend sign of Left-Hand Side
ldy #<0 ; Clear .XY accumulator
ldx #>0
ldy #<$0000 ; Clear .XY accumulator
ldx #>$0000
lda ptr1
bmi NegMult
bpl @L2 ; Branch always