1 Star 0 Fork 0

marvtao/Concordia

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
StringDisplay.s 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
marvintau 提交于 2020-11-25 11:10 . rebased
# OUTPUT STRING CONSTANT
# ======================
# A handful macro that defines a code word that output a string. Useful
# in debugging stage, but considered to be removed in future release,
# since a general word that output given string address will be more
# efficient, and takes less space.
# Before we developed the word that enables us to define string in run
# time, we will keep using this one.
.macro PrintStringInitial address
pushq %rax
pushq %rbx
pushq %rcx
pushq %rdi
pushq %rsi
pushq %rdx
pushq \address
movq $SyscallDisplay, %rax
movq $1, %rdi
movq $1, %rbx
leaq 8(\address), %rsi
movq (\address), %rdx
syscall
popq \address
popq %rdx
popq %rsi
popq %rdi
popq %rcx
popq %rbx
popq %rax
.endm
.macro StringConst name, string
Code \name
jmp SkippedContent\name
String Content\name, "\string"
SkippedContent\name:
push %r15
leaq Content\name(%rip), %r15
leaq -8(%r15), %r15
PrintStringInitial %r15
pop %r15
CodeEnd \name
.endm
StringConst Jesus, "BELOVED SON\n"
StringConst Maria, "THE VIRGIN\n"
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/marvintau/concordia.git
git@gitee.com:marvintau/concordia.git
marvintau
concordia
Concordia
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385