|
楼主 |
发表于 2012-4-21 23:30:56
|
显示全部楼层
50g应该还可以实现c语言
tian 发表于 2012-4-21 23:16
有第三方的编译器,GCC应该可以搞一个,反正它用的是ARM。
HP的开发包里好像不支持C,不过支持可视化编程,类似这个截图:
在example目录下没找到长得象C的程序,都是这种格式:
**********************************************************************
* Name: UBZ2
* Desc: UBZ2 DeCompressor, compatible with BZ
* Author : Yann Collet
* Date : 9/2010
*
*
* This version does an EVAL aing
**********************************************************************
ASSEMBLE
sMNEXT EQU 9 Match expectation flag
sGARB EQU 10 Garbage collector check flag
NBITS EQU 4 LiteralLength Bits
NMASK EQU 2^(NBITS)-1
NBITS2 EQU 6
NMASK2 EQU 2^(NBITS2)-1
MBITS EQU 5 MatchLength Bits
MMASK EQU 2^(MBITS)-1
MBITS2 EQU 7
MMASK2 EQU 2^(MBITS2)-1
MINMAT EQU 6 Minimum match length
RPL
NULLNAME _DeCmPRss_
CODEM
ST=0.sGARB
*.reungz
SAVE
C=DAT1.A % A = Object at stack level 1
CD1EX % D1 ->stk1
RSTK=C % Save ->Stk1 into RSTK
D1+10 % Skip Prolog & StrLength
A=DAT1.A
D1+4
LC(4) $5A42 % "BZ"
P=3 ?C=A.WP -> .HeaderOK
P=0 LC(5) =SETTYPEERR
A=C.A LOAD PC=(A) % EXIT with error TYPE_ERR
*.HeaderOK
P=0
C=DAT1.A % C = ObSize
GOSBVL =CREATETEMP % Allocates C.A nibbles; carry if notenoughmemory; ->D0=bottom,D1=topofarea,->B.A=C.A=@D1=offset
GONC .ugzmemok
?ST=1.sGARB -> .ugzmerr
GOSUB .PassGC
$(5) =DOCOL
$(5) =GARBAGE
$(5) =COLA
$(5) =DOCODE
G5 .UGZEND
ST=1.sGARB
GOTO .reungz
*.PassGC
C=RSTK % C = Adress.of.DOCOL
A=C.A LOAD PC=(A) % Restore RPL & Start DOCOL
*.ugzmerr
GOVLNG =GPMEMERR % "Not enough memory" event detected
*.ugzmemok
CD1EX R1=C.W % ->obend into R1
C=RSTK D1=C
C=DAT1.A % C : Stack level 1 (Source)
C+(5+5).A C+(5+4).A % Skip Prolog, StrSize, Header, ObSize
A=C.A
CD0EX R3=C.W % D0 : ->Source / R3 = ->obstart
C=DAT0.A C+A.A R2=C.W % ->lits into R2
D0+5 % ->pats
A=R3.W DAT1=A.A % Replace ->stk1 by ->Ob
D1=A % D1 : Destination ->Ob
ST=0.sMNEXT
B=0.S % UsedBits = 0 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
|