BY DF0: / NFA This is ( Hopefully ) going to be the first in a series of tutorials on how to code in ARM Machine code on the Archimedes series of computers.Despite their many faults,these machines offer a real kicking processor,and as it is RISC based,it is a piece of piss to code on it,as well as being PRETTy damn fast.Note :- I have currently written two articles on this subject....I dont know if they are both going to be included in the next issue,so bear in mind any references to 'Last months article' mean this one.... I will assume that you do not have a dedicated assembler for this machine,so we will use the BASIC assembler.The Archimedes has an assembler bulit into BASIC,so you can start coding straight away.The only thing you need to do is to create a skeleton program to assemble and run your code.Type this program in and save it :- ----------------------------------------------------------------------- *| ARM Machine code tutorial program (C) 1994 by DF0: of NFA *| Use to slot your ARM code into... Reserved_space = 1024 DIM code Reserved_Space For Pass=0 TO 3 STEP 3 P%=code [ OPT Pass ] NEXT Pass CALL code. ----------------------------------------------------------------------- I will now go over the program line by line.The Reserved_Space variable holds the amount of memory you want to free for your program.In this case it is 1024 bytes,or 1 Kilobyte. The next line actually frees the code by using a specialised form of the DIM statment. The P% variable is an internal variable,and is the pointer to the start of the code. Any instructions between the [ and ] signs are treated as ARM code. The ] character tells the compiler that you now want to start executing BASIC instructions again. The OPT Pass bit is the code that tells the compiler to check for errors,etc. in the 2-Pass compiler.I will go into this next time. CALL actually runs your code from the P% location where your code is stored. Now we can try an example bit of ARM code. Type this code in between the [ and ] characters. ; Simple string printing example by DF0: of NFA 1994 SWI "OS_NewLine" ADR R0,Message_String SWI "OS_Write0" SWI "OS_NewLine" MOV PC,R14 .Message_String EQUS "Hi there! This is a string being printed using SWI calls!" EQUB &0 If you run this,the message in the EQUS statment will appear on the screen. Basic stuff you need to know :- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ The Arc has 32-bit registers from R0 to R13 that you can use to store whatever you want in them.Register R15 is sometimes called the PC register,and is the program counter.The R14 register is the Link register. The MOV PC,R14 command is the equivalent to a RTS call in 68000 code.Without it,the machine will crash. Anything with a . in front of it is a label. &04e = Hexadecimal [ & suffix ] %011 = Binary [ % suffix ] #543 = Decimal. [ # suffix ] Basic rundown of the commands covered so far ..... ADR ,