Konference: Počítač SHARP MZ-800 a emulátory

Od: marcel vasak
Datum: 26.10.2004 00:05
Předmět: Re: Rozsireni Ramky


Dobrý den,
25. října 2004, 18:23:03, napsal jste:
 MUzes poslat ten program jako *.mzf nebo v podobnem soubou aby sel
 nahrat do sharpa??
 falcen99
DLspc> Schema:

DLspc>         /---------------\'            /---------------\'      
 /----------------\'
DLspc> A06-----|A0 | LS138 |/Q0|     D0-----|D0 | LS273 | Q0|-------|A8 | 29F010
| D0|-----D0
DLspc> A07-----|A1 |       |/Q1|     D1-----|D1 |       | Q1|-------|A9 | amd   
| D1|-----D1
DLspc> A01-----|A2 |       |/Q2|     D2-----|D2 |       | Q2|-------|A10|       
| D2|-----D2
DLspc>         |   |       |/Q3|     D3-----|D3 |       | Q3|-------|A11|       
| D3|-----D3
DLspc>         |   |       |/Q4|     D4-----|D4 |       | Q4|-------|A12|       
| D4|-----D4
DLspc> A02-----|/E0|       |/Q5|     D5-----|D5 |       | Q5|-------|A13|       
| D5|-----D5
DLspc> A03-----|/E1|       |/Q6|     D6-----|D6 |       | Q6|-------|A14|       
| D6|-----D6
DLspc> A04-----|E2 |       |/Q7|--\'  D7-----|D7 |       | Q7|-------|A15|       
| D7|-----D7
DLspc>         \'---------------/  |    Ucc--|/MR|       |   |  Ucc--|A16|       
|   |
DLspc>                            |  /------|CP |       |   |  Ucc--|A17|       
|   |
DLspc>      /---------------------/  |      \'---------------/  Ucc--|A18|       
|   |
DLspc>      |                        |                      A08-----|A0 |       
|/OE|-----/RD
DLspc>      |  /---------------\'     |                      A09-----|A1 |       
|/WR|-----/WR
DLspc> A00-----|A0 | LS138 |/Q0|-----/                      A10-----|A2 |       
|   |
DLspc>      \'--|A1 |       |/Q1|-----\'                      A11-----|A3 |       
|   |
DLspc>      \'--|A2 |       |/Q2|     |                      A12-----|A4 |       
|   |
DLspc>      |  |   |       |/Q3|     |                      A13-----|A5 |       
|   |
DLspc>      |  |   |       |/Q4|     |                      A14-----|A6 |       
|   |
DLspc>      \'--|/E0|       |/Q5|     |                      A15-----|A7 |       
|   |
DLspc> /IORQ---|/E1|       |/Q6|     |                              |   |       
|   |
DLspc> A05-----|E2 |       |/Q7|     \'------------------------------|/CS|       
|   |
DLspc>         \'---------------/                                   
\'----------------/



DLspc> A ROMku jsem naprogramoval. Nasledujici program je pro Flash AMIC 29F040A
z GM

DLspc>
;-------------------------------------------------------------------------------
--------------------
DLspc> ; Cteni 16k z Flash 0c000h - 0ffffh na adresy v ram 08000h- 0Bfffh
DLspc>
;-------------------------------------------------------------------------------
--------------------
DLspc> 1200    ld      HL, 0bfffh      21 FF BF        ; adresa posledniho bajtu
v ram
DLspc>    3    ld      BC, 0ff31h      01 31 FF        ; B = pocitadlo, C =
datovy port
DLspc>    6    xor     A               AF              ; A = vyssi bajt adresy
Flash +1
DLspc>    7    dec     A               3D              ; vyssi bajt adresy Flash
-1
DLspc>    8    out     (030h), A       D3 30           ; posli vyssi bajt adresy
Flash
DLspc>    A    indr                    ED BA           ; cti 255 bajtu z Flash
DLspc>    C    ind                     ED AA           ; cti 1 bajt z Flash
DLspc>    E    cp      0c0h            FE C0           ; cetli jsme naposled?
DLspc> 1210    jr      NZ, 01207h      20 F5           ;    ne cti dalsi
DLspc>    2    ret                     C9              ; konec

DLspc>
;-------------------------------------------------------------------------------
--------------------
DLspc> ; Posli programovaci sequenci do Flash: 5555-AA, 2AAA-55, 5555-(A)
DLspc>
;-------------------------------------------------------------------------------
--------------------
DLspc> 6000    ld      DE, 05555h      11 55 55        ; 3 adresa do DE

