SX ASM question
Chris Drzewiecki
Posts: 26
I was wondering how different is SX ASM compared to PC Assembler language or SPARC assembler.· I took both a long time ago and was just wondering if my previous experiences will help.· I saw the XGS and I am very impressed and interested.· After I mess around with the BS2, I might venture in the world of SX.
Thanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Chris
Thanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Chris
Comments
The SX has a segmented memory architecture, similar to 16 bit x86 code. If you have experience with 16 bit x86 assembly, then the SX won't feel so weird. If you only have experience with flat memory models, then you may find it a bit awkward at first. Also, I find that in general, if you can program in one assembly language, you can learn to program in any other one. Half the battle in programming in assembly is learning to think at an extremely low level of programming. Once you can do that, learning the specific quirks of a new architecture and the specific assembly language mnemonics is just a matter of taking the time and doing it.
Thanks, PeterM
Yes it was 16bit code, but it was like 8 years ago that I used it. After I get through the BS2 tutorials, I will definately explore further with SX. It seems you can do more with SX than BS2, basically because of the ASM language.
Thanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Chris
Another thing that causes confusion is that the PC uses von Neumann architecture and the SX uses Harvard architecture.
It's kind of weird so see this:
ORG $08
var1 DS 1
var2 DS 1
ORG $08
MOV W,#1
When your used to von Neumann your thinking "Hey you just put code where the variables are stored". But of course on the SX this is not the case.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
Forget about the past, plan for the future, and live for today.
·
You don't have to have a 'RAM_ORG' and an 'EEPROM_ORG' to get things to the right location.
I hope that is not too wordy.
Another way of putting it is the the Compiler is 'context aware' or 'context sensitive' in how it uses the ORG.
Guenther's book really will lead you clearly through it, so read it when your ready.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Thanks Again!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Chris
I don't think that this is what Bean is saying. Bean pointed out that on machines with von Neumann structure the two ORG 8 directives in his example refer to exactly the same location in RAM memory, and the assembler would assign memory for variables there, and then generate code to be stored at the same memory location. This is a great example for self-destroying code .
Such desasters are not possible with the SX with its Harward structure because variable and program memory are completely separated, and addressed via two separate busses.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G