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