DLspc>
;-------------------------------------------------------------------------------
--------------------
DLspc> ; Posli programovaci sequenci do Flash: 5555-AA, 2AAA-55, (DE)-(A)
DLspc>
;-------------------------------------------------------------------------------
--------------------
DLspc> 6003    push    DE              D5              ; uloz hodnoty
DLspc>    4    push    AF              F5
DLspc>    5    ld      DE, 05555h      11 55 55        ; 1 adresa
DLspc>    8    ld      A, 0aah         3E AA           ; 1 slovo
DLspc>    A    call    06017h          CD 17 60        ;    posli
DLspc>    D    ld      DE, 02AAAh      11 AA 2A        ; 2 adresa
DLspc> 6010    ld      A, 055h         3E 55           ; 2 slovo
DLspc>    2    call    06017h          CD 17 60        ;    posli
DLspc>    5    pop     AF              F1              ; obnov hodnoty
DLspc>    6    pop     DE              D1

DLspc>
;-------------------------------------------------------------------------------
--------------------
DLspc> ; Posli bajt z 'A' na adresu 'DE' ve Flash
DLspc>
;-------------------------------------------------------------------------------
--------------------
DLspc> 6017    ld      C, 030h         0E 30           ; port adresy
DLspc>    9    out     (C), D          ED 51           ; posli adresu
DLspc>    B    inc     C               0C              ; datovy port
DLspc>    C    ld      B, E            43              ; do 'B' dej nizzsi bajt 
adresy
DLspc>    D    out     (C), A          ED 79           ; posli bajt
DLspc>    F    ret                     C9

DLspc>
;-------------------------------------------------------------------------------
--------------------
DLspc> ; Cti bajt z adresy 'DE' ve Flash do 'A'
DLspc>
;-------------------------------------------------------------------------------
--------------------
DLspc> 6020    ld      C, 030h         0E 30           ; port adresy
DLspc>    2    out     (C), D          ED 51           ; posli adresu
DLspc>    4    inc     C               0C              ; datovy port
DLspc>    5    ld      B, E            43              ; do 'B' dej nizzsi bajt 
adresy
DLspc>    6    in      A, (C)          ED 78           ; cti bajt
DLspc>    F    ret                     C9

DLspc>
;-------------------------------------------------------------------------------
--------------------
DLspc> ; Programuj bajt HL-adresa bajtu v pameti, DE-adresa bajtu ve flash
DLspc>
;-------------------------------------------------------------------------------
--------------------
DLspc> 6029    call    0604eh          CD 4E 60        ; reset Flash
DLspc>    C    call    06020h          CD 20 60        ; cti bajt
DLspc>    F    cp      (HL)            BE              ; je shodny?
DLspc> 6030    ret     Z               C8              ;    pokud ano nic
neprogramuj
DLspc>    1    push    DE              D5              ; schovej adresu
DLspc>    2    ld      A, 0a0h         3E A0
DLspc>    4    call    06000h          CD 00 60        ; posli 5555-AA, 2AAA-55,
5555-A0
DLspc>    7    pop     DE              D1              ; obnov adresu
DLspc>    8    ld      A, (HL)         7E              ; do A bajt
DLspc>    9    call    06017h          CD 17 60        ;    a posli
DLspc>    C    and     080h            E6 80           ; orizni na 7 bit
DLspc>    E    ld      C, A            4F              ;    a uloz do C
DLspc>    F    push    BC              C5
DLspc> 6040    call    06020h          CD 20 60        ; cti bajt
DLspc>    3    pop     BC              C1
DLspc>    4    ld      B, A            47              ; uloz precteny bajt do
B
DLspc>    5    and     080h            E6 80           ; orizni na 7 bit
DLspc>    7    cp      C               B9              ; shoduje se?
DLspc>    8    jr      Z, 0604eh       28 04           ;    ano konec (reset
Flash)
DLspc>    A    bit     5, B            CB 68           ; je konec programovani?
DLspc>    C    jr      NZ, 0603fh      20 F1           ;    ne testuj dal

DLspc>
;-------------------------------------------------------------------------------
--------------------
DLspc> ; Reset Flash
DLspc>
;-------------------------------------------------------------------------------
--------------------
DLspc> 604E    ld      A, 0f0h         3E F0
DLspc> 6050    out     (031h), A       D3 31
DLspc>    2    ret                     C9

DLspc>
;-------------------------------------------------------------------------------
--------------------
DLspc> ; Sektor Erase
DLspc>
;-------------------------------------------------------------------------------
--------------------
DLspc> 6053    call    0604eh          CD 4E 60        ; reset Flash
DLspc>    6    push    DE              D5
DLspc>    7    ld      A, 080h         3E 80
DLspc>    9    call    06000h          CD 00 60        ; posli 5555-AA, 2AAA-55,
5555-80
DLspc>    C    pop     DE              D1
DLspc>    D    ld      A, 030h         3E 30
DLspc>    F    call    06003h          CD 03 60        ; posli 5555-AA, 2AAA-55,
(DE)-30
DLspc> 6062    ld      B, 0            06 00           ; chvili cekej
DLspc>    4    ex      (SP), HL        E3              ;    kdyz necekala tak mi
Flashka nahodne
DLspc>    5    djnz    06064h          10 FD           ;    kolabovala v
nasledujici operaci
DLspc>    7    call    06020h          CD 20 60        ; cti bajt
DLspc>    A    rlca                    07              ; je 7 bit v jednicce
DLspc>    B    jr      NC, 06062h      30 F5           ;    kdyz ne tak cekej
DLspc>    D    jr      0604eh          18 DF           ; a udelej reset

