|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
|
|
Listing 5ýWant to know how to read a ý9346 using assembly language? Hereýs your huckleberry.
#asm nodebug
clock_9346::
h2l:
ioi bit EESK,(hl)
jr z,h2l
l2h:
ioi bit EESK,(hl)
jr nz,l2h
ret
#endasm
/**********************************/
void emu_9346()
{
#asm
;
; code to emulate the 93C46
;
ld c,1
ld hl,EEPORT
;
; start bit
;
emu_1:
call clock_9346
ioi bit EEDI,(hl)
jr z,emu_1
;
; read 10 - read command
;
emu_2:
call clock_9346
ioi bit EEDI,(hl)
jr z,emu_1
emu_3:
call clock_9346
ioi bit EEDI,(hl)
jr nz,emu_1
;
; six clocks for address
;
ld b,6
emu_4:
call clock_9346
djnz emu_4
;
; send 0
;
xor a
ioi ld (EEDO),a
;
; send word
;
ld a,RT_FDLED0LED1
ld b,16
emu_5:
call clock_9346
ioi ld (EEDO),a
rlca
djnz emu_5
dec c
jp p,emu_1
xor a
ioi ld (EEDO),a
#endasm
}
|
|||||||||||||||||||||||||||||||||
|
Copyright © 2003 ChipCenter-QuestLink About ChipCenter-Questlink |
||||||||||||||||||||||||||||||||||