2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
33
Task/Machine-code/PicoLisp/machine-code.l
Normal file
33
Task/Machine-code/PicoLisp/machine-code.l
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
(setq P
|
||||
(struct (native "@" "malloc" 'N 39) 'N
|
||||
# Align
|
||||
144 # nop
|
||||
144 # nop
|
||||
|
||||
# Prepare stack
|
||||
106 12 # pushq $12
|
||||
184 7 0 0 0 # mov $7, %eax
|
||||
72 193 224 32 # shl $32, %rax
|
||||
80 # pushq %rax
|
||||
|
||||
# Rosetta task code
|
||||
139 68 36 4 3 68 36 8
|
||||
|
||||
# Get result
|
||||
76 137 227 # mov %r12, %rbx
|
||||
137 195 # mov %eax, %ebx
|
||||
72 193 227 4 # shl $4, %rbx
|
||||
128 203 2 # orb $2, %bl
|
||||
|
||||
# Clean up stack
|
||||
72 131 196 16 # add $16, %rsp
|
||||
|
||||
# Return
|
||||
195 ) # ret
|
||||
foo (>> 4 P) )
|
||||
|
||||
# Execute
|
||||
(println (foo))
|
||||
|
||||
# Free memory
|
||||
(native "@" "free" NIL P)
|
||||
Loading…
Add table
Add a link
Reference in a new issue