• R/O
  • HTTP
  • SSH
  • HTTPS

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

This is for exploring and demonstrating ways to extend the available integer math in C. Cコンパイラが提供する整数を拡張するための探険用のソースコードです。


ファイル情報

Rev. 056c8c9d381867aa3d96bcf05e9a165e42771547
サイズ 1,892 バイト
日時 2013-07-29 11:34:41
作者 Joel Matthew Rees
ログメッセージ

Where I ran out of time last week. Demonstrats add/sub/mul/bitdiv.
C's lack of an overflow target for math (especially division) makes it hard to expand.
But division is hard anyway, and the carry/overflow for the rest really is not that bad.

内容

# Common include stuff for an eight-bit framework 
# for testing various arithmetic techniques.
# Written by Joel Matthew Rees
# Copyright 2013, Joel Matthew Rees
# Distribution and use permitted under terms of the GPL v. 3,
# See the included file, LICENSE.TXT,
# or on-line at <http://www.gnu.org/licenses/>. 


# Keeping things relatively simple for now.
# Use "nib"thing, to keep the namespace clean.

CFLAGS = -Wall

nibObjects = nibBit.o

nibLibObjects = nibMul.o nibDiv.o nibAdd.o nibSub.o 

#nibExecutables = nibAddTest nibSubTest nibMulTest nibDivTest
nibExecutables = nibAddTest nibSubTest nibMulTest nibDivTest

#nibSources = nibBit.c

#nibLibSources = nibMul.c nibDiv.c nibAdd.c nibSub.c 


#all: $(nibLibObjects)
all: $(nibExecutables)

#	make nibMulTest

# total interdependency, let's not do this:
# $(nibLibObjects): $(nibLibSources) 

nibAdd.o: nibBit.h

nibAddTest: nibAddTest.o nibAdd.o $(nibObjects)

nibSub.o: nibBit.h

nibSubTest: nibSubTest.o nibSub.o $(nibObjects)

nibMul.o: nibBit.h

nibMulTest: nibMulTest.o nibMul.o $(nibObjects)

nibDiv.o: nibMul.o nibSub.o nibBit.h

nibDivTest: nibDivTest.o nibDiv.o $(nibObjects)


# Note that the goal object is the independent of the LD/ST accumulator syntax.
# But the goal lists have versions for each syntax.
#fig-forth.x: fig-forth.68c $(figexecutable)
#	$(figexecutable) fig-forth.68c > fig-forth.list
#	diff --strip-trailing-cr fig-forth.x fig-forth.x.goal
#	diff --strip-trailing-cr fig-forth.list fig-forth.list.goal
#	cp fig-forth.68c fig-forth_crlf.68c
#	unix2dos fig-forth_crlf.68c

#fig-forth_exorsim.x: fig-forth_exorsim.68c $(figexecutable)
#	$(figexecutable) fig-forth_exorsim.68c > fig-forth_exorsim.list
#	diff --strip-trailing-cr fig-forth_exorsim.x fig-forth_exorsim.x.goal
#	diff --strip-trailing-cr fig-forth_exorsim.list fig-#forth_exorsim.list.goal


.PHCLEAN: nibclean
nibclean: 
	-rm $(nibobjects)