Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARM Assembly syntax test file #1240

Merged
merged 1 commit into from
Oct 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions tests/syntax-tests/highlighted/ARM Assembly/test.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.data

.balign 4
red: .word 0
green: .word 0
blue: .word 0

.text
.global grayscale
.func grayscale

grayscale:
assign:
 /* some comment */
 ldr ip, addr_red
 str r3, [ip]
 ldr ip, addr_green
 ldmfd r13!, {r3}
 str r3, [ip]
 ldr ip, addr_blue
 ldmfd r13!, {r3}
 str r3, [ip]
 stmfd r13!, {r4-r8}
 ldr ip, addr_red
 ldr r3, [ip]
 ldr ip, addr_green
 ldr r4, [ip]
 ldr ip, addr_blue
 ldr r5, [ip] /* another comment */
grayscale_loop:
 ldrb r6, [r1]
 mul r6, r3, r6
 add r1, r1, #1
 ldrb r7, [r1]
 mul r7, r4, r7
 add r1, r1, #1
 ldrb r8, [r1]
 mul r8, r5, r8
 add r1, r1, #1
 add r6, r6, r7
 add r6, r6, r8
 asr r6, r6, #8
 str r6, [r2]
 add r2, r2, #1
 sub r0, r0, #1
 cmp r0, #0
 bne grayscale_loop
 ldmfd r13!, {r4-r8}
 stmfd r13!, {r0-r1}
 bx lr

addr_red: .word red
addr_green: .word green
addr_blue: .word blue

55 changes: 55 additions & 0 deletions tests/syntax-tests/source/ARM Assembly/test.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.data

.balign 4
red: .word 0
green: .word 0
blue: .word 0

.text
.global grayscale
.func grayscale

grayscale:
assign:
/* some comment */
ldr ip, addr_red
str r3, [ip]
ldr ip, addr_green
ldmfd r13!, {r3}
str r3, [ip]
ldr ip, addr_blue
ldmfd r13!, {r3}
str r3, [ip]
stmfd r13!, {r4-r8}
ldr ip, addr_red
ldr r3, [ip]
ldr ip, addr_green
ldr r4, [ip]
ldr ip, addr_blue
ldr r5, [ip] /* another comment */
grayscale_loop:
ldrb r6, [r1]
mul r6, r3, r6
add r1, r1, #1
ldrb r7, [r1]
mul r7, r4, r7
add r1, r1, #1
ldrb r8, [r1]
mul r8, r5, r8
add r1, r1, #1
add r6, r6, r7
add r6, r6, r8
asr r6, r6, #8
str r6, [r2]
add r2, r2, #1
sub r0, r0, #1
cmp r0, #0
bne grayscale_loop
ldmfd r13!, {r4-r8}
stmfd r13!, {r0-r1}
bx lr

addr_red: .word red
addr_green: .word green
addr_blue: .word blue