OpenCores
URL https://opencores.org/ocsvn/1664/1664/trunk

Subversion Repositories 1664

[/] [1664/] [trunk/] [arci/] [1664/] [inclui/] [0.SO.memoria.1664] - Rev 2

Compare with Previous | Blame | View Log

;ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
.defina memoria_asinia_comensa_alinia {4 1024 * 1 -}

eticeta_datos memoria_asinia_comensa_desloca
.ds {SO_pila_desloca memoria_asinia_comensa_alinia + memoria_asinia_comensa_alinia .- 1 - &}

eticeta_datos memoria_asinia_cuantia_intera
.ds {1024 1024 1 * *}

;.defina memoria_asinia_unia_grandia {sinia_bitio 3 >>}

;ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd

.defina bool_memoria_limpa 1
.defina bool_memoria_nova_limpa 1
.defina bool_memoria_libri_limpa {bool_memoria_limpa bool_memoria_nova_limpa 0 == &&}

;-------------------------------------------------------------------------------
eticeta_opera memoria_mapa_tradui ;mapa, desloca, cuantia
                                  ;(0) desloca_real
;-------------------------------------------------------------------------------
puia sREVENI
str 0 3
str 1 sT1
str 2 sT2
ldri sT3 -8
ldr_r sT4 s_n
ldri sT5 sinia_grandia
plu 2 1
str 2 sT0

@sicle_trova
ldm [3+]
cmp 0 s_0
z yli memoria_mapa_tradui@fini
and 0 sT3
str 0 2
ldm [3+]
cmp 0 sT1
c plu 3 sT5
c yli memoria_mapa_tradui@sicle_trova
ldr 1 0
plu 1 2
cmp 1 sT1
dep_or o z
o plu 3 sT5
o yli memoria_mapa_tradui@sicle_trova
sutr 0 sT1
str 0 sT5
ldm [3]
plu 0 sT5
sut 2 sT5
cmp 2 sT2
dep_or c z
c str 0 sT4

@fini
tira_ 1
ldr 0 sT4
str 1 sIP

;-------------------------------------------------------------------------------
eticeta_opera memoria_asinia_mapa_sesion_libri ;mapa, desloca_real
;-------------------------------------------------------------------------------
puia sREVENI
str 0 3
str 1 sT0
ldri sT2 sinia_grandia
ldr 2 s_n

@sicle_trova
str 3 sT1
ldm [3+]
cmp 0 s_0
z yli memoria_asinia_mapa_sesion_libri@sicle_trova_finia
plu 3 sT2
ldm [3+]
cmp 0 sT0
z ldr 2 sT1
yli memoria_asinia_mapa_sesion_libri@sicle_trova

@sicle_trova_finia
cmp 2 s_n
z yli memoria_asinia_mapa_sesion_libri@fini
ldr 3 sT1
ldm [3]
stm [2+]
eor 0 0
stm [3+]
ldm [3+]
stm [2+]
ldm [3]
stm [2]

ldr 0 sT0
yl memoria_asinia_libri
eor 2 2

@fini
ldr 0 2
tira 1
str 1 sIP

;-------------------------------------------------------------------------------
eticeta_opera memoria_asinia_mapa_sesion_ajunta ;mapa, desloca_real, cuantia 
 ;(0) mapa, (1) memoria_desloca_virtual
;-------------------------------------------------------------------------------
puia sREVENI
entra
depende_inoria
str 0 sR0
str 1 sR1

ldri 0 -sinia_grandia
and 2 0
str 2 sR2

ldri sR3 {sinia_grandia 3 *}
eor 2 2
ldr 3 sR0

@sicle_mapa_grandia
plu 2 s_1
ldm [3]
plu 3 sR3
cmp 0 s_0
n yli memoria_asinia_mapa_sesion_ajunta@sicle_mapa_grandia

ldr 3 2
shl 3 s_1
plu 3 2
plu 3 s_1
ldri 1 sinia_bitio_sh_
shl 3 1
ldr 0 3
yl memoria_asinia_nova ;*__ eror: memoria nondisponable
str 0 2
str 0 sR5
ldr 3 sR0
ldri sT0 -8
ldri sR4 usor_datos_desloca

@sicle_copia
ldm [3+]
cmp 0 s_0
z yli memoria_asinia_mapa_sesion_ajunta@sicle_copia_fini
stm [2+]
and 0 sT0
str 0 sT1
ldm [3+]
stm [2+]
plu 0 sT1
cmp 0 sR4
c str 0 sR4
ldm [3+]
stm [2+]
yli memoria_asinia_mapa_sesion_ajunta@sicle_copia

@sicle_copia_fini
ldri 0 {1 umm_permete_leje << | 1 umm_permete_scrive << |}
plu 0 sR2
stm [2+]
ldr 0 sR4
stm [2+]
ldr 0 sR1
stm [2+]
eor 0 0
stm [2]

ldr 0 sR0
yl memoria_asinia_libri

ldr 0 sR5
ldr 1 sR4
departi
tira 3
str 3 sIP

;-------------------------------------------------------------------------------
eticeta_opera memoria_copia ;destina, fonte, cuantia
;-------------------------------------------------------------------------------
depende_influe
str 0 3
puia sREVENI
ldri 0 {sinia_grandia 1 -}
str 0 sT0
and 0 2
sut 2 0
str 2 sT1
str 0 2
cmp 2 s_0
z yli memoria_copia@sicle_bait_fini

@sicle_bait
ldm [1+] 1
stm [3+] 1
sut 2 s_1
n yli memoria_copia@sicle_bait

@sicle_bait_fini
ldr 2 sT1
cmp 2 s_0
z yli memoria_copia@fini
ldri 0 sinia_bitio_sh_
shr 2 0

