From ca15c088b3c6d3cd14dee96ebbabe33a59d3c5af Mon Sep 17 00:00:00 2001 From: MaartenBrock Date: Fri, 20 Oct 2006 14:11:41 +0000 Subject: [PATCH] * device/lib/gbz80/crt0.s, * device/lib/gbz80/crt0_rle.s, * device/lib/gbz80/div.s, * device/lib/gbz80/fstubs.s, * device/lib/gbz80/heap.s, * device/lib/gbz80/mul.s, * device/lib/gbz80/putchar.s, * device/lib/gbz80/stubs.s, * device/lib/z80/crt0.s, * device/lib/z80/crt0_rle.s, * device/lib/z80/div.s, * device/lib/z80/fstubs.s, * device/lib/z80/heap.s, * device/lib/z80/mul.s, * device/lib/z80/putchar.s, * device/lib/z80/stubs.s: reverted, I was mistaken git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4422 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 23 ++- device/lib/gbz80/crt0.s | 106 ++++++------ device/lib/gbz80/crt0_rle.s | 2 +- device/lib/gbz80/div.s | 336 ++++++++++++++++++------------------ device/lib/gbz80/fstubs.s | 6 +- device/lib/gbz80/heap.s | 12 +- device/lib/gbz80/mul.s | 34 ++-- device/lib/gbz80/putchar.s | 12 +- device/lib/gbz80/stubs.s | 54 +++--- device/lib/z80/crt0.s | 34 ++-- device/lib/z80/crt0_rle.s | 2 +- device/lib/z80/div.s | 4 +- device/lib/z80/fstubs.s | 4 +- device/lib/z80/heap.s | 12 +- device/lib/z80/mul.s | 2 +- device/lib/z80/putchar.s | 16 +- device/lib/z80/stubs.s | 2 +- 17 files changed, 340 insertions(+), 321 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7673c3d4..e8e99404 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,27 @@ +2006-10-20 Maarten Brock + + * device/lib/gbz80/crt0.s, + * device/lib/gbz80/crt0_rle.s, + * device/lib/gbz80/div.s, + * device/lib/gbz80/fstubs.s, + * device/lib/gbz80/heap.s, + * device/lib/gbz80/mul.s, + * device/lib/gbz80/putchar.s, + * device/lib/gbz80/stubs.s, + * device/lib/z80/crt0.s, + * device/lib/z80/crt0_rle.s, + * device/lib/z80/div.s, + * device/lib/z80/fstubs.s, + * device/lib/z80/heap.s, + * device/lib/z80/mul.s, + * device/lib/z80/putchar.s, + * device/lib/z80/stubs.s: reverted, I was mistaken + 2006-10-20 Frieder Ferlemann * src/mcs51/peeph.def: peephole 238.x added check for notvolatile - * support/regression/ports/mcs51/support.c: removed race - condition on TI in _putchar allowing to use serial port mode 0 + * support/regression/ports/mcs51/support.c: removed race + condition on TI in _putchar allowing to use serial port mode 0 2006-10-20 Borut Razem diff --git a/device/lib/gbz80/crt0.s b/device/lib/gbz80/crt0.s index eda72140..814b43ed 100644 --- a/device/lib/gbz80/crt0.s +++ b/device/lib/gbz80/crt0.s @@ -1,68 +1,68 @@ - ;; Generic crt0.s for a GBZ80 - .globl _main + ;; Generic crt0.s for a GBZ80 + .globl _main - .area HEADER (ABS) - ;; Reset vector - .org 0 - jp init + .area _HEADER (ABS) + ;; Reset vector + .org 0 + jp init - .org 0x08 - reti - .org 0x10 - reti - .org 0x18 - reti - .org 0x20 - reti - .org 0x28 - reti - .org 0x30 - reti - .org 0x38 - reti + .org 0x08 + reti + .org 0x10 + reti + .org 0x18 + reti + .org 0x20 + reti + .org 0x28 + reti + .org 0x30 + reti + .org 0x38 + reti - .org 0x100 - jp 0x150 - - .org 0x150 + .org 0x100 + jp 0x150 + + .org 0x150 init: - di - ;; Stack at the top of memory. - ld sp,#0xdfff + di + ;; Stack at the top of memory. + ld sp,#0xdfff ;; Setup global data call gsinit - - ;; Use _main instead of main to bypass sdcc's intelligence - call _main - jp _exit - ;; Ordering of segments for the linker. - .area HOME - .area CODE - .area GSINIT - .area GSFINAL - - .area DATA - .area BSS - .area HEAP + ;; Use _main instead of main to bypass sdcc's intelligence + call _main + jp _exit + + ;; Ordering of segments for the linker. + .area _HOME + .area _CODE + .area _GSINIT + .area _GSFINAL + + .area _DATA + .area _BSS + .area _HEAP - .area CODE + .area _CODE __clock:: - ld a,#2 - rst 0x08 - ret - + ld a,#2 + rst 0x08 + ret + _exit:: - ;; Exit - special code to the emulator - ld a,#0 - rst 0x08 + ;; Exit - special code to the emulator + ld a,#0 + rst 0x08 1$: - halt - jr 1$ + halt + jr 1$ - .area GSINIT -gsinit:: + .area _GSINIT +gsinit:: - .area GSFINAL + .area _GSFINAL ret diff --git a/device/lib/gbz80/crt0_rle.s b/device/lib/gbz80/crt0_rle.s index 8b0e8467..859a6ae3 100644 --- a/device/lib/gbz80/crt0_rle.s +++ b/device/lib/gbz80/crt0_rle.s @@ -1,4 +1,4 @@ - .area CODE + .area _CODE ;; Special RLE decoder used for initing global data __initrleblock:: diff --git a/device/lib/gbz80/div.s b/device/lib/gbz80/div.s index 7dfcbdff..d2ac308d 100644 --- a/device/lib/gbz80/div.s +++ b/device/lib/gbz80/div.s @@ -1,5 +1,5 @@ - ;; Originally from GBDK by Pascal Felber. - .area CODE + ;; Originally from GBDK by Pascal Felber. + .area _CODE __divschar_rrx_s:: ld hl,#2+1 @@ -15,10 +15,10 @@ __divschar_rrx_hds:: call .div8 - ld e,c + ld e,c ld d,b - ret + ret __modschar_rrx_s:: ld hl,#2+1 @@ -32,11 +32,11 @@ __modschar_rrx_s:: __modschar_rrx_hds:: ld c,l - call .div8 + call .div8 ;; Already in DE - ret + ret __divsint_rrx_s:: ld hl,#2+3 @@ -53,15 +53,15 @@ __divsint_rrx_s:: ;; Fall through __divsint_rrx_hds:: - ld b,h - ld c,l + ld b,h + ld c,l - call .div16 + call .div16 - ld e,c - ld d,b + ld e,c + ld d,b - ret + ret __modsint_rrx_s:: ld hl,#2+3 @@ -78,16 +78,16 @@ __modsint_rrx_s:: ;; Fall through __modsint_rrx_hds:: - ld b,h - ld c,l + ld b,h + ld c,l - call .div16 + call .div16 ;; Already in DE - ret + ret - ;; Unsigned + ;; Unsigned __divuchar_rrx_s:: ld hl,#2+1 add hl,sp @@ -99,12 +99,12 @@ __divuchar_rrx_s:: ;; Fall through __divuchar_rrx_hds:: ld c,l - call .divu8 + call .divu8 - ld e,c + ld e,c ld d,b - ret + ret __moduchar_rrx_s:: ld hl,#2+1 @@ -117,7 +117,7 @@ __moduchar_rrx_s:: ;; Fall through __moduchar_rrx_hds:: ld c,l - call .divu8 + call .divu8 ;; Already in DE @@ -138,14 +138,14 @@ __divuint_rrx_s:: ;; Fall through __divuint_rrx_hds:: - ld b,h - ld c,l - call .divu16 + ld b,h + ld c,l + call .divu16 - ld e,c - ld d,b + ld e,c + ld d,b - ret + ret __moduint_rrx_s:: ld hl,#2+3 @@ -162,170 +162,170 @@ __moduint_rrx_s:: ;; Fall through __moduint_rrx_hds:: - ld b,h - ld c,l + ld b,h + ld c,l - call .divu16 + call .divu16 ;; Already in DE - ret + ret .div8:: .mod8:: - ld a,c ; Sign extend - rlca - sbc a - ld b,a - ld a,e ; Sign extend - rlca - sbc a - ld d,a - - ; Fall through to .div16 - - ;; 16-bit division - ;; - ;; Entry conditions - ;; BC = dividend - ;; DE = divisor - ;; - ;; Exit conditions - ;; BC = quotient - ;; DE = remainder - ;; If divisor is non-zero, carry=0 - ;; If divisor is 0, carry=1 and both quotient and remainder are 0 - ;; - ;; Register used: AF,BC,DE,HL + ld a,c ; Sign extend + rlca + sbc a + ld b,a + ld a,e ; Sign extend + rlca + sbc a + ld d,a + + ; Fall through to .div16 + + ;; 16-bit division + ;; + ;; Entry conditions + ;; BC = dividend + ;; DE = divisor + ;; + ;; Exit conditions + ;; BC = quotient + ;; DE = remainder + ;; If divisor is non-zero, carry=0 + ;; If divisor is 0, carry=1 and both quotient and remainder are 0 + ;; + ;; Register used: AF,BC,DE,HL .div16:: .mod16:: - ;; Determine sign of quotient by xor-ing high bytes of dividend - ;; and divisor. Quotient is positive if signs are the same, negative - ;; if signs are different - ;; Remainder has same sign as dividend - ld a,b ; Get high byte of dividend - ld (.srem),a ; Save as sign of remainder - xor d ; Xor with high byte of divisor - ld (.squot),a ; Save sign of quotient - ;; Take absolute value of divisor - bit 7,d - jr Z,.chkde ; Jump if divisor is positive - sub a ; Substract divisor from 0 - sub e - ld e,a - sbc a ; Propagate borrow (A=0xFF if borrow) - sub d - ld d,a - ;; Take absolute value of dividend + ;; Determine sign of quotient by xor-ing high bytes of dividend + ;; and divisor. Quotient is positive if signs are the same, negative + ;; if signs are different + ;; Remainder has same sign as dividend + ld a,b ; Get high byte of dividend + ld (.srem),a ; Save as sign of remainder + xor d ; Xor with high byte of divisor + ld (.squot),a ; Save sign of quotient + ;; Take absolute value of divisor + bit 7,d + jr Z,.chkde ; Jump if divisor is positive + sub a ; Substract divisor from 0 + sub e + ld e,a + sbc a ; Propagate borrow (A=0xFF if borrow) + sub d + ld d,a + ;; Take absolute value of dividend .chkde: - bit 7,b - jr Z,.dodiv ; Jump if dividend is positive - sub a ; Substract dividend from 0 - sub c - ld c,a - sbc a ; Propagate borrow (A=0xFF if borrow) - sub b - ld b,a - ;; Divide absolute values + bit 7,b + jr Z,.dodiv ; Jump if dividend is positive + sub a ; Substract dividend from 0 + sub c + ld c,a + sbc a ; Propagate borrow (A=0xFF if borrow) + sub b + ld b,a + ;; Divide absolute values .dodiv: - call .divu16 - ret C ; Exit if divide by zero - ;; Negate quotient if it is negative - ld a,(.squot) - and #0x80 - jr Z,.dorem ; Jump if quotient is positive - sub a ; Substract quotient from 0 - sub c - ld c,a - sbc a ; Propagate borrow (A=0xFF if borrow) - sub b - ld b,a + call .divu16 + ret C ; Exit if divide by zero + ;; Negate quotient if it is negative + ld a,(.squot) + and #0x80 + jr Z,.dorem ; Jump if quotient is positive + sub a ; Substract quotient from 0 + sub c + ld c,a + sbc a ; Propagate borrow (A=0xFF if borrow) + sub b + ld b,a .dorem: - ;; Negate remainder if it is negative - ld a,(.srem) - and #0x80 - ret Z ; Return if remainder is positive - sub a ; Substract remainder from 0 - sub e - ld e,a - sbc a ; Propagate remainder (A=0xFF if borrow) - sub d - ld d,a - ret + ;; Negate remainder if it is negative + ld a,(.srem) + and #0x80 + ret Z ; Return if remainder is positive + sub a ; Substract remainder from 0 + sub e + ld e,a + sbc a ; Propagate remainder (A=0xFF if borrow) + sub d + ld d,a + ret .divu8:: .modu8:: - ld b,#0x00 - ld d,b - ; Fall through to divu16 + ld b,#0x00 + ld d,b + ; Fall through to divu16 .divu16:: .modu16:: - ;; Check for division by zero - ld a,e - or d - jr NZ,.divide ; Branch if divisor is non-zero - ld bc,#0x00 ; Divide by zero error - ld d,b - ld e,c - scf ; Set carry, invalid result - ret + ;; Check for division by zero + ld a,e + or d + jr NZ,.divide ; Branch if divisor is non-zero + ld bc,#0x00 ; Divide by zero error + ld d,b + ld e,c + scf ; Set carry, invalid result + ret .divide: - ld l,c ; L = low byte of dividend/quotient - ld h,b ; H = high byte of dividend/quotient - ld bc,#0x00 ; BC = remainder - or a ; Clear carry to start - ld a,#16 ; 16 bits in dividend + ld l,c ; L = low byte of dividend/quotient + ld h,b ; H = high byte of dividend/quotient + ld bc,#0x00 ; BC = remainder + or a ; Clear carry to start + ld a,#16 ; 16 bits in dividend .dvloop: - ;; Shift next bit of quotient into bit 0 of dividend - ;; Shift next MSB of dividend into LSB of remainder - ;; BC holds both dividend and quotient. While we shift a bit from - ;; MSB of dividend, we shift next bit of quotient in from carry - ;; HL holds remainder - ;; Do a 32-bit left shift, shifting carry to L, L to H, - ;; H to C, C to B - ld (.dcnt),a - rl l ; Carry (next bit of quotient) to bit 0 - rl h ; Shift remaining bytes - rl c - rl b ; Clears carry since BC was 0 - ;; If remainder is >= divisor, next bit of quotient is 1. This - ;; bit goes to carry - push bc ; Save current remainder - ld a,c ; Substract divisor from remainder - sbc e - ld c,a - ld a,b - sbc d - ld b,a - ccf ; Complement borrow so 1 indicates a - ; successful substraction (this is the - ; next bit of quotient) - jr C,.drop ; Jump if remainder is >= dividend - pop bc ; Otherwise, restore remainder - jr .nodrop + ;; Shift next bit of quotient into bit 0 of dividend + ;; Shift next MSB of dividend into LSB of remainder + ;; BC holds both dividend and quotient. While we shift a bit from + ;; MSB of dividend, we shift next bit of quotient in from carry + ;; HL holds remainder + ;; Do a 32-bit left shift, shifting carry to L, L to H, + ;; H to C, C to B + ld (.dcnt),a + rl l ; Carry (next bit of quotient) to bit 0 + rl h ; Shift remaining bytes + rl c + rl b ; Clears carry since BC was 0 + ;; If remainder is >= divisor, next bit of quotient is 1. This + ;; bit goes to carry + push bc ; Save current remainder + ld a,c ; Substract divisor from remainder + sbc e + ld c,a + ld a,b + sbc d + ld b,a + ccf ; Complement borrow so 1 indicates a + ; successful substraction (this is the + ; next bit of quotient) + jr C,.drop ; Jump if remainder is >= dividend + pop bc ; Otherwise, restore remainder + jr .nodrop .drop: - inc sp - inc sp + inc sp + inc sp .nodrop: - ld a,(.dcnt) - dec a ; DEC does not affect carry flag - jr NZ,.dvloop - ;; Shift last carry bit into quotient - ld d,b ; DE = remainder - ld e,c - rl l ; Carry to L - ld c,l ; C = low byte of quotient - rl h - ld b,h ; B = high byte of quotient - or a ; Clear carry, valid result - ret - - .area BSS + ld a,(.dcnt) + dec a ; DEC does not affect carry flag + jr NZ,.dvloop + ;; Shift last carry bit into quotient + ld d,b ; DE = remainder + ld e,c + rl l ; Carry to L + ld c,l ; C = low byte of quotient + rl h + ld b,h ; B = high byte of quotient + or a ; Clear carry, valid result + ret + + .area _BSS .srem: - .ds 0x01 ; Sign of quotient + .ds 0x01 ; Sign of quotient .squot: - .ds 0x01 ; Sign of remainder + .ds 0x01 ; Sign of remainder .dcnt: - .ds 0x01 ; Counter for division + .ds 0x01 ; Counter for division diff --git a/device/lib/gbz80/fstubs.s b/device/lib/gbz80/fstubs.s index 33605173..a1804e7f 100644 --- a/device/lib/gbz80/fstubs.s +++ b/device/lib/gbz80/fstubs.s @@ -1,6 +1,6 @@ ;; Stubs to match between function names - .area CODE + .area _CODE .globl ___slong2fs - -___slong2fs_rrx_s:: + +___slong2fs_rrx_s:: jp ___slong2fs diff --git a/device/lib/gbz80/heap.s b/device/lib/gbz80/heap.s index bb1a8320..06b452fe 100644 --- a/device/lib/gbz80/heap.s +++ b/device/lib/gbz80/heap.s @@ -1,14 +1,14 @@ ;; Stubs that hook the heap in .globl __sdcc_heap_init - - .area GSINIT + + .area _GSINIT call __sdcc_heap_init - - .area HEAP + + .area _HEAP __sdcc_heap_start:: ;; For now just allocate 1k of heap. .ds 1023 - - .area HEAP_END + + .area _HEAP_END __sdcc_heap_end:: .ds 1 diff --git a/device/lib/gbz80/mul.s b/device/lib/gbz80/mul.s index 0cac8db0..5e34c760 100644 --- a/device/lib/gbz80/mul.s +++ b/device/lib/gbz80/mul.s @@ -1,6 +1,6 @@ - ;; Originally from GBDK by Pascal Felber. + ;; Originally from GBDK by Pascal Felber. - .area CODE + .area _CODE __mulschar_rrx_s:: ld hl,#2 @@ -60,21 +60,21 @@ __mulint_rrx_s:: __muluchar_rrx_hds:: __mulint_rrx_hds:: - ;; Parameters: - ;; HL, DE (left, right irrelivent) - ld b,h - ld c,l - - ;; 16-bit multiplication - ;; - ;; Entry conditions - ;; BC = multiplicand - ;; DE = multiplier - ;; - ;; Exit conditions - ;; DE = less significant word of product - ;; - ;; Register used: AF,BC,DE,HL + ;; Parameters: + ;; HL, DE (left, right irrelivent) + ld b,h + ld c,l + + ;; 16-bit multiplication + ;; + ;; Entry conditions + ;; BC = multiplicand + ;; DE = multiplier + ;; + ;; Exit conditions + ;; DE = less significant word of product + ;; + ;; Register used: AF,BC,DE,HL .mul16: ld hl,#0 ld a,b diff --git a/device/lib/gbz80/putchar.s b/device/lib/gbz80/putchar.s index 8eb9dc4d..54596af6 100644 --- a/device/lib/gbz80/putchar.s +++ b/device/lib/gbz80/putchar.s @@ -1,15 +1,15 @@ - .area CODE -_putchar:: -_putchar_rr_s:: + .area _CODE +_putchar:: +_putchar_rr_s:: ld hl,#2 add hl,sp - + ld l,(hl) ld a,#1 rst 0x08 - + ret - + _putchar_rr_dbs:: ld l,e ld a,#1 diff --git a/device/lib/gbz80/stubs.s b/device/lib/gbz80/stubs.s index ebb22252..695588d8 100644 --- a/device/lib/gbz80/stubs.s +++ b/device/lib/gbz80/stubs.s @@ -1,26 +1,26 @@ ;; Stubs to match between function names - .area CODE + .area _CODE .globl __mullong .globl __modslong .globl __modulong .globl __divslong .globl __divulong - .globl __divschar_rrx_s - .globl __divsint_rrx_s - .globl __divuchar_rrx_s - .globl __divuint_rrx_s - .globl __mulschar_rrx_s - .globl __muluchar_rrx_s - .globl __mulint_rrx_s + .globl __divschar_rrx_s + .globl __divsint_rrx_s + .globl __divuchar_rrx_s + .globl __divuint_rrx_s + .globl __mulschar_rrx_s + .globl __muluchar_rrx_s + .globl __mulint_rrx_s .globl __moduchar_rrx_s .globl __modschar_rrx_s .globl __moduint_rrx_s .globl __modsint_rrx_s - .globl __rrulong_rrx_s - .globl __rrslong_rrx_s - .globl __rlulong_rrx_s - .globl __rlslong_rrx_s + .globl __rrulong_rrx_s + .globl __rrslong_rrx_s + .globl __rlulong_rrx_s + .globl __rlslong_rrx_s __mullong_rrx_s:: __mullong_rrf_s:: @@ -45,74 +45,74 @@ __divulong_rrf_s:: __mulint_rrf_s:: ld a,#5 rst 0x08 - jp __mulint_rrx_s + jp __mulint_rrx_s __divsint_rrf_s:: ld a,#5 rst 0x08 - jp __divsint_rrx_s + jp __divsint_rrx_s __divuint_rrf_s:: ld a,#5 rst 0x08 - jp __divuint_rrx_s + jp __divuint_rrx_s __mulschar_rrf_s:: ld a,#5 rst 0x08 - jp __mulschar_rrx_s + jp __mulschar_rrx_s __divschar_rrf_s:: ld a,#5 rst 0x08 - jp __divschar_rrx_s + jp __divschar_rrx_s __muluchar_rrf_s:: ld a,#5 rst 0x08 - jp __muluchar_rrx_s + jp __muluchar_rrx_s __divuchar_rrf_s:: ld a,#5 rst 0x08 - jp __divuchar_rrx_s + jp __divuchar_rrx_s __modschar_rrf_s:: ld a,#5 rst 0x08 - jp __modschar_rrx_s + jp __modschar_rrx_s __moduchar_rrf_s:: ld a,#5 rst 0x08 - jp __moduchar_rrx_s + jp __moduchar_rrx_s __modsint_rrf_s:: ld a,#5 rst 0x08 - jp __modsint_rrx_s + jp __modsint_rrx_s __moduint_rrf_s:: ld a,#5 rst 0x08 - jp __moduint_rrx_s + jp __moduint_rrx_s __rrulong_rrf_s:: ld a,#5 rst 0x08 - jp __rrulong_rrx_s + jp __rrulong_rrx_s __rrslong_rrf_s:: ld a,#5 rst 0x08 - jp __rrslong_rrx_s + jp __rrslong_rrx_s __rlulong_rrf_s:: ld a,#5 rst 0x08 - jp __rlulong_rrx_s + jp __rlulong_rrx_s __rlslong_rrf_s:: ld a,#5 rst 0x08 - jp __rlslong_rrx_s + jp __rlslong_rrx_s diff --git a/device/lib/z80/crt0.s b/device/lib/z80/crt0.s index a87a2baa..7ff5fa43 100644 --- a/device/lib/z80/crt0.s +++ b/device/lib/z80/crt0.s @@ -2,7 +2,7 @@ .module crt0 .globl _main - .area HEADER (ABS) + .area _HEADER (ABS) ;; Reset vector .org 0 jp init @@ -21,11 +21,11 @@ reti .org 0x38 reti - + .org 0x100 init: ;; Stack at the top of memory. - ld sp,#0xffff + ld sp,#0xffff ;; Initialise global variables call gsinit @@ -33,21 +33,21 @@ init: jp _exit ;; Ordering of segments for the linker. - .area HOME - .area CODE - .area GSINIT - .area GSFINAL - - .area DATA - .area BSS - .area HEAP - - .area CODE + .area _HOME + .area _CODE + .area _GSINIT + .area _GSFINAL + + .area _DATA + .area _BSS + .area _HEAP + + .area _CODE __clock:: ld a,#2 rst 0x08 ret - + _exit:: ;; Exit - special code to the emulator ld a,#0 @@ -56,8 +56,8 @@ _exit:: halt jr 1$ - .area GSINIT -gsinit:: + .area _GSINIT +gsinit:: - .area GSFINAL + .area _GSFINAL ret diff --git a/device/lib/z80/crt0_rle.s b/device/lib/z80/crt0_rle.s index f868d71b..e7deb7d9 100644 --- a/device/lib/z80/crt0_rle.s +++ b/device/lib/z80/crt0_rle.s @@ -1,4 +1,4 @@ - .area CODE + .area _CODE ;; Special RLE decoder used for initing global data __initrleblock:: diff --git a/device/lib/z80/div.s b/device/lib/z80/div.s index 5ef13688..19e47457 100644 --- a/device/lib/z80/div.s +++ b/device/lib/z80/div.s @@ -1,5 +1,5 @@ ;; Originally from GBDK by Pascal Felber. - .area CODE + .area _CODE __divschar_rrx_s:: ld hl,#2+1 @@ -329,7 +329,7 @@ __moduint_rrx_hds:: or a ; Clear carry, valid result ret - .area BSS + .area _BSS .srem: .ds 0x01 ; Sign of quotient diff --git a/device/lib/z80/fstubs.s b/device/lib/z80/fstubs.s index 222817f4..b5a196e3 100644 --- a/device/lib/z80/fstubs.s +++ b/device/lib/z80/fstubs.s @@ -1,5 +1,5 @@ ;; Stubs to match between function names - .area CODE + .area _CODE -___slong2fs_rrx_s:: +___slong2fs_rrx_s:: jp ___slong2fs diff --git a/device/lib/z80/heap.s b/device/lib/z80/heap.s index bb1a8320..06b452fe 100644 --- a/device/lib/z80/heap.s +++ b/device/lib/z80/heap.s @@ -1,14 +1,14 @@ ;; Stubs that hook the heap in .globl __sdcc_heap_init - - .area GSINIT + + .area _GSINIT call __sdcc_heap_init - - .area HEAP + + .area _HEAP __sdcc_heap_start:: ;; For now just allocate 1k of heap. .ds 1023 - - .area HEAP_END + + .area _HEAP_END __sdcc_heap_end:: .ds 1 diff --git a/device/lib/z80/mul.s b/device/lib/z80/mul.s index a58e9691..00e6ce9e 100644 --- a/device/lib/z80/mul.s +++ b/device/lib/z80/mul.s @@ -1,6 +1,6 @@ ;; Originally from GBDK by Pascal Felber. - .area CODE + .area _CODE __mulschar_rrx_s:: ld hl,#2 diff --git a/device/lib/z80/putchar.s b/device/lib/z80/putchar.s index d10710ae..123f1f5e 100644 --- a/device/lib/z80/putchar.s +++ b/device/lib/z80/putchar.s @@ -1,19 +1,19 @@ - .area CODE -_putchar:: -_putchar_rr_s:: + .area _CODE +_putchar:: +_putchar_rr_s:: ld hl,#2 add hl,sp - + ld l,(hl) ld a,#1 rst 0x08 - + ret - + _putchar_rr_dbs:: ld l,e - ld a,#1 + ld a,#1 rst 0x08 ret - + diff --git a/device/lib/z80/stubs.s b/device/lib/z80/stubs.s index ebb22252..10211be3 100644 --- a/device/lib/z80/stubs.s +++ b/device/lib/z80/stubs.s @@ -1,5 +1,5 @@ ;; Stubs to match between function names - .area CODE + .area _CODE .globl __mullong .globl __modslong -- 2.30.2