Armenian Knowledge Base  

Go Back   Armenian Knowledge Base > Technical sections > Languages, Compilers, Interpreters
Register

Reply
 
LinkBack Thread Tools
Old 11.08.2004, 08:42   #1
Младенец
 
Join Date: 06 2004
Location: Moscow
Age: 39
Posts: 39
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default CCS2.2 compiliruet coshmarnyh cod!!!

Ya probuyu napisat' boot loader s flasha.
Vsyo by nichego no mne nuzhno pomestitsya v 1 KB. S drugoi storony ne xochetsya na assemblere i vot nikak ni poymu pochemu stack ne popodaet tuda kuda nado.

-stack 0x400
MEMORY {
BOOT : origin = 0x0000, len = 0x00600
ISRAM : origin = 0x0600, len = 0x1000
ISRAMSTACK : origin = 0x1600, len = 0x2000
SDRAM : origin = 0x80000000, len = 0x2000000

}

SECTIONS {
.vectors {} > BOOT
.const: {} > BOOT
.text: {} > BOOT
.bss: {} > ISRAM
.stack: {} > ISRAMSTACK
.far: {} > ISRAM
.sysdata: {} > ISRAM
.sysregs: {} > ISRAM
.sysinit: {} > ISRAM
.cinit: {} > ISRAM
.data: {} > ISRAM
}

vot cmd file. Etogo ne dostatochno shtoby stack pri compilyacii popal po naznachennomu adresu? Ne obrashayte vnimaniya shto seciya stecka bol'she razmerov real'nogo stecka... eto prosto straxovka na budushee.

Last edited by veg; 11.08.2004 at 09:03.
Reply With Quote
Old 11.08.2004, 14:14   #2
Младенец
 
Join Date: 08 2004
Location: Yerevan
Posts: 3
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default

A kuda popal posle kompiljacii stack ?

Etogo .cmd fajla dostatochno, chtoby sekcija .stack popala tuda, kuda nado. Eshchje nuzhno inicializirovat' SP (t.e. B15), no eto dolzhen avtomaticheski sdelat' c_int00.
Reply With Quote
Old 11.08.2004, 15:17   #3
Младенец
 
Join Date: 06 2004
Location: Moscow
Age: 39
Posts: 39
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default

Ya rabotayu bez RTSliba i _c_int00 prosto pered mainom pastavlen. Stack voobshe ne inicializiruetsya. Te privyazyvayetsa k B15 i beret znacheniye kakoye tam est'.
Reply With Quote
Old 11.08.2004, 15:25   #4
Младенец
 
Join Date: 08 2004
Location: Yerevan
Posts: 3
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default

Togda neponimaju, o chem vopros. Inicializiruj B15 i budesh' imet' stack tam, gde xochesh'.
Reply With Quote
Old 11.08.2004, 16:07   #5
Младенец
 
Join Date: 06 2004
Location: Moscow
Age: 39
Posts: 39
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default

OK Ya tak i delayu esli chestno.
No ya xotel programmu napisat' v C bez assemblera. A shtoby u etogo registra pomenyat' adres prixoditsa asmovski kusochek tuda zapyxnut'.
No ya nachinayu ponimat' shto bez RTS liba na C pisat' nel'zya, navernoye
Reply With Quote
Old 12.08.2004, 06:27   #6
Младенец
 
Join Date: 08 2004
Location: Yerevan
Posts: 3
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default

Po moemu chto-to vrode

asm(" mvk 0x2000, B15");
asm(" b _main");
asm(" nop 5");

ne tak uzh i slozhno

Last edited by bars; 12.08.2004 at 11:03.
Reply With Quote
Old 12.08.2004, 14:14   #7
Младенец
 
Join Date: 06 2004
Location: Moscow
Age: 39
Posts: 39
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default

Spasibo
Ya eto tak i sdelal. No xotelos' shtoby comiler dislociroval
Anyway 10x
Reply With Quote
Sponsored Links
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 04:43.


Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.