home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crawly Crypt Collection 1
/
crawlyvol1.bin
/
program
/
compiler
/
nasm20b
/
nasm_src
/
ops.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-01-19
|
7KB
|
164 lines
/* ---------------------------------------------------------------------- */
/* Copyright (C) 1991 by Natürlich! */
/* This file is copyrighted! */
/* Refer to the documentation for details. */
/* ---------------------------------------------------------------------- */
#include "defines.h"
#include "ops.h"
/* A I A R R A R R I R I I I
C N B E E B E E M E N N N
C S S L L S L L P L D D D
U T 0 X Y X Y L A X Y
0 0
Labels have two entries: one in ABS w/255
and one in RELA w/the real value.
*/
#if OS == MSDOS
# define _brk xbrk
#endif
byte
_adc[] = { 0,105,101,117, 0,109,125,121, 0, 0, 97,113,114 },
_and[] = { 0, 41, 37, 53, 0, 45, 61, 57, 0, 0, 33, 49, 50 },
_asl[] = { 10, 0, 6, 22, 0, 14, 30, 0, 0, 0, 0, 0, 0 },
_bcc[] = { 0, 0, 0, 0, 0,255, 0, 0, 0,144, 0, 0, 0 },
_bcs[] = { 0, 0, 0, 0, 0,255, 0, 0, 0,176, 0, 0, 0 },
_beq[] = { 0, 0, 0, 0, 0,255, 0, 0, 0,240, 0, 0, 0 },
_bit[] = { 0, 0, 36, 52, 0, 44, 60, 0, 0, 0, 0, 0, 0 },
_bmi[] = { 0, 0, 0, 0, 0,255, 0, 0, 0, 48, 0, 0, 0 },
_bne[] = { 0, 0, 0, 0, 0,255, 0, 0, 0,208, 0, 0, 0 },
_bpl[] = { 0, 0, 0, 0, 0,255, 0, 0, 0, 16, 0, 0, 0 },
_bra[] = { 0, 0, 0, 0, 0,255, 0, 0, 0,128, 0, 0, 0 },
_brk[] = { 0, 0, 0, 0, 0, 0, 0, 0,255, 0, 0, 0, 0 },
_bvc[] = { 0, 0, 0, 0, 0,255, 0, 0, 0, 80, 0, 0, 0 },
_bvs[] = { 0, 0, 0, 0, 0,255, 0, 0, 0,112, 0, 0, 0 },
_clc[] = { 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0 },
_cld[] = { 0, 0, 0, 0, 0, 0, 0, 0,216, 0, 0, 0, 0 },
_cli[] = { 0, 0, 0, 0, 0, 0, 0, 0, 88, 0, 0, 0, 0 },
_clv[] = { 0, 0, 0, 0, 0, 0, 0, 0,184, 0, 0, 0, 0 },
_cmp[] = { 0,201,197,213, 0,205,221,217, 0, 0,193,209,210 },
_cpx[] = { 0,224,228, 0, 0,236, 0, 0, 0, 0, 0, 0, 0 },
_cpy[] = { 0,192,196, 0, 0,204, 0, 0, 0, 0, 0, 0, 0 },
_dea[] = { 0, 0, 0, 0, 0, 0, 0, 0, 58, 0, 0, 0, 0 },
_dec[] = { 0, 0,198,214, 0,206,222, 0, 0, 0, 0, 0, 0 },
_dex[] = { 0, 0, 0, 0, 0, 0, 0, 0,202, 0, 0, 0, 0 },
_dey[] = { 0, 0, 0, 0, 0, 0, 0, 0,136, 0, 0, 0, 0 },
_eor[] = { 0, 73, 69, 85, 0, 77, 93, 89, 0, 0, 65, 81, 82 },
_ina[] = { 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0 },
_inc[] = { 0, 0,230,246, 0,238,254, 0, 0, 0, 0, 0, 0 },
_inx[] = { 0, 0, 0, 0, 0, 0, 0, 0,232, 0, 0, 0, 0 },
_iny[] = { 0, 0, 0, 0, 0, 0, 0, 0,200, 0, 0, 0, 0 },
_jmp[] = { 0, 0, 0, 0, 0, 76, 0, 0, 0, 0,124, 0,108 },
_jsr[] = { 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0 },
_lda[] = { 0,169,165,181, 0,173,189,185, 0, 0,161,177,178 },
_ldx[] = { 0,162,166, 0,182,174, 0,190, 0, 0, 0, 0, 0 },
_ldy[] = { 0,160,164,180, 0,172,188, 0, 0, 0, 0, 0, 0 },
_lsr[] = { 74, 0, 70, 86, 0, 78, 94, 0, 0, 0, 0, 0, 0 },
_nop[] = { 0, 0, 0, 0, 0, 0, 0, 0,234, 0, 0, 0, 0 },
_ora[] = { 0, 9, 5, 21, 0, 13, 29, 25, 0, 0, 1, 17, 18 },
_pha[] = { 0, 0, 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0 },
_php[] = { 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0 },
_phx[] = { 0, 0, 0, 0, 0, 0, 0, 0,218, 0, 0, 0, 0 },
_phy[] = { 0, 0, 0, 0, 0, 0, 0, 0, 90, 0, 0, 0, 0 },
_pla[] = { 0, 0, 0, 0, 0, 0, 0, 0,104, 0, 0, 0, 0 },
_plp[] = { 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 0 },
_plx[] = { 0, 0, 0, 0, 0, 0, 0, 0,250, 0, 0, 0, 0 },
_ply[] = { 0, 0, 0, 0, 0, 0, 0, 0,122, 0, 0, 0, 0 },
_rol[] = { 42, 0, 38, 54, 0, 46, 62, 0, 0, 0, 0, 0, 0 },
_ror[] = { 106, 0,102,118, 0,110,126, 0, 0, 0, 0, 0, 0 },
_rti[] = { 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0 },
_rts[] = { 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0 },
_sbc[] = { 0,233,229,245, 0,237,253,249, 0, 0,225,241,242 },
_sec[] = { 0, 0, 0, 0, 0, 0, 0, 0, 56, 0, 0, 0, 0 },
_sed[] = { 0, 0, 0, 0, 0, 0, 0, 0,248, 0, 0, 0, 0 },
_sei[] = { 0, 0, 0, 0, 0, 0, 0, 0,120, 0, 0, 0, 0 },
_sta[] = { 0, 0,133,149, 0,141,157,153, 0, 0,129,145,146 },
_stx[] = { 0, 0,134, 0,150,142, 0, 0, 0, 0, 0, 0, 0 },
_sty[] = { 0, 0,132,148, 0,140, 0, 0, 0, 0, 0, 0, 0 },
_stz[] = { 0, 0,100,116, 0,156,158, 0, 0, 0, 0, 0, 0 },
_tax[] = { 0, 0, 0, 0, 0, 0, 0, 0,170, 0, 0, 0, 0 },
_tay[] = { 0, 0, 0, 0, 0, 0, 0, 0,168, 0, 0, 0, 0 },
_trb[] = { 0, 0, 20, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0 },
_tsb[] = { 0, 0, 4, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0 },
_tsx[] = { 0, 0, 0, 0, 0, 0, 0, 0,186, 0, 0, 0, 0 },
_txa[] = { 0, 0, 0, 0, 0, 0, 0, 0,138, 0, 0, 0, 0 },
_txs[] = { 0, 0, 0, 0, 0, 0, 0, 0,154, 0, 0, 0, 0 },
_tya[] = { 0, 0, 0, 0, 0, 0, 0, 0,152, 0, 0, 0, 0 };
static byte _[] = "Coming soon : FTOE NASTY TAPE 68000 Simulator (maybe)";
_ops ops[] =
{
{ "ADC" , _adc },
{ "AND" , _and },
{ "ASL" , _asl },
{ "BCC" , _bcc },
{ "BCS" , _bcs },
{ "BEQ" , _beq },
{ "BIT" , _bit },
{ "BMI" , _bmi },
{ "BNE" , _bne },
{ "BPL" , _bpl },
{ "BRA" , _bra }, /* 65C02 */
{ "BRK" , _brk },
{ "BVC" , _bvc },
{ "BVS" , _bvs },
{ "CLC" , _clc },
{ "CLD" , _cld },
{ "CLI" , _cli },
{ "CLV" , _clv },
{ "CMP" , _cmp },
{ "CPX" , _cpx },
{ "CPY" , _cpy },
{ "DEA" , _dea }, /* 65C02 */
{ "DEC" , _dec },
{ "DEX" , _dex },
{ "DEY" , _dey },
{ "EOR" , _eor },
{ "INA" , _ina }, /* 65C02 */
{ "INC" , _inc },
{ "INX" , _inx },
{ "INY" , _iny },
{ "JMP" , _jmp },
{ "JSR" , _jsr },
{ "LDA" , _lda },
{ "LDX" , _ldx },
{ "LDY" , _ldy },
{ "LSR" , _lsr },
{ "NOP" , _nop },
{ "ORA" , _ora },
{ "PHA" , _pha },
{ "PHP" , _php },
{ "PHX" , _phx }, /* 65C02 */
{ "PHY" , _phy }, /* 65C02 */
{ "PLA" , _pla },
{ "PLP" , _plp },
{ "PLX" , _plx }, /* 65C02 */
{ "PLY" , _ply }, /* 65C02 */
{ "ROL" , _rol },
{ "ROR" , _ror },
{ "RTI" , _rti },
{ "RTS" , _rts },
{ "SBC" , _sbc },
{ "SEC" , _sec },
{ "SED" , _sed },
{ "SEI" , _sei },
{ "STA" , _sta },
{ "STX" , _stx },
{ "STY" , _sty },
{ "STZ" , _stz }, /* 65C02 */
{ "TAX" , _tax },
{ "TAY" , _tay },
{ "TRB" , _trb }, /* 65C02 */
{ "TSB" , _tsb }, /* 65C02 */
{ "TSY" , _tsx },
{ "TXA" , _txa },
{ "TXS" , _txs },
{ "TYA" , _tya },
{ "" , _ } /* just for fun */
};