From 74c2415795e789443c6ba8929c2f8cb89b61f52c Mon Sep 17 00:00:00 2001 From: Greg King Date: Wed, 10 Sep 2014 19:15:07 -0400 Subject: [PATCH] Changed literal zeroes of the style "#>0" into the style "#>$0000". --- libsrc/atmos/mainargs.s | 10 +++++----- libsrc/atmos/tgi/atmos-228-200-3.s | 14 +++++++------- libsrc/atmos/tgi/atmos-240-200-2.s | 10 +++++----- libsrc/atmos/toascii.s | 2 +- libsrc/c128/mou/c128-inkwell.s | 14 ++++++++------ libsrc/c64/mou/c64-inkwell.s | 10 ++++++---- libsrc/cbm510/mainargs.s | 8 ++++---- libsrc/cbm510/mou/cbm510-inkwl.s | 10 ++++++---- libsrc/cbm510/mou/cbm510-joy.s | 16 ++++++++-------- libsrc/cbm610/mainargs.s | 8 ++++---- libsrc/common/_scanf.c | 6 +++--- libsrc/common/isgraph.s | 4 ++-- libsrc/common/ispunct.s | 4 ++-- libsrc/common/vsscanf.s | 14 +++++++------- libsrc/conio/vcscanf.s | 6 +++--- libsrc/runtime/imul8x8r16.s | 8 ++++---- 16 files changed, 75 insertions(+), 69 deletions(-) diff --git a/libsrc/atmos/mainargs.s b/libsrc/atmos/mainargs.s index 639b1304a..d6d9ed1ef 100644 --- a/libsrc/atmos/mainargs.s +++ b/libsrc/atmos/mainargs.s @@ -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 #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 diff --git a/libsrc/atmos/tgi/atmos-228-200-3.s b/libsrc/atmos/tgi/atmos-228-200-3.s index 30b7ca65f..ae9b0f775 100644 --- a/libsrc/atmos/tgi/atmos-228-200-3.s +++ b/libsrc/atmos/tgi/atmos-228-200-3.s @@ -2,7 +2,7 @@ ; Graphics driver for the 228x200x3 palette mode on the Atmos ; ; Stefan Haubenthal -; 2013-07-15, Greg King +; 2014-09-10, Greg King ; .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. ; diff --git a/libsrc/atmos/tgi/atmos-240-200-2.s b/libsrc/atmos/tgi/atmos-240-200-2.s index 600d93193..943ec5389 100644 --- a/libsrc/atmos/tgi/atmos-240-200-2.s +++ b/libsrc/atmos/tgi/atmos-240-200-2.s @@ -2,7 +2,7 @@ ; Graphics driver for the 240x200x2 monochrome mode on the Atmos ; ; Stefan Haubenthal -; 2013-07-16, Greg King +; 2014-09-10, Greg King ; .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 diff --git a/libsrc/atmos/toascii.s b/libsrc/atmos/toascii.s index 69e0cf07a..77f050021 100644 --- a/libsrc/atmos/toascii.s +++ b/libsrc/atmos/toascii.s @@ -8,7 +8,7 @@ .proc _toascii ; .X must be zero, on return. - ldx #>0 + ldx #>$0000 rts .endproc diff --git a/libsrc/c128/mou/c128-inkwell.s b/libsrc/c128/mou/c128-inkwell.s index 8583e4bfe..45d42f2db 100644 --- a/libsrc/c128/mou/c128-inkwell.s +++ b/libsrc/c128/mou/c128-inkwell.s @@ -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 diff --git a/libsrc/c64/mou/c64-inkwell.s b/libsrc/c64/mou/c64-inkwell.s index a48d7d15e..9c876a7c8 100644 --- a/libsrc/c64/mou/c64-inkwell.s +++ b/libsrc/c64/mou/c64-inkwell.s @@ -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 diff --git a/libsrc/cbm510/mainargs.s b/libsrc/cbm510/mainargs.s index 542b1ec65..7eebccbb3 100644 --- a/libsrc/cbm510/mainargs.s +++ b/libsrc/cbm510/mainargs.s @@ -3,7 +3,7 @@ ; 2003-03-07, Ullrich von Bassewitz, ; based on code from Stefan A. Haubenthal, ; 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 #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 diff --git a/libsrc/cbm510/mou/cbm510-inkwl.s b/libsrc/cbm510/mou/cbm510-inkwl.s index b17f6408a..91bc52fcd 100644 --- a/libsrc/cbm510/mou/cbm510-inkwl.s +++ b/libsrc/cbm510/mou/cbm510-inkwl.s @@ -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 diff --git a/libsrc/cbm510/mou/cbm510-joy.s b/libsrc/cbm510/mou/cbm510-joy.s index af53b7c23..8aa3a778e 100644 --- a/libsrc/cbm510/mou/cbm510-joy.s +++ b/libsrc/cbm510/mou/cbm510-joy.s @@ -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). diff --git a/libsrc/cbm610/mainargs.s b/libsrc/cbm610/mainargs.s index 9b9aea650..9388eac81 100644 --- a/libsrc/cbm610/mainargs.s +++ b/libsrc/cbm610/mainargs.s @@ -3,7 +3,7 @@ ; 2003-03-07, Ullrich von Bassewitz, ; based on code from Stefan A. Haubenthal, ; 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 #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 diff --git a/libsrc/common/_scanf.c b/libsrc/common/_scanf.c index 9a3bf280c..c18f1e289 100644 --- a/libsrc/common/_scanf.c +++ b/libsrc/common/_scanf.c @@ -2,7 +2,7 @@ ** _scanf.c ** ** (c) Copyright 2001-2005, Ullrich von Bassewitz -** 2005-01-24, Greg King +** 2014-09-10, Greg King ** ** 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__); } diff --git a/libsrc/common/isgraph.s b/libsrc/common/isgraph.s index 7b1daa62e..bf94014ec 100644 --- a/libsrc/common/isgraph.s +++ b/libsrc/common/isgraph.s @@ -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 diff --git a/libsrc/common/ispunct.s b/libsrc/common/ispunct.s index bf31efb1a..087532940 100644 --- a/libsrc/common/ispunct.s +++ b/libsrc/common/ispunct.s @@ -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 diff --git a/libsrc/common/vsscanf.s b/libsrc/common/vsscanf.s index 2bd967fa0..335712b20 100644 --- a/libsrc/common/vsscanf.s +++ b/libsrc/common/vsscanf.s @@ -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 diff --git a/libsrc/conio/vcscanf.s b/libsrc/conio/vcscanf.s index eb1c5a43a..67d5f664f 100644 --- a/libsrc/conio/vcscanf.s +++ b/libsrc/conio/vcscanf.s @@ -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 diff --git a/libsrc/runtime/imul8x8r16.s b/libsrc/runtime/imul8x8r16.s index 017297e4b..e1aea30ae 100644 --- a/libsrc/runtime/imul8x8r16.s +++ b/libsrc/runtime/imul8x8r16.s @@ -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 -- 2.39.5