02.02.2013 Views

ZX Computings - OpenLibra

ZX Computings - OpenLibra

ZX Computings - OpenLibra

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

216 ADC HL.HL<br />

217 EX DE.HL<br />

218 EXX<br />

219 ADC HL,HL<br />

220 JR C.650A,SAVE If a bit drops into the carry, go and<br />

retrieve it for the quotient.<br />

221 SBC HL.DE Trial subtract the divisor.<br />

222 JRNC.650D, NRST Go, if no carry, to no restore.<br />

223 ADD HL.DE Add back the divisor if there was<br />

carry.<br />

224 AND A Clear the carry and go with no bit<br />

225 JR 650E.C0NT for the quotient.<br />

226 SAVE AND A Force no restore and one for the<br />

227 SBC HLDE quotient here.<br />

228 NRST SCF Set the carry flag: one for the<br />

quotient.<br />

229 CONT DJNZ 64F6.DIVL Lop back for each bit of dividend<br />

(32 times!.<br />

230 EXX<br />

231 ADC HL,HI- Move last bit into quotient.<br />

232 EX DE.HL<br />

233 ADC HL.HL<br />

234 EX DE.HL<br />

235 EXX<br />

236 LD A,H Now test the remainder.<br />

237 0RL<br />

238 JR Z.6527,FACT Go if it is zero.<br />

239 AND A Clear the carry.<br />

240 LD HL,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!