@sicle_sinia
ldm [1+]
stm [3+]
sut 2 s_1
n yli memoria_copia@sicle_sinia

@fini
tira 1
str 1 sIP

;-------------------------------------------------------------------------------
eticeta_opera memoria_asinia_ajunta_libri
;-------------------------------------------------------------------------------
depende_inoria
puia sREVENI

ldri 3 memoria_asinia_comensa_desloca
ldm [3]
str 0 3
str 0 2
ldri sT0 {-1 1 >>}
ldri sT1 sinia_grandia

@sicle_trova
ldm [3+]
cmp 0 s_0
z yli memoria_asinia_ajunta_libri@fini

@sicle_trova_a
str 0 1
ldb 0 {sinia_bitio 1 -}
and 1 sT0
plu 3 1
z str 3 2
z yli memoria_asinia_ajunta_libri@sicle_trova
ldm [3+]
cmp 0 s_0
z yli memoria_asinia_ajunta_libri@fini
ldb 0 {sinia_bitio 1 -}
z yli memoria_asinia_ajunta_libri@sicle_trova_a
and 0 sT0
plu 0 1
plu 0 sT1
stm [2]
str 2 3
yli memoria_asinia_ajunta_libri@sicle_trova

@fini
tira_ 1
str 1 sREVENI

;-------------------------------------------------------------------------------
eticeta_opera memoria_asinia_inisia
;-------------------------------------------------------------------------------
ldri 3 memoria_asinia_comensa_desloca
ldm [3]
str 0 3
ldri 2 {sinia_grandia 2 *}
ldri 1 memoria_asinia_cuantia_intera
ldm [1]
sut 0 2
stm [3]
plu 3 1
ldri 0 sinia_grandia
sut 3 0
eor 0 0
stm [3]
reveni

;-------------------------------------------------------------------------------
eticeta_opera memoria_asinia_divide ;desloca, cuantia
;-------------------------------------------------------------------------------
depende_inoria
str 0 3
ldri 0 sinia_grandia
str 0 sT0
sut 0 s_1
plu 1 0
eor 0 s_n
and 1 0
ldm [3]

;==
cmp 0 1
z stb 0 {sinia_bitio 1 -}
z stm [3]
z rev opera_rev_reveni

;<{sinia_grandia 2 *}
str 0 sT1
sut 0 1
str 0 2
ldri 0 {sinia_grandia 2 *}
sutr 0 2
ldb 0 {sinia_bitio 1 -}
z ldr 0 sT1
z stb 0 {sinia_bitio 1 -}
z stm [3]
z rev opera_rev_reveni

;>={sinia_grandia 2 *}
dep_set 0
ldr 0 1
stb 0 {sinia_bitio 1 -}
stm [3+]
plu 3 1
ldr 0 2
sut 0 sT0
stm [3]
reveni

;-------------------------------------------------------------------------------
eticeta_opera memoria_asinia_nova ;cuantia
;-------------------------------------------------------------------------------
puia sREVENI
puia sR0
str 0 sR0
yl memoria_asinia_nova_prima
cmp 0 s_0
n yli memoria_asinia_nova@fini
yl memoria_asinia_ajunta_libri
ldr 0 sR0
yl memoria_asinia_nova_prima

@fini
tira sR0
tira 1
str 1 sIP

;-------------------------------------------------------------------------------
eticeta_opera memoria_asinia_nova_prima ;cuantia
;-------------------------------------------------------------------------------
depende_inoria
str 0 2
puia sREVENI
puia sR0
ldri 3 memoria_asinia_comensa_desloca
ldm [3]
str 0 3
ldri sT0 sinia_grandia
ldr 1 s_n
shr 1 s_1

@sicle_trova_libri
ldm [3]
cmp 0 s_0
z yli memoria_asinia_nova_prima@fini ;eror: memoria nondisponable
ldb 0 {sinia_bitio 1 -}
and 0 1
str 3 sR0
plu 3 0
plu 3 sT0
z yli memoria_asinia_nova_prima@sicle_trova_libri
cmp 0 2
o yli memoria_asinia_nova_prima@sicle_trova_libri

{%.{bool_memoria_nova_limpa 0 ==}
ldr 1 2
ldri 0 {sinia_grandia 1 -}
plu 1 0
eor 0 s_n
and 1 0
ldri 0 sinia_bitio_sh_
shr 1 0
eor 0 0
ldr 3 sR0

depende_influe
@sicle_limpa
stm [+3]
sut 1 s_1
n yli memoria_asinia_nova_prima@sicle_limpa
depende_inoria
}

ldr 0 sR0
ldr 1 2
yl memoria_asinia_divide
ldri 0 sinia_grandia
plu 0 sR0

@fini
tira sR0
tira 1
str 1 sIP

;-------------------------------------------------------------------------------
eticeta_opera memoria_asinia_libri ;desloca
;-------------------------------------------------------------------------------
depende_inoria
str 0 3
puia sREVENI
ldri sT2 sinia_grandia
ldm [-3]
dep_eor z z
stb 0 {sinia_bitio 1 -}
str 0 sT1
str 3 2
plu 3 0
ldm [+3]
cmp 0 s_0
z stb 0 {sinia_bitio 1 -} ;fini
ldb 0 {sinia_bitio 1 -}
z ldr 0 sT1
dep_inv z
z plu 0 sT1
z plu 0 sT2
stm [2]

{%.{bool_memoria_libri_limpa 0 ==}
ldr 1 sT1
ldri 0 sinia_bitio_sh_
shr 1 0
eor 0 0

depende_influe
@sicle_limpa
stm [+2]
sut 1 s_1
n yli memoria_asinia_libri@sicle_limpa
depende_inoria
}

tira 1
str 1 sIP

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.