DLspc>
;-------------------------------------------------------------------------------
--------------------
DLspc> ; HLAVNI PROGRAM - 16k z ram 02000h- 05fffh do Flash 0c000h - 0ffffh
DLspc>
;-------------------------------------------------------------------------------
--------------------
DLspc> ; kontrola
DLspc> 606F    call    0604eh          CD 4E 60        ; reset Flash
DLspc> 6072    ld      HL, 02000h      21 00 20        ; adresa v pameti
DLspc>    5    ld      DE, 0c000h      11 00 C0        ; adresa Flash
DLspc>    8    ld      C, 0            0E 00           ; stav kontroly 1=nutnost
programovat
DLspc>    A    push    BC              C5
DLspc>    B    call    06020h          CD 20 60        ; cti bajt
DLspc>    E    pop     BC              C1
DLspc>    F    cp      (HL)            BE              ; je to shodne?
DLspc> 6080    jr      Z, 06089h       28 07           ;    pokud ano tak dalsi 
bajt
DLspc>    2    and     (HL)            A6              ; test zda je mozno Flash
programovat
DLspc>    3    cp      (HL)            BE              ;    nebo je nutno
nejdrive
DLspc>    4    call    NZ, 06053h      C4 53 60        ;    sektor vymazat
DLspc>    7    ld      C, 1            0E 01           ; stav kontroly - nutno
programovat
DLspc>    9    inc     HL              23
DLspc>    A    inc     DE              13
DLspc>    B    ld      A, D            7A              ; jeste mame
DLspc>    C    or      A               B7              ;    dalsi bajt?
DLspc>    D    jr      NZ, 0607ah      20 EB           ;    ano tak dalsi
DLspc>    F    dec     C               0D              ; je nutno Flash
programovat?
DLspc> 6090    ret     NZ              C0              ;    kdyz ne tak konec
DLspc> ; programovani
DLspc> 6091    ld      HL, 02000h      21 00 20        ; adresa v pameti
DLspc>    4    ld      DE, 0c000h      11 00 C0        ; adresa Flash
DLspc>    7    call    06029h          CD 29 60        ; programuj bajt
DLspc>    A    inc     HL              23
DLspc>    B    inc     DE              13
DLspc>    C    ld      A, D            7A              ; jeste mame
DLspc>    D    or      A               B7              ;    dalsi bajt?
DLspc>    E    jr      NZ, 06097h      20 F7           ;    ano tak dalsi
DLspc> ; kontrola naprogramovani
DLspc> 60A0    ld      HL, 01fffh      21 FF 1F        ; adresa v pameti -1
DLspc>    3    ld      DE, 0bfffh      11 FF BF        ; adresa Flash -1
DLspc>    6    inc     HL              23
DLspc>    7    inc     DE              13
DLspc>    8    ld      A, D            7A              ; jeste mame
DLspc>    9    or      A               B7              ;    dalsi bajt?
DLspc>    A    ret     Z               C8              ;    ne konec
DLspc>    B    call    06020h          CD 20 60        ; cti bajt
DLspc>    E    cp      (HL)            BE              ; shoduji se?
DLspc>    F    jr      Z, 060a6        28 F5           ;    ano testuj dalsi
DLspc> 60B1    call    03c3            CD C3 03        ; vypis bajt z Flash
DLspc>    4    call    0ch             CD 0C 00        ; vypis mezeru
DLspc>    7    call    03bah           CD BA 03        ; vypis adresu pameti
DLspc>    A    call    0ch             CD 0C 00        ; vypis mezeru
DLspc>    D    ld      A, (HL)         7E
DLspc>    E    jp      03c3h           C3 C3 03        ; vypis bajt z pameti



-- 
S pozdravem,
 falcen99
 falcen99 tu byla ta zakroucena vec seznam.cz



Ostatní příspěvky vlákna:

 
[2004/1 (1)] [2004/2 (1)] [2004/4 (33)] [2004/5 (34)] [2004/6 (12)] [2004/7 (1)] [2004/8 (12)] [2004/9 (31)] [2004/10 (52)] [2004/11 (43)] [2004/12 (4)]


[1999 (1)] [2000 (168)] [2001 (733)] [2002 (459)] [2003 (654)] [2004 (224)] [2005 (105)] [2006 (182)] [2007 (201)] [2008 (294)] [2009 (363)] [2010 (782)] [2011 (522)] [2012 (642)] [2013 (442)]