adapted to new assembler syntax

This commit is contained in:
ceriel 1987-02-03 13:23:38 +00:00
parent 2ed0d80be5
commit fe53d6ed3f
5 changed files with 492 additions and 720 deletions

View file

@ -1,10 +1,16 @@
.data .define atof
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
.sect .data
! Set of variables ! Set of variables
big: .byte 0 big: .data1 0
.byte 0 .data1 0
.byte 0x40 .data1 0x40
.byte 24 ! 2^23 .data1 24 ! 2^23
negfrac:.space 1 negfrac:.space 1
negexp: .space 1 negexp: .space 1
begzero: begzero:
@ -15,17 +21,17 @@ eexp: .space 2
flexp: .space 4 flexp: .space 4
exp5: .space 4 exp5: .space 4
endzero: endzero:
ten: .byte 0 ten: .data1 0
.byte 0 .data1 0
.byte 0x50 .data1 0x50
.byte 4 ! 10 .data1 4 ! 10
dig: .byte 0 dig: .data1 0
.byte 0 .data1 0
fildig: .byte 0 ! here a number from 0 to 31 will be converted flt. fildig: .data1 0 ! here a number from 0 to 31 will be converted flt.
.byte 7 .data1 7
bexp: .space 2 bexp: .space 2
.text .sect .text
atof: ! entry with stringpointer in hl atof: ! entry with stringpointer in hl
! exit with pointer to float in hl ! exit with pointer to float in hl
push ix push ix
@ -177,25 +183,25 @@ atof: ! entry with stringpointer in hl
1: bit 0,l 1: bit 0,l
jr z,2f jr z,2f
call xflt call xflt
.word flexp,exp5,fpmult,4,flexp .data2 flexp,exp5,fpmult,4,flexp
2: sra h 2: sra h
rr l rr l
ld a,h ld a,h
or l or l
jr z,3f jr z,3f
call xflt call xflt
.word exp5,exp5,fpmult,4,exp5 .data2 exp5,exp5,fpmult,4,exp5
jr 1b jr 1b
3: ld hl,negexp 3: ld hl,negexp
ld a,(bexp) ld a,(bexp)
bit 7,(hl) bit 7,(hl)
jr z,1f jr z,1f
call xflt call xflt
.word flexp,fl,fpdiv,4,fl .data2 flexp,fl,fpdiv,4,fl
neg neg
jr 2f jr 2f
1: call xflt 1: call xflt
.word flexp,fl,fpmult,4,fl .data2 flexp,fl,fpmult,4,fl
2: ld b,a 2: ld b,a
ld a,(fl+3) ld a,(fl+3)
add a,b add a,b
@ -204,9 +210,9 @@ atof: ! entry with stringpointer in hl
bit 7,a bit 7,a
jr z,1f jr z,1f
call xflt call xflt
.word fl,fl,fpcomp,4,fl .data2 fl,fl,fpcomp,4,fl
1: call xflt 1: call xflt
.word fl,fl,fpnorm,4,fl .data2 fl,fl,fpnorm,4,fl
ld hl,fl ld hl,fl
pop af pop af
pop de pop de
@ -217,19 +223,19 @@ atof: ! entry with stringpointer in hl
cmpbigfl: cmpbigfl:
call xflt call xflt
.word big,fl,fpcmf,0 .data2 big,fl,fpcmf,0
ld a,(fpac+1) ld a,(fpac+1)
bit 7,a bit 7,a
ret ret
mulandadd: mulandadd:
call xflt call xflt
.word fl,ten,fpmult,4,fl .data2 fl,ten,fpmult,4,fl
ld a,7 ld a,7
ld (fildig+1),a ld (fildig+1),a
call xflt call xflt
.word dig,dig,fpnorm,4,dig .data2 dig,dig,fpnorm,4,dig
call xflt call xflt
.word fl,dig,fpadd,4,fl .data2 fl,dig,fpadd,4,fl
ret ret
xflt: xflt:
@ -278,3 +284,4 @@ xflt:
pop af pop af
ex (sp),iy ex (sp),iy
ret ret
.align 256

View file

@ -1,3 +1,9 @@
.define .dvi4
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
.dvi4: .dvi4:
pop hl pop hl
ld (retaddr),hl ld (retaddr),hl
@ -66,9 +72,9 @@
push bc push bc
push de push de
jp (iy) jp (iy)
.data .sect .data
.flag1: .byte 0 .flag1: .data1 0
.flag2: .byte 0 .flag2: .data1 0
retaddr:.word 0 retaddr:.data2 0
.savebc: .word 0 .savebc: .data2 0
.savede: .word 0 .savede: .data2 0

View file

@ -1,4 +1,9 @@
.define .dvu4 .define .dvu4
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! 4-byte divide routine for z80 ! 4-byte divide routine for z80
! parameters: ! parameters:
@ -129,9 +134,9 @@
ld hl,(.retaddr) ld hl,(.retaddr)
jp (hl) ! return jp (hl) ! return
.data .sect .data
.flag: .byte 0 .flag: .data1 0
.low: .word 0 .low: .data2 0
.iysave: .word 0 .iysave: .data2 0
.retaddr: .word 0 .retaddr: .data2 0
.result: .word 0 .result: .data2 0

View file

@ -1,2 +1,10 @@
.bss .define eb
.define ebp4
.sect .text
.sect .rom
.sect .data
eb: eb:
.data4 0
ebp4:
.sect .bss
.sect .text

File diff suppressed because it is too large Load diff