File:  [gforth] / gforth / arch / r8c / asm-test.fs
Revision 1.3: download - view: text, annotated - select for diffs
Wed Dec 31 15:29:14 2008 UTC (13 years, 11 months ago) by anton
Branches: MAIN
CVS tags: HEAD
updated copyright years; related changes in administrative files

    1: \ FORTH Assembler for R8C - test file
    2: \
    3: \ Copyright (C) 2006,2007,2008 Free Software Foundation, Inc.
    4: 
    5: \ This file is part of Gforth.
    6: 
    7: \ Gforth is free software; you can redistribute it and/or
    8: \ modify it under the terms of the GNU General Public License
    9: \ as published by the Free Software Foundation, either version 3
   10: \ of the License, or (at your option) any later version.
   11: 
   12: \ This program is distributed in the hope that it will be useful,
   13: \ but WITHOUT ANY WARRANTY; without even the implied warranty of
   14: \ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15: \ GNU General Public License for more details.
   16: 
   17: \ You should have received a copy of the GNU General Public License
   18: \ along with this program. If not, see http://www.gnu.org/licenses/.
   19: \
   20: \ Autor:          Heinz Schnitter (hfs)
   21: 
   22:  cr .s
   23:  RESET
   24: 
   25:  cr R1 , R2 MOV.W:G
   26:  cr R1 , A0 MOV.W:G
   27:  cr R1 , [A0] MOV.W:G
   28:  cr R1 , [A1] MOV.W:G
   29:  cr R1 , $12 [A0] MOV.W:G
   30:  cr R1 , $345 [A0] MOV.W:G
   31: cr .s
   32:  cr R1 , $12 [SB] MOV.W:G
   33:  cr R1 , $1234 [SB] MOV.W:G
   34:  cr R1 , $12 [FB] MOV.W:G
   35:  cr R1 , $1234 MOV.W:G
   36: cr .s
   37:  cr [A0] , R1 MOV.W:G
   38:  cr $12 [A1] , R0 MOV.W:G
   39:  cr [A0] , [A1] MOV.W:G
   40:  cr $12 [A1] , [A0] MOV.W:G
   41:  cr $12 [A0] , [A1] MOV.W:G
   42:  cr $1234 [A0] , $5678 [A1] MOV.W:G
   43:  cr $1234 [A1] , $5678 [A0] MOV.W:G
   44:  cr $12 [A1] , $3456 [SB] MOV.W:G
   45:  cr $12 [A1] , $34 [FB] MOV.W:G
   46:  cr $1234 [A1] , $5678 MOV.W:G
   47: \ cr  [SB] , R1 MOV.W:G              \ error
   48:  cr $12 [SB] , R0 MOV.W:G
   49: \ cr [SB] , [A1] MOV.W:G             \ error
   50:  cr $12 [SB] , [A0] MOV.W:G
   51:  cr $12 [SB] , [A1] MOV.W:G
   52:  cr $1234 [SB] , $5678 [A1] MOV.W:G
   53:  cr $1234 [SB] , $5678 [A0] MOV.W:G
   54:  cr $12 [SB] , $3456 [SB] MOV.W:G
   55:  cr $12 [SB] , $34 [FB] MOV.W:G
   56:  cr $1234 [SB] , $5678 MOV.W:G
   57: cr .s
   58: \ cr [FB] , R1 MOV.W:G               \ error
   59:  cr $12 [FB] , R0 MOV.W:G
   60: \ cr [FB] , [A1] MOV.W:G             \ error
   61:  cr $12 [FB] , [A0] MOV.W:G
   62:  cr $12 [FB] , [A1] MOV.W:G
   63: \ cr $1234 [FB] , $5678 [A1] MOV.W:G \ error
   64: \ cr $1234 [FB] , $5678 [A0] MOV.W:G \ error
   65:  cr $12 [FB] , $3456 [SB] MOV.W:G
   66:  cr $12 [FB] , $34 [FB] MOV.W:G
   67: \ cr $1234 [FB] , $5678 MOV.W:G      \ error
   68:  cr .( vor mov.b:g ) .s
   69:  cr R0L , R0H MOV.B:G
   70:  cr R0H , A0 MOV.B:G
   71:  cr R1L , [A0] MOV.B:G
   72:  cr R1H , [A1] MOV.B:G
   73:  cr R0L , $12 [A0] MOV.B:G
   74:  cr R0H , $345 [A0] MOV.B:G
   75:  cr R1L , $12 [SB] MOV.B:G
   76:  cr R1H , $1234 [SB] MOV.B:G
   77:  cr R1L , $12 [FB] MOV.B:G
   78:  cr R1H , $1234 MOV.B:G
   79:  cr .( vor mov.w:g ) .s
   80:  cr  # $abcd , R2 MOV.W:G
   81:  cr  # $abcd , A0 MOV.W:G
   82:  cr  # $abcd , [A0] MOV.W:G
   83:  cr  # $abcd , [A1] MOV.W:G
   84:  cr  # $abcd , $12 [A0] MOV.W:G
   85:  cr  # $abcd , $345 [A0] MOV.W:G
   86:  cr  # $abcd , $12 [SB] MOV.W:G
   87:  cr  # $abcd , $1234 [SB] MOV.W:G
   88:  cr  # $abcd , $12 [FB] MOV.W:G
   89:  cr  # $abcd , $1234 MOV.W:G
   90:  cr .s
   91:  cr  $1234 , R1 MOV.W:G
   92:  cr  $1234 , $5678 MOV.W:G
   93:  cr  $1234 , $56 [FB] MOV.W:G
   94:  cr  $1234 , $5678 [SB] MOV.W:G
   95:  cr
   96:  cr  $1234 , [A1] MOV.W:G
   97:  cr  $1234 , $56 [A0] MOV.W:G
   98:  cr  $1234 , $5678 [A1] MOV.W:G
   99: cr .s
  100:  cr  $12 JNC
  101:  cr  $1234 JMP.W
  102: cr .s
  103:  cr R0 JMPI.W
  104:  cr R1 JMPI.W
  105:  cr R2 JMPI.W
  106:  cr R3 JMPI.W
  107:  cr A0 JMPI.W
  108:  cr [A0] JMPI.W
  109:  cr $12 [A0] JMPI.W
  110:  cr $1234 [A0] JMPI.W
  111:  cr $12345 [A0] JMPI.W
  112:  cr A1 JMPI.W
  113:  cr [A1] JMPI.W
  114:  cr $12 [A1] JMPI.W
  115:  cr $1234 [A1] JMPI.W
  116:  cr $12345 [A1] JMPI.W
  117:  cr $12 [SB] JMPI.W
  118:  cr $1234 [SB] JMPI.W
  119:  cr $12 [FB] JMPI.W
  120: \ cr $1234 [FB] JMPI.W      \ error
  121:  cr $1234 JMPI.W
  122:  cr
  123:  cr R0 abs.b
  124:  cr R1 abs.b
  125:  cr R2 abs.b
  126:  cr R3 abs.b
  127:  cr A0 abs.b
  128:  cr [A0] abs.b
  129:  cr $12 [A0] abs.b
  130:  cr $1234 [A0] abs.b
  131:  cr $12345 [A0] abs.b
  132:  cr A1 abs.b
  133:  cr [A1] abs.b
  134:  cr $12 [A1] abs.b
  135:  cr $1234 [A1] abs.b
  136:  cr $12345 [A1] abs.b
  137:  cr $12 [SB] abs.b
  138:  cr $1234 [SB] abs.b
  139:  cr $12 [FB] abs.b
  140: \ cr $1234 [FB] abs.b      \ error
  141:  cr $1234 abs.b
  142:  cr
  143:  cr R0 div.b
  144:  cr R1 div.b
  145:  cr R2 div.b
  146:  cr R3 div.b
  147:  cr A0 div.b
  148:  cr [A0] div.b
  149:  cr $12 [A0] div.b
  150:  cr $1234 [A0] div.b
  151:  cr $12345 [A0] div.b
  152:  cr A1 div.b
  153:  cr [A1] div.b
  154:  cr $12 [A1] div.b
  155:  cr $1234 [A1] div.b
  156:  cr $12345 [A1] div.b
  157:  cr $12 [SB] div.b
  158:  cr $1234 [SB] div.b
  159:  cr $12 [FB] div.b
  160: \ cr $1234 [FB] div.b      \ error
  161:  cr $1234 div.b
  162:  cr
  163:  cr [A0] pop.w:g
  164:  cr [A1] push.w:g
  165:  cr $12 [A0] pop.w:g
  166:  cr $345 [A1] push.w:g
  167:  cr
  168:  cr .( # push )
  169:  cr # $12 push.b:g
  170:  cr # $345 push.w:g
  171: \ cr # $345 pop.w:g
  172:  cr
  173:  cr   # $ffff , ip mov.w:g            \ ip will be patched
  174:  cr   # $fef0 , sp ldc                \ sp at $FD80...$FEF0
  175:  cr   # $fd80 , rp mov.w:g            \ rp at $F.00...$FD80
  176:  cr   # -2 , rp add.w:q
  177:  cr   w , r2 mov.w:g
  178:  cr   rp , w mov.w:g  ip , [w] mov.w:g
  179:  cr   # 4 , r2 add.w:q  r2 , ip mov.w:g
  180:  cr   rp , w mov.w:g  # 2 , rp add.w:q
  181:  cr   [w] , ip mov.w:g
  182:  cr   tos , w mov.w:g                  \ copy tos to w
  183:  cr   tos pop.w:g                      \ get new tos
  184:  cr   [w] jmpi.w                       \ execute
  185:  cr   # 0 , R2 MOV.W:G
  186:  cr  # 1 , A0 MOV.W:G
  187:  cr  # -1 , [A0] MOV.W:G
  188:  cr  # 2 , [A1] MOV.W:G
  189:  cr  # -2 , $12 [A0] MOV.W:G
  190:  cr  # 3 , $345 [A0] MOV.W:G
  191:  cr  # -3 , $12 [SB] MOV.W:G
  192:  cr  # 4 , $1234 [SB] MOV.W:G
  193:  cr  # -8 , $12 [FB] MOV.W:G
  194:  cr  # 7 , $1234 MOV.W:G
  195:  cr
  196:  cr  # 0 , R2 MOV.W:q
  197:  cr  # 1 , A0 MOV.W:q
  198:  cr  # -1 , [A0] MOV.W:q
  199:  cr  # 2 , [A1] MOV.W:q
  200:  cr  # -2 , $12 [A0] MOV.W:q
  201:  cr  # 3 , $345 [A0] MOV.W:q
  202:  cr  # -3 , $12 [SB] MOV.W:q
  203:  cr  # 4 , $1234 [SB] MOV.W:q
  204:  cr  # -8 , $12 [FB] MOV.W:q
  205:  cr  # 7 , $1234 MOV.W:q
  206: \ cr  # 8 , $1234 MOV.W:q      \ error
  207:  cr  sp , $3456 [SB] stc
  208:  cr  # $1234 , sp ldc
  209:  cr  [A0] , sp ldc
  210:  cr  $12 [A0] , sp ldc
  211:  cr  [A1] , sp ldc
  212:  cr  $12 [A1] , sp ldc
  213: \ cr  [SB] , sp ldc            \ error
  214:  cr  $12 [SB] , sp ldc
  215:  cr  $1234 [SB] , sp ldc
  216:  cr  $12 jle
  217:  cr  u fclr
  218:  cr  o fset
  219:  cr .( vor mul.w:g ) .s
  220:  cr  # $abcd , [A0] MUL.W:G
  221:  cr  # $abcd , [A1] MUL.W:G
  222:  cr  $1234 , [A0] MUL.W:G
  223:  cr  $1234 , [A1] MUL.W:G
  224:  cr  # $abcd , $1234 MUL.W:G
  225:  cr .( vor mul.b:g ) .s
  226:  cr  # $abcd , [A0] mul.b:G
  227:  cr  # $abcd , [A1] mul.b:G
  228:  cr  $1234 , [A0] mul.b:G
  229:  cr  $1234 , [A1] mul.b:G
  230:  cr  # $5678 , $1234 mul.b:G
  231:  cr  $1234 , $5678 mul.b:G
  232:  cr .s
  233:  cr  # $5678 , $1234 mov.b:G
  234:  cr  $1234 , $5678 mov.b:G
  235: cr .s
  236: 
  237: \ for tests only                             hfs 07:47 04/24/92
  238: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>