add more code
This commit is contained in:
parent
0385a6ee7d
commit
fdfeee1d72
3 changed files with 106 additions and 0 deletions
BIN
230810組合語言/ex.out
Executable file
BIN
230810組合語言/ex.out
Executable file
Binary file not shown.
73
230810組合語言/ex.s
Normal file
73
230810組合語言/ex.s
Normal file
|
@ -0,0 +1,73 @@
|
|||
# (c) 2023 Tan, Kian-ting
|
||||
# ===
|
||||
# Tiananmen Massacre - Hong Kong Independence - Free Hong Kong, Tibet, Southern Mongolia
|
||||
# Uyghur Concentration Camps - Taiwan Independence - Chinese Internet Censorships
|
||||
# Red Terror by Chinese Communist Party
|
||||
# ===
|
||||
# 9 * 9 multipulation table
|
||||
|
||||
# storing string
|
||||
.data
|
||||
format: .asciz "%d * %d = %d\n" #string succeeded by '\0'
|
||||
|
||||
.text
|
||||
.global main
|
||||
|
||||
loop1:
|
||||
# b += 1
|
||||
addq $1, %r9
|
||||
|
||||
# a = 0
|
||||
movq $1, %r8
|
||||
|
||||
# goto loop
|
||||
jmp loop
|
||||
|
||||
loop:
|
||||
|
||||
mov %r8, %rsi
|
||||
mov %r9, %rdx
|
||||
|
||||
# rcx = r8 * r9
|
||||
mov %r8, %rcx
|
||||
imulq %r9, %rcx
|
||||
|
||||
xor %rax, %rax # rax = 0
|
||||
# backup r8, rdi, r9
|
||||
mov %r8, %r12
|
||||
mov %rdi, %r13
|
||||
mov %r9, %r14
|
||||
# printf(rdi, rsi, rdx, rcx);
|
||||
call printf
|
||||
|
||||
# restore r8, rdi, r9
|
||||
mov %r14, %r9
|
||||
mov %r13, %rdi
|
||||
mov %r12, %r8
|
||||
|
||||
# a += 1
|
||||
addq $1, %r8
|
||||
|
||||
# IF a <= 9 goto loop
|
||||
cmp $9, %r8
|
||||
jle loop
|
||||
|
||||
# IF b < 9 goto loop1
|
||||
cmp $9, %r9
|
||||
jl loop1
|
||||
|
||||
# goto final
|
||||
jmp final
|
||||
main:
|
||||
|
||||
push %rbx
|
||||
mov $1, %r8 # r8 = a
|
||||
mov $1, %r9 # r9 = b
|
||||
mov $0, %r15
|
||||
mov $format, %rdi
|
||||
jmp loop
|
||||
|
||||
final:
|
||||
pop %rbx
|
||||
ret
|
||||
|
33
臺語拼寫法轉換/poj2tl.csv
Normal file
33
臺語拼寫法轉換/poj2tl.csv
Normal file
|
@ -0,0 +1,33 @@
|
|||
POJ,TL
|
||||
ch,ts
|
||||
o͘,oo
|
||||
ó͘,óo
|
||||
ò͘,òo
|
||||
ô͘,ôo
|
||||
ō͘,ōo
|
||||
o̍,o̍o
|
||||
hⁿ, nnh
|
||||
ⁿ,nn
|
||||
ek,ik
|
||||
e̍k,i̍k
|
||||
eng,ing
|
||||
éng,íng
|
||||
èng,ìng
|
||||
êng,îng
|
||||
ēng,īng
|
||||
oa,ua
|
||||
óa,uá
|
||||
òa,uà
|
||||
ôa,uâ
|
||||
ōa,uā
|
||||
o̍a,ua̍
|
||||
oá,uá
|
||||
oà,uà
|
||||
oâ,uâ
|
||||
oā,uā
|
||||
oa̍,ua̍
|
||||
úi,uí
|
||||
ùi,uì
|
||||
ûi,uî
|
||||
ūi,uī
|
||||
u̍i,ui̍
|
|
Loading…
Reference in a new issue