mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
The grand language renaming bonanza (#3278)
* Removing FORTRAN samples because OS X case-insensitive filesystems :-\ * Adding Fotran samples back * FORTRAN -> Fortran * Groff -> Roff * GAS -> Unix Assembly * Cucumber -> Gherkin * Nimrod -> Nim * Ragel in Ruby Host -> Ragel * Jade -> Pug * VimL -> Vim script
This commit is contained in:
committed by
Brandon Black
parent
9b941a34f0
commit
d8b91bd5c4
91
samples/Unix Assembly/hello.ms
Normal file
91
samples/Unix Assembly/hello.ms
Normal file
@@ -0,0 +1,91 @@
|
||||
# output(): Hello, world.\n
|
||||
# mach(): all
|
||||
|
||||
# Emit hello world while switching back and forth between arm/thumb.
|
||||
# ??? Unfinished
|
||||
|
||||
.macro invalid
|
||||
# This is "undefined" but it's not properly decoded yet.
|
||||
.word 0x07ffffff
|
||||
# This is stc which isn't recognized yet.
|
||||
stc 0,cr0,[r0]
|
||||
.endm
|
||||
|
||||
.global _start
|
||||
_start:
|
||||
# Run some simple insns to confirm the engine is at least working.
|
||||
nop
|
||||
|
||||
# Skip over output text.
|
||||
|
||||
bl skip_output
|
||||
|
||||
hello_text:
|
||||
.asciz "Hello, world.\n"
|
||||
|
||||
.p2align 2
|
||||
skip_output:
|
||||
|
||||
# Prime loop.
|
||||
|
||||
mov r4, r14
|
||||
|
||||
output_next:
|
||||
|
||||
# Switch arm->thumb to output next chacter.
|
||||
# At this point r4 must point to the next character to output.
|
||||
|
||||
adr r0, into_thumb + 1
|
||||
bx r0
|
||||
|
||||
into_thumb:
|
||||
.thumb
|
||||
|
||||
# Output a character.
|
||||
|
||||
mov r0,#3 @ writec angel call
|
||||
mov r1,r4
|
||||
swi 0xab @ ??? Confirm number.
|
||||
|
||||
# Switch thumb->arm.
|
||||
|
||||
adr r5, back_to_arm
|
||||
bx r5
|
||||
|
||||
.p2align 2
|
||||
back_to_arm:
|
||||
.arm
|
||||
|
||||
# Load next character, see if done.
|
||||
|
||||
add r4,r4,#1
|
||||
sub r3,r3,r3
|
||||
ldrb r5,[r4,r3]
|
||||
teq r5,#0
|
||||
beq done
|
||||
|
||||
# Output a character (in arm mode).
|
||||
|
||||
mov r0,#3
|
||||
mov r1,r4
|
||||
swi #0x123456
|
||||
|
||||
# Load next character, see if done.
|
||||
|
||||
add r4,r4,#1
|
||||
sub r3,r3,r3
|
||||
ldrb r5,[r4,r3]
|
||||
teq r5,#0
|
||||
bne output_next
|
||||
|
||||
done:
|
||||
mov r0,#0x18
|
||||
ldr r1,exit_code
|
||||
swi #0x123456
|
||||
|
||||
# If that fails, try to die with an invalid insn.
|
||||
|
||||
invalid
|
||||
|
||||
exit_code:
|
||||
.word 0x20026
|
||||
63
samples/Unix Assembly/hello.s
Normal file
63
samples/Unix Assembly/hello.s
Normal file
@@ -0,0 +1,63 @@
|
||||
.cstring
|
||||
LC0:
|
||||
.ascii "Hello World\0"
|
||||
.text
|
||||
.globl _main
|
||||
_main:
|
||||
LFB3:
|
||||
pushq %rbp
|
||||
LCFI0:
|
||||
movq %rsp, %rbp
|
||||
LCFI1:
|
||||
leaq LC0(%rip), %rdi
|
||||
call _puts
|
||||
movl $0, %eax
|
||||
leave
|
||||
ret
|
||||
LFE3:
|
||||
.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
|
||||
EH_frame1:
|
||||
.set L$set$0,LECIE1-LSCIE1
|
||||
.long L$set$0
|
||||
LSCIE1:
|
||||
.long 0x0
|
||||
.byte 0x1
|
||||
.ascii "zR\0"
|
||||
.byte 0x1
|
||||
.byte 0x78
|
||||
.byte 0x10
|
||||
.byte 0x1
|
||||
.byte 0x10
|
||||
.byte 0xc
|
||||
.byte 0x7
|
||||
.byte 0x8
|
||||
.byte 0x90
|
||||
.byte 0x1
|
||||
.align 3
|
||||
LECIE1:
|
||||
.globl _main.eh
|
||||
_main.eh:
|
||||
LSFDE1:
|
||||
.set L$set$1,LEFDE1-LASFDE1
|
||||
.long L$set$1
|
||||
LASFDE1:
|
||||
.long LASFDE1-EH_frame1
|
||||
.quad LFB3-.
|
||||
.set L$set$2,LFE3-LFB3
|
||||
.quad L$set$2
|
||||
.byte 0x0
|
||||
.byte 0x4
|
||||
.set L$set$3,LCFI0-LFB3
|
||||
.long L$set$3
|
||||
.byte 0xe
|
||||
.byte 0x10
|
||||
.byte 0x86
|
||||
.byte 0x2
|
||||
.byte 0x4
|
||||
.set L$set$4,LCFI1-LCFI0
|
||||
.long L$set$4
|
||||
.byte 0xd
|
||||
.byte 0x6
|
||||
.align 3
|
||||
LEFDE1:
|
||||
.subsections_via_symbols
|
||||
Reference in New Issue
Block a user