Introduction To The ARM Instruction Set:: 1 Module - 2 - Full
Introduction To The ARM Instruction Set:: 1 Module - 2 - Full
Module _2_Full 2
Convention
• ADD r3,r1,r2 instruction adds the two values stored in registers r1 and r2
(the source registers), writes the result to register r3 (the destination
register).
Module _2_Full 3
Module _2_Full 4
Data Processing Instructions
• The data processing instructions manipulate data within registers.
• They are :
– move instructions
• (MOV,MVN,LDM,LDR,ADR,MRS,MSR,STC,STM,STR)
– arithmetic instructions
• (ADD,ADC,QADD,QDADD,SUB, RSC,QSUB,,RSB,SBC)
– logical instructions
• (AND,EOR,ORR,BIC)
– comparison instructions
• (CMP,CMN,TEQ,TST)
– multiply instructions
• (MLA,MUL,SMULL,SMULxy,SMULwy,SMAL,SMLAxy,SMLALxy)
– Branch instructions
• (B,BL,BLX)
– Interrupt instructions
• SWI Module _2_Full 5
Move Instructions
• Purpose: copies N into a destination register Rd, where N is a
register or immediate value.
Example:
• Assume R1=8, R2=5
MOV r1, r2
• r1r2
• After execution : R2=5, R1=5 (Note that R2 is unaltered)
MVN r0, #0x00FF
• r0 ~0x00FF
• After the execution: r0 = 0xFFFFFF00
Module _2_Full 6
Questions
• 1) Give the instruction to Load the constant
0xff00ffff to r0 using an MVN.
• 2) Assume R1=8, R2=5
What is the content of R1 after the execution of
MVN R1,R2
Module _2_Full 7
• 1. Answer: MVN r0, #0x00FF0000
• 2. Answer: R2=5, R1=~5=~00000005=oxfffffffa
Module _2_Full 8
Barrel Shifter
• N can be a register or immediate value
A register Rm that has been pre processed
by the barrel shifter prior to being used by
a data processing instruction.
• Data processing instructions are processed
within the arithmetic logic unit (ALU).
• A unique and powerful feature of the ARM
processor is the ability to shift the 32-bit
binary pattern in one of the source registers
left or right by a specific number of
positions before it enters the ALU.
Module _2_Full 9
Example: barrel shifter
• A logical shift left (LSL) to register Rm before moving it to the
destination register. Condition flag is updated only if S is present
in the instruction.
Purpose The MOV instruction copies the shift operator result N into register Rd. N represents
the result of the LSL operation
Usage Example MOV R1,R2,LSL #2
Explanation Moves the contents of register r5 and copies them into register r7
Pre-Condition R1=5, R2=8
Instruction Usage
MOV R1,R2,LSL #2 ; r1 = r2<<2
0000 0000 0000 0000 0000 0000 0000 1000
=0x08
➔0000 0000 0000 0000 0000 0000 0010 0000
= 0x20
After Execution R2= 8, R1 = 20H, No change in the content of R2
Module _2_Full 10
Module _2_Full 11
Purpose Usage (example)
Immediate MOV r5,#23
MOV r2,#2
Register MOV r7,r5
Logical shift left by immediate MOV r7,r5,LSL #2
Logical shift left by register MOV r7,r5,LSL r2
Logical shift right by immediate MOV r7,r5,LSR #2
Logical shift right with register MOV r7,r5,LSR r2
Arithmetic shift right by immediate MOV r7,r5,ASR #2
Arithmetic shift right by register MOV r7,r5,ASR r2
Rotate right by immediate MOV r7,r5,ROR #2
Rotate right by register MOV r7,r5,ROR r2
Rotate right with extend MOV r7,r5,RRX
Module _2_Full 12
• MOV R0, R2, LSL #2 @ R0:=R2<<2
@ R2 unchanged
• Example: 0…0 0011 0000
Before R2 0x00000030 =0x00000030
After R0=0x000000C0 R2=0x00000030
Module _2_Full 13
MOV R1,R2,LSL #1 Assume R1=5, R2=8 0000 0000 0000 0000 0000 0000 0000 1000
After : R2=8, R1=16 0000 0000 0000 0000 0000 0000 0001 0000
MOV R1,R2,LSR #1 Assume R1=5, R2=8 0000 0000 0000 0000 0000 0000 0000 1000
After : R2=8, R1=4 0000 0000 0000 0000 0000 0000 0000 0100
MOV R1,R2,ROR #1 Assume R1=5, R2=90000 0000 0000 0000 0000 0000 0000 1001
After : R2=8, R1=80000004 1000 0000 0000 0000 0000 0000 0000 0100
MOV R1,R2,ROL #1 Assume R1=5, R2=9 0000 0000 0000 0000 0000 0000 0000 1001
After : R2=8, R1=00000012 0000 0000 0000 0000 0000 0000 0001 0010
MOV R1,R2,ASR #1 Assume R1=5, R2=80000009 1000 0000 0000 0000 0000 0000 0000 1001
After : R2=8, R1=C0000004 1100 0000 0000 0000 0000 0000 0000 0100
Module _2_Full 14
• Before R2 0x00000030
• After R0=0x0000000C R2 Unchanged
Module _2_Full 15
ASR
Module _2_Full 16
ROR
Module _2_Full 17
RRX
Module _2_Full 18
Shifted register operands
Module _2_Full 19
Shifted register operands
Module _2_Full 20
• RRX provides the value of the contents of a
register shifted right one bit. The old carry flag is
shifted into bit[31].
• If the S suffix is present, the old bit[lsb –bit or 0th ]
is placed in the carry flag.
MOV r7,r5,RRX Assume R7=5, 0111 0000 0000 0000 0000 0000 0000 1000
R5=0x70000008 1 1011 1000 0000 0000 0000 0000 0000 0100
Old carry is C i.e=1
After the operation: oxB8000004
Module _2_Full 21
• MOVS: this instruction copies the content from source
to destination register and updates Status register.
• MOVS r0, r1, LSL #1:
– This instruction shifts R1 left side by one place and then it
copies to R0. After the execution status register CPSR will
be updated.
Instruction Usage Post Condition
MOV r1, #0x80000004 R1=0x80000004
Before c 1000 0000 0000 0000 0000 0000 0000 0100
MOV r0 ,#0x00000000 After C 0000 0000 0000 0000 0000 0000 0000 1000
MOVS r0, r1, LSL #1
R0=0x00000080
cpsr= nzcvqiFt_USER
CPSR= nzCvqiFt_USER
Module _2_Full 22
Conditional instructions
• It is usually used after CMP instructions
• The CMP instruction updates cpsr
• MOV conditional instruction executes based on flags
• MOVEQ R0,R1
– R1 is moved to RO only if Z is set.
• usage :
– CMP r0,r1 ; compares ro and r1 sets flag accordingly.
– MOVEQ r0,r1 ; updates r0=r1 if Z is set.
Module _2_Full 23
Arithmetic Instructions
• The arithmetic instructions implement
addition and subtraction of 32-bit signed and
unsigned values.
Module _2_Full 25
Using the Barrel Shifter with Arithmetic Instructions
Instruction Post condition
MOV r0,#0xF0000000 R0= 0xF0000000 R1=0x00000005
MOV r1,#0x00000005 R0=0x0000000F
ADD r0, r1, r1, LSL #1
MOV r0,#0xF0000000 R0 = 0xF0000000 R1=0x70000005
MOV r1,#0x70000005 CPSR=nzcvqiFt_USER
ADDS r0, r1, r1, LSL #1 R0=0x5000000f CPSR=nzCvqiFt_USER
MOV r0,#0xF0000000 R0 = 0xF0000000 R1=0x70000005
MOV r1,#0x70000005 CPSR=nzCvqiFt_USER (R1+1+(R1<<1)
Instruction Explanation
ORR r0,r1,r2 Logical OR between registers R1 and R2, Result in R0 i.e r0= (r1 |r2)
BIC r0, r1, r2 Register r0 contains a binary pattern where every binary 1 in r2
clears a corresponding bit location in r1. r0= (r1 & ~r2)
AND r0,r1,r2 Logical AND between registers R1 and R2, Result in R0. r0= (r1 & r2)
EOR r0, r1, r2 Logical XOR between registers R1 and R2, Result in R0. r0= (r1 ^r2)
Module _2_Full 27
Module _2_Full 28
Logical Instructions
MOV R1 ,# 0X00004506
MOV R2 ,# 0X00000045
ORR R0,R1,R2 ;R0= 0X00004545
BIC R0, R1, R2 ;R0= 0X00004500
ANDS R0,R1,R2 ;R0= 0X00000000 CPSR: Z
EOR R0, R1, R2 ;R0= 0X00004545
[BIC:
R1: 0100010100000110
Module _2_Full 29
Comparison Instructions
• The comparison instructions are used to
compare or test a register with a 32-bit value.
• These instructions update the cpsr flag bits
after the operation and but do not affect other
registers.
• Syntax: <instruction>{<cond>} Rn, N
• In these instruction, S suffix is not necessary ,
because the instruction itself updates flags.
Module _2_Full 30
Instruction Explanation
CMP R0, R1 CMP comparison instruction. The CMP is effectively a subtract instruction
with the result discarded. After execution the z flag changes to 1 or an
uppercase Z if result is zero. This change indicates equality. (flags set as a
result of Rn – N).
TEQ R0, R1 Test for equality of two 32-bit values, flags set as a result of Rn ∧ N TEQ is
logical exclusive OR operation.
TST R0,R1 TST instruction is a logical AND operation. flags set as a result of Rn & N.
CMN R0,R1 compare negated, flags set as a result of Rn + N.
MOV R0 ,# 6 ; R0=6
MOV R1 ,# 9 ; R1=9
CMP R0,R1 ; Nzcv 1001 == 0110 ? Negative
CMP R0,R0 ; nZCv 0110==0110 ? Equal, zero flag
CMP R1,R0 ; nzCv 0110 ==1001 ? Not equal, Greater
CMN R0,R1 ; nzcv R0 and ~R1➔ 0110 and 0110
TEQ R0,R1 ; nzcv XOR( 0001001, 000110)
TST R0,R1 ; nZcv Module _2_Full00
AND(0001001,000110) all zero i.e Z 31
first internals portion
Multiply Instructions
• The multiply instructions multiply the contents of a pair of registers
and, depending upon the instruction, accumulate the results in with
another register.
Instruction Purpose Syntax Operation
The long multiply instructions (SMLAL, SMULL, UMLAL, and UMULL) produce a 64-bit result.
The result is too large to fit a single 32-bit register so the result is placed in two registers labelled
RdLo and RdHi.
Before: Before:
R0=0x00000000 MUL R0,R1, R2 R0= R1*R2=0x00000004
R1=0x00000002 MLA R0,R1, R2, R3 R0=R1*R2+R3=0x00000008
R2=0x00000002 UMULL R0,R1, R2, R3 R1R0= R2*R3=0x00000008
R3=0x00000004 UMLAL R0,R1, R2, R3 R1R0= R1R0+R2*R3
R4=0x00000004
Module _2_Full R1R0=00000000 00000008 32
Branch instruction
• A Branch instruction changes the flow of
execution or is used to call a routine.
• The address label is stored in the instruction as a
signed pc-relative offset
• Different types of branch instructions are
• B
• BL
• BX
• BLX
Module _2_Full 33
Branch Instructions
Instruction/ Purpose Explanation Working
Syntax
B It is unconditional jump instruction, Pc=label, unconditional
Branch to transfer control target jump
instruction
Module _2_Full 35
Load-Store Instructions
• Load-store instructions transfer data between
memory and processor registers.
• There are three types of load-store instructions:
– Single-register transfer,
– multiple-register transfer,
– swap
Module _2_Full 36
Loading constants using LDR and ADR
LDR instruction with a pc-relative address to read the constant from a literal pool.
ADR can only be used to load address literal which is from same segment.
LDR LDR Rd, =constant load constant pseudo instruction. Rd➔32-bit constant
This writes a 32-bit constant to a
register. It defaults to a memory
read
ADR ADR Rd, label load address pseudo instruction Rd➔32-bit relative
writes a relative address into a address
register, which will be encoded
using a pc-relative expression
Module _2_Full 37
Factorial
AREA FACT_C, CODE, READONLY
ENTRY
START ADR R4,N ; loads address of N using ADR
LDR R1,[R4] ; similar to
LDR R1,=N
LDR R5,=FACT ; loads address of Fact using LDS
LDR R0,=1 ; loads constants 1 using LDR
LOOP CMP R1, #0
BEQ LAST ; multiply and reduce, continue if not 0
MUL R0,R1,R0
SUB R1,R1,#1
B LOOP
LAST STR R0,[R5] ; store the result
STOP B STOP
N DCD 0x05 ; read only data
AREA FACT_D, DATA, READWRITE
FACT DCD 0X0 ; read write data area
END
Module _2_Full 38
Single-Register Transfer
These instructions are used for moving a single data item in and out of a register
The data types supported are signed and unsigned words (32-bit), half words (16-bit),
and bytes.
Module _2_Full 39
LDR and STR
• LDR and STR instructions can load and store data on a boundary alignment
that is the same as the data type size being loaded or stored.
• LDR can only load 32-bit words on a memory address that is a multiple of four
bytes—0, 4, 8, and so on
• LDR loads a word from the address stored in register and places it into register
STR goes the other way by storing the contents of register to the address
contained in register.
• Register which holds address is called is called the base address register.
AREA Ex, CODE, READONLY R1= 0x00000010
ENTRY R2= 0x00000020
start [0x00000010]=0x10
MOV r1,#0x00000010 [0x00000020]=0x30
MOV r2,#0x00000020
• Pre index with write back calculates an address from a base register plus address
offset and then updates that address base register with the new address.
• The pre index offset is same as the pre index with write back but does not
update the address base register.
• Post index only updates the address base register after the address is used
Module _2_Full 41
Module _2_Full 42
• A signed offset or register is denoted by “+/−”, identifying that it is either a
positive or negative offset from the base address register Rn. The base address
register is a pointer to a byte in memory, and the offset specifies a number of
bytes.
• In Register ,the address is calculated using the base address register and a
specific register’s contents.
• In Immediate , the address is calculated using the base address register and a
12-bit offset encoded in the instruction
• Scaled register address is calculated using the base address register and a barrel
shift operation.
• Pre-index with writeb ack calculates an address from a base register plus
address offset and then updates that address base register with the new
address
• The pre-index offset is the same as the pre-index with write-back but does not
update the address base register.
Module _2_Full 43
LDR example
Instructions After execution
LDR r0, [r1, #4]! r0 = 0x02020202
Pre-index with write-back r1 = 0x00009000
Assume:r0 = 0x00000000,r1 = 0x00090000 r0= [r1+4]=[0x000090000+4] 0x02020202
mem32[0x00009000]=0x01010101 R1r1+4=0x00009004
mem32[0x00009004]=0x02020202 base register does change. i.e write back
LDR r0, [r1, #4] r0 = 0x02020202
Pre-index r1 = 0x00090000
Assume: r0 = 0x00000000,r1 = 0x00090000 r0= r1+4=0x00009004= 0x02020202
mem32[0x00009000]=0x01010101 r1=r1
mem32[0x00009004]=0x02020202 base register does not change., no write back
LDR r0, [r1], #4 r0 = 0x01010101
Post-index r1 = 0x00009000
Assume: r0 = 0x00000000, r1 = 0x00090000 R0[r1] = 0x01010101
mem32[0x00009000]= 0x01010101 R1=r1+4= 0x00009004
mem32[0x00009004]= 0x02020202 After operation R1 updates
Module _2_Full 44
STR example
Instructions After execution
STR r0, [r1, #4]! r0 = 0x00008000, r1 = 0x00009004
Pre-index with write-back [r1+4]Ro
Assume: r0 = 0x00008000,r1 = 0x00090000 [0x00009004] 0x00008000
r1=r1+4=0x00009004+4=0x00009004 R1 updates
STR r0, [r1, #4] r0 = 0x00008000, r1 = 0x00090000
Pre-index [r0]= [r1+4]
Assume: r0 = 0x00008000,r1 = 0x00090000 =[0x00009000+4]=[ 0x00009004]= 0x00008000
r1=r1, no change in r1
STR r0, [r1], #4 r0 = 0x01010101
Post-index r1 = 0x00009004
Assume: r0 = 0x00008000, r1 = 0x00090000 [r1]=r0 i.e [0x90000]= 0x00008000
[r1]= [r1+4]= 0x00009004 after operation r1 updates
Module _2_Full 45
Example, usage, working for LDR
Type of Addressing Instruction Ro Base register R1+
Preindex with writeback LDR r0,[r1,#0x4]! mem32[r1 + 0x4] 0x4
Preindex with writeback LDR r0,[r1,r2]! mem32[r1+r2] r2
Preindex with writeback LDR r0,[r1,r2,LSR#0x4]! mem32[r1 + (r2 LSR 0x4)] R1=(r2 LSR 0x4)
Preindex LDR r0,[r1,#0x4] mem32[r1 + 0x4] No change
Postindex LDR r0,[r1,r2] mem32[r1 + r2] No change
Postindex LDR r0,[r1,r2,LSR #0x4] mem32[r1-(r2 LSR 0x4)] No change
Postindex LDR r0,[r1],#0x4 mem32[r1] 0x4
Postindex LDR r0,[r1],r2 mem32[r1] r2
Postindex LDR r0,[r1],r2,LSR #0x4 mem32[r1] (r2 LSR 0x4)
Module _2_Full 46
Multiple-Register Transfer
• Load and Store instructions can transfer
multiple registers between memory and the
processor in a single instructions
• Transfer occurs from base register Rn pointing
into memory.
40000004 40000014
40000008 40000010
4000000C 4000000C
40000010 40000008
40000014 40000004
40000018 40000000
Module _2_Full 48
IA Data LDMIA LDMIA R0!, {R1-R3}
40000000 0x11111111 40000000 0x11111111
Before:
40000004 0x22222222 40000004 0x22222222 R0:40000000
40000008 0x33333333 40000008 0x33333333 After:
R0:40000000C
4000000C 0x44444444 4000000C 0x44444444 R1:0x11111111
R2:0x22222222
40000010 0x55555555 40000010 0x55555555
R3:0x33333333
40000014 0x66666666 40000014 0x66666666
40000018 0x77777777 40000018 0x77777777
Module _2_Full 49
Working of LDMIA: LDMIA ro!,[r1-r3]
Module _2_Full 50
IA Data LDMIB LDMIB R0!, {R1-R3}
40000000 0x11111111 40000000 0x11111111
Before:
40000004 0x22222222 40000004 0x22222222 R0: 40000000
40000008 0x33333333 40000008 0x33333333 After:
R0:40000000C
4000000C 0x44444444 4000000C 0x44444444 R1:0x22222222
R2:0x33333333
40000010 0x55555555 40000010 0x55555555
R3:0x44444444
40000014 0x66666666 40000014 0x66666666
40000018 0x77777777 40000018 0x77777777
Module _2_Full 51
Working of LDMIB: RO!,[R1-R3] ;
Module _2_Full 53
Working of LDMDA: LDMDA RO!,[R1-R3]
Module _2_Full 55
LDMDB
66 77 88 99 R1=88
0x10 R2=77
0x10 0x14 0x18 0x1C R3=66
Module _2_Full 57
•
SWAP instruction
The SWAP instruction is a special case of a load –store instruction.
• It swaps the contents of memory with the contents of a register.
• Swap instruction is important for implementing semaphores and
mutual exclusion in an operating system.
Instruction Explanation Usage Working
SWP Swap word between memory SWP Rd,Rm,[Rn] T= mem32[Rn],,
and a register Mem32[Rn]=Rm,, Rd=T
SWPB Swap a byte between memory SWPB Rd,Rm,[Rn] T= mem8[Rn], Mem8[Rn]=Rm
and a register Rd=T
Example
Module _2_Full 58
Block transfer
Mov R9,#0x10000000 ; start of Source block
Mov R10,#0x20000000 ; start of destination block
Mov R11,#0x10000020 ; end of source block
Loop LDMIA r9!, {r0-r7} ; load 8 words of data from src
STMIA r10!, {r0-r7} ; store 8 words of data in dest
CMP r9, r11 ; compare src index with end of src block
BNE loop
40000004 40000014
40000008 40000010
4000000C 4000000C
40000010 40000008
Ascending
SP pointing to last used memory
40000004 SP 40000014
SP
40000008 40000010
4000000C 4000000C
40000010 40000008
Ascending Module _2_Full 61
SP pointing to next unused memory
PUSH demo: STMFD(➔ STMDB)
Before: After:
R1=0x02 R1=0x03
R4=0x03 R4=0x02
Sp=0x80014 Sp=0x8000c
Module _2_Full 63
Software Interrupt Instructions
• A software interrupt instruction SWI causes software interrupt
exception, which provides a mechanism for application to call
operation system routines.
• Syntax: SWI SWI_Number
Instruction Purpose Working
SWI Software Interrupt lr_svc=address of instruction following the SWI
spsr_svc=cpsr
pc=vector+0x8
cpsr mode=SVC
cpsr I=1 (mask IRQ interrupts)
Module _2_Full 64
Program Status Register Instructions
Instruction Purpose Working Type
MRS Copy program status register to a Rd=psr MRS {<condition} Rd, <cpsr
general purpose register |spsr>
MSR Move a general purpose register to Psr[field]=Rm MSR {<condition} <cpsr
a program status register |spsr}_<fields>,Rm
MSR Move an immediate value to a Psr[field]=#imm MSR {<condition} <cpsr
program status register |spsr}_<fields>,#immediate
Before: cpsr=nzcvqIFt_svc
MRS r1,cpsr
BIC r1,r1,#0x80
MSR cpsr_c,r1
After: cpsr=nzcvqiFt_SVC
Above set of instructions will store cpsr Module
in R1 _2_Full
and negates n flag. 65
Loading Constants
• There is no ARM instruction to move a 32-bit constant into
a register.
• To aid programming there are two pseudo instructions are
used to move a 32-bit value into a register.
Module _2_Full 66
Example
AREA Program, CODE, READONLY
ENTRY
Main LDR R0,=Num1 ; loads address of Num1 to R0
ADR R1,stop ; loads address of stop to R1 –relative to PC
stop B stop
AREA Data1,DATA, READONLY
Num1 DCW 0x706F
ALIGN
END
Module _2_Full 67
(Important)
To copy a word data to another location
AREA LARGEST , CODE, READONLY
ENTRY
START
LDR R1,=VALUE1 ; loads the address of first varaibel
LDR R2,[R1] ;get its data
LDR R4,=RESULT ; loads address of destination
STR R2,[R4] ; stores the data at destination
VALUE1 DCD 0X44444444 ; ; source data
AREA DATA2,DATA,READWRITE
RESULT DCD 0X0 ; data word destination
END
Module _2_Full 70
Write an ARM7 program for transferring a block
of data word from one block to another
AREA StrCopy, CODE, READONLY
ENTRY
start LDR r1, =src ; Pointer to first string
LDR r0, =dst ; Pointer to second string
LDR r3,=n
LDR R4,[R3]
Module _2_Full 72
Salient features of ARM instruction set
• All instructions are 32 bits long.
• Most instructions execute in a single cycle.
• Most instructions can be conditionally executed.
• A load/store architecture – Data processing instructions act only on registers
• Three operand format: opcode Rd, Rs, N
• Combined ALU and shifter for high speed bit manipulation
• Specific memory access instructions with powerful auto ‐indexing addressing modes.
• 32 bit and 8 bit data types – and also 16 bit data types on ARM Architecture v4.
• Flexible multiple register load and store instructions
• Instruction set extension via coprocessors Very dense 16 ‐bit compressed instruction
set (Thumb)
Module _2_Full 73
Explain briefly co-processor
instructions of ARM processor
• Coprocessor instructions are used to extend the instruction set.
• A coprocessor can either provide additional computation capability or be used
to control the memory subsystem including caches and memory management.
• CDP{<cond>} cp, opcode1, Cd, Cn {, opcode2}
• <MRC|MCR>{<cond>} cp, opcode1, Rd, Cn, Cm {, opcode2}
• <LDC|STC>{<cond>} cp, Cd, addressing
• CDP: coprocessor data processing—perform an operation in a coprocessor
• MRC and MCR: coprocessor register transfer—move data to/from coprocessor
registers
• Ex: MRC p15, 0, r10, c0, c0, 0
– transferring the contents of CP15 register c0 to register r10
– MRC cp, opcode1, Rd, Cn, Cm {, opcode2}
• LDC and STC: coprocessor memory transfer—load and store blocks of memory
to/from a coprocessor
Module _2_Full 74
• Write a program to display message Hello
world using ARM 7 instruction
• Develop an ALP to find factorial of given
number using LOOKUP table and ARM
instruction set
• Write ARM assembly language program to add
two 32-bit numbers
Module _2_Full 75
• Write a program to display message "Hello
world" using ARM7 instructions
AREA LARGEST , CODE, READONLY
ENTRY
START LDR R0,= STRING
SWI 0x2
SWI 0X11 ; to TERMINATE
STRING DCB "HELLO WORLD\N"
END
Module _2_Full 76
I/O operation using SWI