Цитата(makc @ Aug 15 2006, 17:34)

Решение, конечно, интересное. Но больно уж оно мне кажется специализированным... Особенно интересно вот это
Цитата
The Propeller chip is programmed in both a high-level language, called Spin™, and low-level (assembly) language.
Что за язык такой?
Ну я его мельком посмотрел - похож на паскаль немного. Думаю, что это просто некая разновидность "специализированного" ассемблера. В документации есть ещё что-то про интепретатор Spin. Ещё в документации нет ничего про такие привычные модули как АЦП, таймеры и другую периферию. Наверное всё это принесено в жертву многоядерности. А возможно они просто подумали, что при наличии стольких ядер нетрудно реализовать периферию чисто программно.
Вот пример на Spin:
Код
'' Propeller "Hello, World!" demo
'' -- blink an LED on pin A16
''
'' A16>───────┐
'' 330Ω
CON
_clkmode = xtal1 + pll16x ' use external crystal * 16
_xinfreq = 5_000_000 ' 5 MHz
Led = 16
VAR
long delayTime ' used for delay
PUB BlinkLED
dira[Led] := 1 ' make the pin an output
repeat
outa[Led] := !outa[Led] ' toggle the pin state
delayTime := cnt + 8_000_000 ' delay = 8 million cycles
waitcnt(delayTime) ' wait
Интересно ещё то, что среда разработки позволяет рисовать небольшие схемы в псевдографике (4 и 5-я строчки примера. Там резистор и светодиод).
По поводу ассемблера - погорячился. Вот что сказано в документации:
Цитата
Boot Loader and Spin Interpreter
The last section in Main ROM contains the Propeller chip’s Boot Loader and Spin Interpreter
programs.
The Boot Loader is responsible for initializing the Propeller upon power-up/reset. When a
Boot Up procedure is started, the Boot Loader is loaded into Cog 0’s RAM and the cog
executes the code starting at location 0. The Boot Loader program first checks the host and
EEPROM communication pins for code/data to download/upload, processes that information
accordingly and finally it either launches the Spin Interpreter program into Cog 0’s RAM
(overwriting itself) to run the user’s Propeller Application, or it puts the Propeller into
shutdown mode. See the Boot Up Procedure section on page 18.
The Spin Interpreter program fetches and executes the Propeller Application from Main
RAM. This may lead to launching additional cogs to run more Spin code or Propeller
Assembly code, as is requested by the application. See Run-Time Procedure, page 18.
Этот интерпретатор напоминает мне интерпретатор языка бейсик для ZX Spectrum. Там все ключевые слова кодировались одним байтом и потому лексический анализатор был не нужен и скорость выполнения кода на бейсике была довольно высокая.
Сообщение отредактировал Deka - Aug 15 2006, 14:06