Subversion Repositories NedoOS

Rev

Rev 1485 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log

Rev 1485 Rev 1486
Line 45... Line 45...
45
  jr nc,$+3;+_
45
  jr nc,$+3;+_
46
  inc hl
46
  inc hl
47
;_:
47
;_:
48
  call strtox_sub0
48
  call strtox_sub0
49
TItox_stepin:
49
TItox_stepin:
-
 
50
;bc=exp-1
50
;Gotta multiply the number at (xOP1) by 2^64
51
;Gotta multiply the number at (xOP1) by 2^64
51
 
52
 
52
;Save the location of the ending byte of the string
53
;Save the location of the ending byte of the string
53
  ld (strtox_ptr),hl
54
  ld (strtox_ptr),hl
54
  ld d,100
55
  ld d,100
Line 112... Line 113...
112
  ld h,a
113
  ld h,a
113
  ld (xOP1+6),hl
114
  ld (xOP1+6),hl
114
  ld (xOP1+8),bc
115
  ld (xOP1+8),bc
115
  pop bc
116
  pop bc
116
;now (xOP1) is our number, need to multiply by power of 10!
117
;now (xOP1) is our number, need to multiply by power of 10!
117
;Power of 10 is stored in B, need to put in A first
118
;Power of 10 is stored in BC, need to put in A first
118
  xor a
119
  xor a
119
  sub b
120
  or b;sub b ;Alone Coder
120
  ld de,pow10table+120
121
  ld de,pow10table+120
121
  jp p,strtox_powp;+_
122
  jp p,strtox_powp;+_
122
  xor a : sub c : ld c,a
123
  xor a : sub c : ld c,a
123
  sbc a,a : sub b : ld b,a
124
  sbc a,a : sub b : ld b,a
124
  ld de,pown10table+120
125
  ld de,pown10table+120
Line 234... Line 235...
234
  ld a,b
235
  ld a,b
235
  sbc a,d
236
  sbc a,d
236
  ld b,a
237
  ld b,a
237
  ret
238
  ret
238
str_xeng_add;_:
239
str_xeng_add;_:
239
 
-
 
240
  add a,e
240
  add a,e
241
  ld c,a
241
  ld c,a
242
  ld a,d
242
  ld a,d
243
  adc a,b
243
  adc a,b
244
  ld b,a
244
  ld b,a
245
  ret
245
  ret
-
 
246
 
246
xOP1_xtimes_256:
247
xOP1_xtimes_256:
247
  push bc
248
  push bc
248
  ld e,8
249
  ld e,8
249
xOP1_xtimes_2560;_:
250
xOP1_xtimes_2560;_:
250
  or a
251
  or a
251
  ld hl,xOP1
252
  ld hl,xOP1
252
  call xOP1_xtimes_256pp;+_
253
  call xOP1_xtimes_256pp;+_
253
  call xOP1_xtimes_256pp;+_
254
  call xOP1_xtimes_256pp;+_ ;итого 10 раз xOP1_xtimes_sub
254
  rl c
255
  rl c
255
  dec e
256
  dec e
256
  jr nz,xOP1_xtimes_2560;-_
257
  jr nz,xOP1_xtimes_2560;-_
257
  ld a,c
258
  ld a,c
258
  pop bc
259
  pop bc