ugBASIC 1.18
An isomorphic BASIC language compiler for retrocomputers
Loading...
Searching...
No Matches
6502.h
Go to the documentation of this file.
1#ifndef __UGBC_CPU6502__
2#define __UGBC_CPU6502__
3
4/*****************************************************************************
5 * ugBASIC - an isomorphic BASIC language compiler for retrocomputers *
6 *****************************************************************************
7 * Copyright 2021-2026 Marco Spedaletti (asimov@mclink.it)
8 *
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 *----------------------------------------------------------------------------
21 * Concesso in licenza secondo i termini della Licenza Apache, versione 2.0
22 * (la "Licenza"); è proibito usare questo file se non in conformità alla
23 * Licenza. Una copia della Licenza è disponibile all'indirizzo:
24 *
25 * http://www.apache.org/licenses/LICENSE-2.0
26 *
27 * Se non richiesto dalla legislazione vigente o concordato per iscritto,
28 * il software distribuito nei termini della Licenza è distribuito
29 * "COSì COM'è", SENZA GARANZIE O CONDIZIONI DI ALCUN TIPO, esplicite o
30 * implicite. Consultare la Licenza per il testo specifico che regola le
31 * autorizzazioni e le limitazioni previste dalla medesima.
32 ****************************************************************************/
33
34#include "../ugbc.h"
35#include "cpu.h"
36
37#define VT_FLOAT_BITWIDTH( p ) \
38 ( \
39 VT_BW_32BIT( p, FT_FAST ) + \
40 VT_BW_32BIT( p, FT_SINGLE ) \
41 )
42
43#define VT_FLOAT_NORMALIZED_BITWIDTH( p ) \
44 ( \
45 VT_BW_32BIT( p, FT_FAST ) + \
46 VT_BW_32BIT( p, FT_SINGLE ) \
47 )
48
49#define VT_FLOAT_NORMALIZED_POW2_WIDTH( p ) \
50 ( \
51 VT_POW2_2( p, FT_FAST ) + \
52 VT_POW2_2( p, FT_SINGLE ) \
53 )
54
55#define CPU_LITTLE_ENDIAN 1
56#define REGISTER_BASE 0x1000
57#define REGISTER_PAGE_ZERO 0x100
58#define REGISTER_PAGE_ZERO2 0x200
59#define IS_REGISTER(x) ((x & REGISTER_BASE) == REGISTER_BASE)
60#define IS_PAGE_ZERO(x) ((x & REGISTER_PAGE_ZERO) == REGISTER_PAGE_ZERO)
61#define IS_PAGE_ZERO2(x) ((x & REGISTER_PAGE_ZERO2) == REGISTER_PAGE_ZERO2)
62
80
90
91void vars_emit_byte( Environment * _environment, char * _name, int _value );
92void vars_emit_word( Environment * _environment, char * _name, int _value );
93void vars_emit_dword( Environment * _environment, char * _name, int _value );
94void vars_emit_number( Environment * _environment, char * _name, int _value );
95
96#endif
@ REGISTER_Y
Definition 6309.h:68
@ REGISTER_A
Definition 6309.h:63
@ REGISTER_X
Definition 6309.h:67
@ REGISTER_S
Definition 6309.h:70
@ REGISTER_NONE
Definition 6309.h:62
@ REGISTER_PC
Definition 6309.h:71
#define REGISTER_BASE
Definition 6309.h:57
@ STACK_NONE
Definition 6309.h:78
@ STACK_BYTE
Definition 6309.h:79
@ STACK_WORD
Definition 6309.h:80
@ STACK_DWORD
Definition 6309.h:81
_CPU6502Register
Definition 6502.h:63
@ REGISTER_YX
Definition 6502.h:73
@ REGISTER_XY
Definition 6502.h:72
@ REGISTER_CARRY
Definition 6502.h:76
@ REGISTER_ZERO
Definition 6502.h:77
@ REGISTER_AXY
Definition 6502.h:74
_CPU6502Stack
Definition 6502.h:81
void vars_emit_word(Environment *_environment, char *_name, int _value)
Definition _vars.c:92
enum _CPU6502Register CPU6502Register
void vars_emit_dword(Environment *_environment, char *_name, int _value)
Definition _vars.c:100
void vars_emit_number(Environment *_environment, char *_name, int _value)
Definition _vars.c:108
enum _CPU6502Stack CPU6502Stack
void vars_emit_byte(Environment *_environment, char *_name, int _value)
Definition _vars.c:84
struct _Environment Environment
Structure of compilation environment.