• R/O
  • HTTP
  • SSH
  • HTTPS

Frequently used words (click to add to your profile)

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

Implementing figFORTH on SH3 assembler


File Info

Rev. deab3b82bdeda15f36b40adf7a9e29e5471a6203
Size 3,809 bytes
Time 2014-03-17 21:13:31
Author Joel Matthew Rees
Log Message

Through ?STACK.
May be my last edits for a while -- I've run out of time.

Content

	.list ON, EXP
	
; Temporary test stuff for fig-FORTH for SH-3
; Joel Matthew Rees, Hyougo Polytec Center
; 2014.03.11

; Licensed extended under GPL v. 2 or 3, or per the following:
; ------------------------------------LICENSE-------------------------------------
;
; Copyright (c) 2009, 2010, 2011 Joel Matthew Rees
;
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to deal
; in the Software without restriction, including without limitation the rights
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
; copies of the Software, and to permit persons to whom the Software is
; furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in
; all copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
; THE SOFTWARE.
;
; --------------------------------END-OF-LICENSE----------------------------------

; Monolithic, not separate assembly:
; context.inc must be included before this file.
;	.include	"context.inc"
;
;	.section	test, code


	.AIFDEF	SHIMMED

; Temporary forward definitions --
; Added here as they are used, 
; commented out as they are defined.
;
; These aren't magic, just shims for the assembler.
;
; QEXEC:	.define	"NOOP"	; used in COLON
; SCSP:	.define	"NOOP"	; used in COLON
; CURENT:	.define	"NOOP"	; used in COLON
; CONTXT:	.define	"NOOP"	; used in COLON
CREATE:	.define	"NOOP"	; used in COLON
; RBRAK:	.define	"NOOP"	; used in COLON
; PSCODE:	.define	"NOOP"	; used in COLON
; QCSP:	.define	"NOOP"	; used in SEMI
; COMPIL:	.define	"NOOP"	; used in SEMI
; SMUDGE:	.define	"NOOP"	; used in SEMI
; LBRAK:	.define	"NOOP"	; used in SEMI
; COMMA:	.define	"NOOP"	; used in CONSTANT
; DODOES:	.define	"NOOP"	; used in ROMFORTH
DOVOC:	.define	"NOOP"	; used in ROMFORTH
ERROR:	.define	"NOOP"	; used in QERROR
; QSTACK:	.define	"NOOP"	; used in ;CODE
WORD:	.define	"NOOP"	; used in DOTQ

; :	.define	"NOOP"



	.AENDI


	.AIFDEF	TESTING

; test code
;	
TEST_THINGY:
	.data.l	LIT, 1
	.data.l	LIT, -1
	.data.l BRAN
	mTARGET BRAN_THINGY
	.data.l 4, 3, 2, 1, 0	; should branch over these
BRAN_THINGY:
	.data.l	PLUS
	.data.l ZBRAN
	mTARGET ZBRAN_THINGY0
	.data.l 0, 1, 2, 3	; should branch over these
ZBRAN_THINGY0:
	.data.l LIT, 20
	.data.l LIT, 19
	.data.l SUB
	.data.l ZBRAN
	mTARGET ZBRAN_THINGY0
	.data.l LIT, 15
	.data.l	LIT, 10
	.data.l XDO
LOOP_THINGY:
	.data.l LIT, "*"
	.data.l EMIT
	.data.l XLOOP
	mTARGET LOOP_THINGY
	.data.l LIT, h'f0f0f0f0
	.data.l LIT, h'0f0f0f0f
	.data.l USTAR
	.data.l	LIT, h'6A4C2E10, LIT, h'E2C4A68, DSUB, OR
	.data.l ZBRAN
	mTARGET UPRODUCTOK
	.data.l	-5
UPRODUCTOK:
	.data.l LIT, h'10010000
	.data.l LIT, h'10011001
	.data.l LIT, h'10010
	.data.l USLASH
	.data.l AND, LIT, -1, SUB
	.data.l ZBRAN
	mTARGET UOVERFLOWOK
	.data.l -1
UOVERFLOWOK:
	.data.l LIT, h'1000fe76
	.data.l LIT, h'00000100
	.data.l LIT, h'00010010
	.data.l USLASH
	.data.l LIT, H'01000000
	.data.l SUB
	.data.l ZBRAN
	mTARGET UQUOTIENTOK
	.data.l 1
UQUOTIENTOK:
	.data.l LIT, H'fe76
	.data.l SUB
	.data.l ZBRAN
	mTARGET UREMAINDEROK
	.data.l 3
UREMAINDEROK:
	.data.l	BRAN
	mTARGET TEST_THINGY

	.AENDI