lightning
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Lightning] New Alpha port


From: Paulo César Pereira de Andrade
Subject: [Lightning] New Alpha port
Date: Sun, 10 Aug 2014 12:08:32 -0300

  Hello,

  Thanks to Trent Nelson and staff from snakebit.net for reviving and
giving me access to their Alpha host, now an Alpha port has been
done, and lightning 2.0.5 should be available soon with it.

  To have an idea, when using the main test tool driver:

% cat hello.tst
.data    32
fmt:
.c    "hello world!\n"
.code
    prolog
    prepare
        pushargi fmt
    finishi @printf
    reti 0
    epilog

% ./lightning -v hello.tst
           0x12000      ldah    t12,0(gp)
           0x12004      lda     gp,0(gp)
           0x12008      subq    sp,0x80,sp
           0x1200c      stq     ra,0(sp)
           0x12010      stq     fp,8(sp)
           0x12014      mov     sp,fp
           0x12018      subq    sp,0x8,sp
           0x1201c      lda     a0,32256
           0x12020      lda     at,1
           0x12024      ldah    a0,16401(a0)
           0x12028      sll     a0,0x20,a0
           0x1202c      srl     a0,0x20,a0
           0x12030      sll     at,0x20,at
           0x12034      or      a0,at,a0
           0x12038      lda     t12,-13696
           0x1203c      lda     at,1023
           0x12040      ldah    t12,-32754(t12)
           0x12044      ldah    at,0(at)
           0x12048      sll     t12,0x20,t12
           0x1204c      srl     t12,0x20,t12
           0x12050      sll     at,0x20,at
           0x12054      or      t12,at,t12
           0x12058      jsr     ra,(t12),0x1205c
           0x1205c      mov     0,v0
           0x12060      mov     fp,sp
           0x12064      ldq     ra,0(sp)
           0x12068      ldq     fp,8(sp)
           0x1206c      addq    sp,0x80,sp
           0x12070      ret
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
hello world!

  You may notice that, like most riscs, loading constants is not easy,
and most of the instructions in the example above are to load the
"hello world!\n" string and printf address, but this example is kind of
a special case of course.

Thanks,
Paulo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]