mirror of
https://github.com/irmen/prog8.git
synced 2025-01-10 20:30:23 +00:00
add sys.sizeof_byte, _word, _float constants
because Antlr doesn't allow the grammar to contain a sizeof(typename) rule to override the sizeof(identifier) rule
This commit is contained in:
parent
d1ddf05e38
commit
ae669af904
@ -23,6 +23,10 @@ sys {
|
||||
|
||||
const ubyte target = 8 ; compilation target specifier. 64 = C64, 128 = C128, 16 = CommanderX16, 8 = atari800XL
|
||||
|
||||
const ubyte sizeof_byte = 1
|
||||
const ubyte sizeof_word = 2
|
||||
const ubyte sizeof_float = 0 ; undefined, no float support
|
||||
|
||||
asmsub init_system() {
|
||||
; Initializes the machine to a sane starting state.
|
||||
; Called automatically by the loader program logic.
|
||||
|
@ -351,6 +351,11 @@ sys {
|
||||
|
||||
const ubyte target = 128 ; compilation target specifier. 64 = C64, 128 = C128, 16 = CommanderX16.
|
||||
|
||||
const ubyte sizeof_byte = 1
|
||||
const ubyte sizeof_word = 2
|
||||
const ubyte sizeof_float = 5
|
||||
|
||||
|
||||
asmsub init_system() {
|
||||
; Initializes the machine to a sane starting state.
|
||||
; Called automatically by the loader program logic.
|
||||
|
@ -347,6 +347,10 @@ sys {
|
||||
|
||||
const ubyte target = 64 ; compilation target specifier. 64 = C64, 128 = C128, 16 = CommanderX16.
|
||||
|
||||
const ubyte sizeof_byte = 1
|
||||
const ubyte sizeof_word = 2
|
||||
const ubyte sizeof_float = 5 ; undefined, no float support
|
||||
|
||||
|
||||
asmsub init_system() {
|
||||
; Initializes the machine to a sane starting state.
|
||||
|
@ -1360,6 +1360,10 @@ sys {
|
||||
|
||||
const ubyte target = 16 ; compilation target specifier. 64 = C64, 128 = C128, 16 = CommanderX16.
|
||||
|
||||
const ubyte sizeof_byte = 1
|
||||
const ubyte sizeof_word = 2
|
||||
const ubyte sizeof_float = 5
|
||||
|
||||
asmsub init_system() {
|
||||
; Initializes the machine to a sane starting state.
|
||||
; Called automatically by the loader program logic.
|
||||
|
@ -98,6 +98,11 @@ sys {
|
||||
|
||||
const ubyte target = 32 ; compilation target specifier. 64 = C64, 128 = C128, 16 = CommanderX16, 32=PET
|
||||
|
||||
const ubyte sizeof_byte = 1
|
||||
const ubyte sizeof_word = 2
|
||||
const ubyte sizeof_float = 0 ; undefined, no floats supported
|
||||
|
||||
|
||||
asmsub init_system() {
|
||||
; Initializes the machine to a sane starting state.
|
||||
; Called automatically by the loader program logic.
|
||||
|
@ -7,6 +7,11 @@ sys {
|
||||
|
||||
const ubyte target = 255 ; compilation target specifier. 64 = C64, 128 = C128, 16 = CommanderX16, 8 = atari800XL, 255 = virtual
|
||||
|
||||
const ubyte sizeof_byte = 1
|
||||
const ubyte sizeof_word = 2
|
||||
const ubyte sizeof_float = 8
|
||||
|
||||
|
||||
sub reset_system() {
|
||||
; Soft-reset the system back to initial power-on Basic prompt.
|
||||
%ir {{
|
||||
|
@ -1,6 +1,8 @@
|
||||
TODO
|
||||
====
|
||||
|
||||
see github for issues
|
||||
|
||||
Regenerate skeleton doc files.
|
||||
|
||||
Improve register load order in subroutine call args assignments:
|
||||
|
@ -1,18 +1,13 @@
|
||||
; EXAMPLE external command source code
|
||||
|
||||
%launcher none
|
||||
%option no_sysinit
|
||||
%zeropage basicsafe
|
||||
%encoding iso
|
||||
%import textio
|
||||
%address $4000
|
||||
%zeropage basicsafe
|
||||
|
||||
|
||||
main $4030 {
|
||||
%option force_output
|
||||
|
||||
sub start() {
|
||||
txt.print("external command\n")
|
||||
sys.exit(0)
|
||||
main {
|
||||
sub start() {
|
||||
txt.print_ub(sys.sizeof_byte)
|
||||
txt.spc()
|
||||
txt.print_ub(sys.sizeof_word)
|
||||
txt.spc()
|
||||
txt.print_ub(sys.sizeof_float)
|
||||
txt.nl()
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user