September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
6
Task/Host-introspection/Kotlin/host-introspection.kotlin
Normal file
6
Task/Host-introspection/Kotlin/host-introspection.kotlin
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
// version 1.0.6
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
println("Word size : ${System.getProperty("sun.arch.data.model")} bits")
|
||||
println("Endianness: ${System.getProperty("sun.cpu.endian")}-endian")
|
||||
}
|
||||
16
Task/Host-introspection/Phix/host-introspection.phix
Normal file
16
Task/Host-introspection/Phix/host-introspection.phix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
function endianness()
|
||||
atom m4 = allocate(4)
|
||||
poke4(m4,#01020304)
|
||||
integer b1 = peek1s(m4)
|
||||
free(m4)
|
||||
if b1=#01 then
|
||||
return "big-endian"
|
||||
elsif b1=#04 then
|
||||
return "little-endian"
|
||||
else
|
||||
return "???"
|
||||
end if
|
||||
end function
|
||||
|
||||
printf(1,"Endianness: %s\n",{endianness()})
|
||||
printf(1,"Word size: %d bytes/%d bits\n",{machine_word(),machine_bits()})
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
8 * .Machine$sizeof.long # e.g. 32
|
||||
# or
|
||||
object.size(0L) # e.g. 32 bytes
|
||||
|
|
@ -1 +0,0 @@
|
|||
.Platform$endian # e.g. "little"
|
||||
Loading…
Add table
Add a link
Reference in a new issue