updated bcd_add() function for new compiler flags

This commit is contained in:
Steven Hugg 2018-11-28 18:19:30 -05:00
parent 5d60110327
commit 6404bfb43c
5 changed files with 65 additions and 64 deletions

View File

@ -85,6 +85,7 @@ TODO:
- live coding URL
- memory viewer: ROM/RAM/VRAM/etc
- resize memory browser when split resize
- preroll the emulator so optimizer does its thing before loading rom
WEB WORKER FORMAT

View File

@ -165,24 +165,24 @@ void draw_bcd_word(word bcd, byte x, byte y, byte op) {
}
// add two 16-bit BCD values
word bcd_add(word a, word b) {
word bcd_add(word a, word b) __naked {
a; b; // to avoid warning
__asm
ld hl,#4
add hl,sp
ld iy,#2
add iy,sp
ld a,0 (iy)
add a, (hl)
daa
ld c,a
ld a,1 (iy)
inc hl
adc a, (hl)
daa
ld b,a
ld l, c
ld h, b
push ix
ld ix,#0
add ix,sp
ld a,4 (ix)
add a, 6 (ix)
daa
ld c,a
ld a,5 (ix)
adc a, 7 (ix)
daa
ld b,a
ld l, c
ld h, b
pop ix
ret
__endasm;
}

View File

@ -87,24 +87,24 @@ void draw_bcd_word(byte x, byte y, word bcd) {
}
// add two 16-bit BCD values
word bcd_add(word a, word b) {
word bcd_add(word a, word b) __naked {
a; b; // to avoid warning
__asm
ld hl,#4
add hl,sp
ld iy,#2
add iy,sp
ld a,0 (iy)
add a, (hl)
daa
ld c,a
ld a,1 (iy)
inc hl
adc a, (hl)
daa
ld b,a
ld l, c
ld h, b
push ix
ld ix,#0
add ix,sp
ld a,4 (ix)
add a, 6 (ix)
daa
ld c,a
ld a,5 (ix)
adc a, 7 (ix)
daa
ld b,a
ld l, c
ld h, b
pop ix
ret
__endasm;
}

View File

@ -185,24 +185,24 @@ void draw_bcd_word(byte x, byte y, word bcd) {
}
// add two 16-bit BCD values
word bcd_add(word a, word b) {
word bcd_add(word a, word b) __naked {
a; b; // to avoid warning
__asm
ld hl,#4
add hl,sp
ld iy,#2
add iy,sp
ld a,0 (iy)
add a, (hl)
daa
ld c,a
ld a,1 (iy)
inc hl
adc a, (hl)
daa
ld b,a
ld l, c
ld h, b
push ix
ld ix,#0
add ix,sp
ld a,4 (ix)
add a, 6 (ix)
daa
ld c,a
ld a,5 (ix)
adc a, 7 (ix)
daa
ld b,a
ld l, c
ld h, b
pop ix
ret
__endasm;
}

View File

@ -181,24 +181,24 @@ void draw_bcd_word(word bcd, byte x, byte y) {
}
// add two 16-bit BCD values
word bcd_add(word a, word b) {
word bcd_add(word a, word b) __naked {
a; b; // to avoid warning
__asm
ld hl,#4
add hl,sp
ld iy,#2
add iy,sp
ld a,0 (iy)
add a, (hl)
daa
ld c,a
ld a,1 (iy)
inc hl
adc a, (hl)
daa
ld b,a
ld l, c
ld h, b
push ix
ld ix,#0
add ix,sp
ld a,4 (ix)
add a, 6 (ix)
daa
ld c,a
ld a,5 (ix)
adc a, 7 (ix)
daa
ld b,a
ld l, c
ld h, b
pop ix
ret
__endasm;
}