4 notes: .ds 16 ; 0x00 .. 0x0f
9 .even ; make next two bytes word-aligned
18 ; aliases for memory locations:
32 ;TODO: move some init stuff here (space for 15 instr.)
44 ADD mod3lo, a ; mod3lo = hi+lo
52 AND a, #0xf ; (mod3lo>>4)
53 XCH mod3lo ; a=mod3lo, mod3lo=mod3lo>>4
54 AND a, #0xF ; a=mod3lo&0xf, mod3lo=mod3lo>>4
55 ADD a, mod3lo ; (mod3lo & 0xF)
59 AND a, #0x3 ; a = (mod3lo & 0x3)
61 SR mod3lo ; (mod3lo >> 2)
65 AND a, #0x3 ; a = (mod3lo & 0x3)
67 SR mod3lo ; (mod3lo >> 2)
76 ; notes_ix_hi = always 0
89 ; note: LSB of result (mul0) is not needed for our purposes
167 ;rom is not mmapped; must load into ram first
192 ;TODO: setup mcu, timer16, ...
193 ;TODO: freepdk calibration routine
196 ;TODO: test i2==0x78 to enter halt()
201 ;TODO: send pwm data to timer2
203 MOV a, i2; "mov mem,mem"
204 MOV n, a; does not exist
224 MOV tmp_1, a ; fresh tmp_1:
229 OR a, tmp_1 ; tmp_1 done.
257 MOV tmp_1, a ; a saved in tmp_1; fresh a
259 ; shift-divide by six
260 ; note: i2 is max 0x78; so a will <= 20. (breaks vor values >=128)
273 AND a, tmp_1 ; a restored from tmp_1
296 MOV tmp_1, a ; a saved in tmp_1; fresh a
298 ; shift-divide by ten
299 ; note: i2 is max 0x78; so a will <= 12.
312 AND a, tmp_1 ; a restored from tmp_1
318 ; next sample is now ready.