Giter VIP home page Giter VIP logo

aqb's Introduction

AQB: A BASIC Compiler and IDE for Amiga Computers

Screenshot

About

Command Reference

AQB Programming Language

Amiga OS System Programming in AQB

IDE

Project Scope

An experiment in alternate history: what AmigaBASIC could have looked like, had it been developed further tailored to the Amiga OS.

What AQB is not: AQB does not try to be a clone of any particular BASIC dialect - neither QuickBASIC, FreeBASIC or VisualBASIC nor any particular Amiga specific BASIC implementation like AmigaBASIC, ACE, HiSoft, GFA, Blitz or AMOS. While it strives to be as compatible as possible with the Microsoft BASIC family of languages (and certainly has many QuickBASIC traits) the primary focus is on the creation of a modern, clean, Amiga OS-compliant, future-proof BASIC that is tailored towards modern Amiga application development.

To be more specific, FreeBASIC is the source of many core AQB language constructs (in many respects AQB can be considered a subset of FreeBASIC) with inspiration for Amiga specific commands mainly from AmigaBASIC, ACE and HiSoft. Main target is Amiga OS compliant application development.

Improvements over AmigaBASIC include:

  • Advanced type system (including UDTs and Pointers, see below)
  • Support for non-static functions and subs (enables recursion)
  • Module support (similar to UNITs in TurboPascal, with full type safety and dependencies)
  • Modern syntax inspired by FreeBASIC and VisualBASIC
  • True native 68k compiler
  • Integrated IDE besides compiler command line interface with
    • syntax highlighting
    • auto-indent
    • folding support
    • source level debugging

Requirements

  • 3 MB RAM
  • OS 3.1 (V39) or newer

Installation

Download a release LHA archive (https://github.com/gooofy/aqb/releases) and unpack it wherever you like, keep the directory structure intact.

AQB should run from this point on without the need for further installation, but for convenience add a "AQB:" assign to your S:user-startup file, e.g.

;BEGIN AQB
Assign AQB: "sys:Apps/AQB"
;END AQB

Type System

Basic types:

  • Byte, UByte (8 bits)
  • Integer, UInteger (16 bits)
  • Long, ULong (32 bits)
  • Single (32 Bit FFP floats)
  • Boolean (8 bits)

Advanced types

  • Static (C-like, fast) and dynamic (runtime bounds checking) arrays
  • UDTs (structs)
  • OOP (FreeBASIC like)
  • Pointers (C-like, including function/sub pointers)
  • Strings (0-terminated pointers to UByte, C-compatible)

Module System and Runtime

AQB tries to keep the set of commands that are built into the compiler to a minimum and relies on its quite powerful module system to provide most of the commands as part of the runtime system. This means that while the default runtime strives to implement a modern QuickBASIC like dialect tailored to the Amiga, it is quite possible to implement alternative runtime modules that could provide AQB with a different "personality", e.g. one that is closer to AmigaBASIC or GFA BASIC or even languages like BlitzBasic or AMOS.

The goal for AQB's default runtime is to provide a rich set of commands covering typical Amiga OS programming topics like GUI programming, multitasking, graphics and audio combined with resource tracking and error/exception handling. Future plans might also include an automated garbage collector to make memory allocation easier and safer.

AQB is fully link-compatible with the Amiga 68k GCC compiler which means that AQB modules can be implemented in C as well as BASIC (one could even mix these languages within one module, i.e. implement some subprograms in C while others in BASIC).

Intuition / Exec event handling

Since the default runtime wants to enable OS friendly programming no busy waiting is used. Therefore the SLEEP command is used to process pending events, i.e. you will need to call SLEEP regularly in your program, typically form a main loop that could look like this:

WHILE running
    SLEEP
WEND

For event processing you register subroutines using the ON ... CALL family of statements, e.g.

ON WINDOW CLOSE CALL 1, myWindowHandler

see https://github.com/gooofy/aqb/blob/master/examples/demo/gfx1.bas for a simple example of this approach.

Interesting detail: since AQB supports C-like function pointers, the ON ... CALL family of statements is not built into the compiler but part of the _aqb runtime:

PUBLIC DECLARE SUB ON WINDOW CLOSE CALL (BYVAL wid AS INTEGER, BYVAL p AS SUB (BYVAL INTEGER))

Code Generation and Target Systems

At the time of this writing classic 68k Amiga systems is the only compiler target. The idea is to focus on one target and try to make AQB work really well on this platform before expanding to other systems. The AQB compiler is implemented from scratch in C based on Appel's 1997 book "Modern Compiler Implementation in C" and tries to keep system requirements (RAM and CPU) low while still producing somewhat sensible machine code. Originally the AQB code was based on ComMouses's tiger compiler implementation (https://github.com/ComMouse/tiger-compiler) which provided a very useful starting point.

For future expansions to other platforms the current plan is to use an LLVM based backend for all platforms powerful enough to run LLVM which is probably true for most NG Amiga systems (AROS, AmigaOS 4 and MorphOS) and most likely also for highly expanded classic Amiga systems (using accelerator cards such as PiStom or Vampire).

As for the 68k compiler future plans include further reduction of its memory footprint ideally to a point where it is useful on 1MB or even 512K Amiga systems. At that point it might even make sense to implement a 6502 backend targeting modern 8 bit systems like the MEGA65, Commander X16 or C256 Foenix.

Interrupting / break handling in AQB programs

By default, the runtime will check for break signals in i/o routines. Break signals can be sent either by pressing CTRL-C or by using the AmigaDOS BREAK command.

Additionally, the compiler will insert checks for break signals in all loop statements (to protect against endless loops) and in subprogram startup code (to protect against infinite recursion). This is enabled by default but since this will make code longer and cost some performance, it can be switched off using the

OPTION BREAK OFF

statement.

Amiga OS System Programming in AQB

AQB datatypes are very similar to C (C-like strings, structs and pointers) which makes usage of Amiga OS libraries and devices pretty seamless.

Data structures generally can be modeled 1:1 from their C counterparts, a python script semi-automating the task of converting Amiga C library and device headers to AQB is in the works. Here is a preview of what the resulting AQB declarations typically look like:

[...]

TYPE ViewPort
    AS ViewPort PTR NextViewPort
    AS ColorMap PTR ColorMap
    AS CopList PTR DspIns, SprIns, ClrIns
    AS UCopList PTR UCopIns
    AS INTEGER DWidth, DHeight, DxOffset, DyOffset
    AS UINTEGER Modes
    AS UBYTE SpritePriorities, ExtendedModes
    AS RasInfo PTR RasInfo
END TYPE

TYPE Layer_Info
    AS Layer PTR top_layer, check_lp
    AS ClipRect PTR obs, FreeClipRects
    AS LONG PrivateReserve1, PrivateReserve2
    AS SignalSemaphore Lock
    AS MinList gs_Head
    AS INTEGER PrivateReserve3
    AS VOID PTR PrivateReserve4
    AS UINTEGER Flags
    AS BYTE fatten_count, LockLayersCount
    AS INTEGER PrivateReserve5
    AS VOID PTR BlankHook, LayerInfo_extra
END TYPE

EXTERN GfxBase AS VOID PTR

DECLARE SUB Move (rp AS RastPort PTR, x AS INTEGER, y AS INTEGER) LIB -240 GfxBase (a1, d0, d1)
DECLARE SUB RectFill (rp AS RastPort PTR, xmin AS INTEGER, ymin AS INTEGER, xmax AS INTEGER, ymax AS INTEGER) LIB -306 GfxBase (a1, d0, d1, d2, d3)
DECLARE SUB Draw (rp AS RastPort PTR, x AS INTEGER, y AS INTEGER) LIB -246 GfxBase (a1, d0, d1)
DECLARE SUB SetAPen (rp AS RastPort PTR, pen AS INTEGER) LIB -342 GfxBase (a1, d0)

[...]

Keyboard shortcuts:

* F1        - this help screen
* ESC       - toggle console visibility
* S-UP      - page up
* S-DOWN    - page down
* S-LEFT    - goto start of line
* S-RIGHT   - goto end of line
* Ctrl-Up   - goto top of file
* Ctrl-Down - goto end of file
* Ctrl-Y    - delete line
* F5        - compile & run
* F7        - compile
* F9        - toggle breakpoint
* TAB       - fold or unfold subprograms
* Amiga-F   - find
* Amiga-N   - find next
* Amiga-B   - mark block
* Amiga-X   - cut
* Amiga-C   - copy
* Amiga-V   - paste
* Amiga-O   - open file in editor
* Amiga-S   - save file
* Amiga-Q   - quit (also Ctrl-C)

Benchmark Results

Measured on an A500 configuration (PAL 68000, 3MB RAM) in FS-UAE, Kickstart 1.3

Benchmark AmigaBasic GFA Basic 3.52 BlitzBasic 2.15 HiSoft Basic 2 AQB
ctHLBench integer 33.94s 7.40s 6.96s 12.41s 1.66s
ctHLBench real 23.90s 6.88s 4.99s 4.46s 3.12s
fibonacci no recursion 54.60s guru 28.18 4.09s

Source Code

https://github.com/gooofy/aqb

Authors

aqb's People

Contributors

blackborn66 avatar gooofy avatar polluks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aqb's Issues

STR$(boolVar)

On my hunt for a bug I stumbled in this trap
It looks like only the last BOOLEAN in DIM expression is treated as a real BOOLEAN

OPTION EXPLICIT

DIM b0, b1, b2 AS Boolean
TRACE b0, b1, b2
PRINT b0, b1, b2
TRACE STR$(b0);STR$(b1);STR$(b2)
TRACE STR$(b0)+STR$(b1)+STR$(b2)
DIM s AS string = STR$(b0)+STR$(b1)+STR$(b2)
TRACE "s1: "; s
s = STR$(b2)
s = s + STR$(b1)
s = s + STR$(b0)
TRACE "s2: "; s

DIM b4 AS Boolean
DIM b5 AS Boolean
TRACE b4, b5

crash example

crashed in 0.8.2. 0.8.3, 0.9.0 IDE - maybe the same as reported before

OPTION EXPLICIT

DIM SHARED AS Integer t = 2
DIM SHARED AS Integer z = 3

t = z + (1 - z) * z ' okay
t = (1 - z) ' okay

SUB Crash(x AS Integer) REM
    t = x
    ' t = (1 - x) ' CRASH!
    t = (-x + 1)
    ' t = (1 + x) ' CRASH!
    t = (x + 1)
    ' t = x + (1 - x) * x ' CRASH!
END SUB

Double crash

Double as type isn't supported now.
Using it chrashes the IDE
I stumbled in it while converting a qbasic program

IDE crash

I searched for near an hour for a simple stupid fail I made.
If you declare a constant and assign a value later, this happens ;)
I think the compiler should help the devs to find these things.
BTW: I like AQB quite a lot!

example:

CONST AS INTEGER n = 5
PRINT i
i = 4

in 0.8.2:

assertion "FALSE" failed: file "codegen.c", line 3509, function: CG_transAssignment
Program aborted

Build fails with linker errors

When I build aqb it fails linking the Linux binary aqb. The math library is added to the beginning of the command line, so the linker does not resolve symbols for pow and other math functions. When I add -lm to the end of the command line it works.

Possibly this is related to the linker used with gcc on Ubuntu 20.04 LTS? I have seen the very same issue in a completely different context before (using the Qbs build system to compile some C programs).

gcc -Wall -Werror -g -lm -o ../..//target/x86_64-linux/bin/aqb ../..//target/x86_64-linux/obj/aqb.o ../..//target/x86_64-linux/obj/scanner.o ../..//target/x86_64-linux/obj/hashmap.o ../..//target/x86_64-linux/obj/util.o ../..//target/x86_64-linux/obj/frontend.o ../..//target/x86_64-linux/obj/ide.o ../..//target/x86_64-linux/obj/options.o ../..//target/x86_64-linux/obj/errormsg.o ../..//target/x86_64-linux/obj/symbol.o ../..//target/x86_64-linux/obj/link.o ../..//target/x86_64-linux/obj/linscan.o ../..//target/x86_64-linux/obj/ui_linux.o ../..//target/x86_64-linux/obj/ui_amiga.o ../..//target/x86_64-linux/obj/run.o ../..//target/x86_64-linux/obj/temp.o ../..//target/x86_64-linux/obj/assem.o ../..//target/x86_64-linux/obj/env.o ../..//target/x86_64-linux/obj/types.o ../..//target/x86_64-linux/obj/compiler.o ../..//target/x86_64-linux/obj/logger.o ../..//target/x86_64-linux/obj/codegen.o ../..//target/x86_64-linux/obj/regalloc.o ../..//target/x86_64-linux/obj/liveness.o ../..//target/x86_64-linux/obj/color.o ../..//target/x86_64-linux/obj/flowgraph.o ../..//target/x86_64-linux/obj/table.o ../..//target/x86_64-linux/obj/tui.o
/usr/bin/ld: ../..//target/x86_64-linux/obj/scanner.o: in function `number':
/home/jochen/projects/amiga/aqb/src/compiler/scanner.c:250: undefined reference to `pow'
/usr/bin/ld: ../..//target/x86_64-linux/obj/util.o: in function `U_float2str':
/home/jochen/projects/amiga/aqb/src/compiler/util.c:471: undefined reference to `pow'
/usr/bin/ld: /home/jochen/projects/amiga/aqb/src/compiler/util.c:487: undefined reference to `floor'
/usr/bin/ld: /home/jochen/projects/amiga/aqb/src/compiler/util.c:502: undefined reference to `pow'
/usr/bin/ld: /home/jochen/projects/amiga/aqb/src/compiler/util.c:508: undefined reference to `floor'
/usr/bin/ld: /home/jochen/projects/amiga/aqb/src/compiler/util.c:536: undefined reference to `floor'
/usr/bin/ld: ../..//target/x86_64-linux/obj/assem.o: in function `getConstInt':
/home/jochen/projects/amiga/aqb/src/compiler/assem.c:968: undefined reference to `round'
/usr/bin/ld: ../..//target/x86_64-linux/obj/codegen.o: in function `CG_getConstInt':
/home/jochen/projects/amiga/aqb/src/compiler/codegen.c:494: undefined reference to `round'
/usr/bin/ld: ../..//target/x86_64-linux/obj/codegen.o: in function `CG_transBinOp':
/home/jochen/projects/amiga/aqb/src/compiler/codegen.c:1500: undefined reference to `round'
/usr/bin/ld: /home/jochen/projects/amiga/aqb/src/compiler/codegen.c:1500: undefined reference to `round'
/usr/bin/ld: /home/jochen/projects/amiga/aqb/src/compiler/codegen.c:1715: undefined reference to `pow'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:31: ../..//target/x86_64-linux/bin/aqb] Fehler 1
make[2]: Verzeichnis „/home/jochen/projects/amiga/aqb/src/compiler“ wird verlassen

Sprites not working in screen modes >15Khz

I tested the "Sprite tutorials" which opens a window in Workbench screen. My Workbench runs in DBNTSC screen mode.

SpriteDemo1 : Sprite not displayed
SpriteDemo2 : Runtime error 200 at "ILBM LOAD SPRITE"
SpriteDemo3 : Sprite not displayed

This occurs in screen modes with a horizontal frequency greater than15Khz.

AQB 0.8. Launch issue

Hello!

My setup:

  • Amiga 500+2MB chip ram via ACE2B+ACA500Plus(68000 CPU @ 42MHz, 8 MB fast ram, CF card as HDD)
  • AmigaOS 3.2
  • Fresh version of AQB extracted to AQB:

What happens:

  • When I try open existing source code - all fine(I even can create new file and try make something inside it)
  • When I try just run AQB via ICON/CLI/etc - it crashes with Guru 8000 0003 error

OPTION BREAK OFF: keeps catching CTRL-C

I added this option at top of code, but it keeps breaking the execution when CTRL-C is pressed. It seems that this istruction is ignored.

Thank you very much for your effort and dedication on this, AQB is a fantastic and promising project.

Specific list of supported systems?

My concern

The readme states that "classic 68k Amiga systems" are targeted by the compiler; however, this may still leave room for confusion. For example, while I can guess that the Amiga 500 is very likely supported, I am much less sure about, for example, the CD32, and less sure about the A4000.

Suggestion to fix

A markdown table listing each system, whether it is supported, and the degree of support, such as a percentile; red/yellow/green; bronze/silver/gold/full; and/or a notes and caveats column.

How I think this will help

  • It will assist users with an overview of the current support state of a system, and how well AQB can be expected to run on that system.
  • It will assist contributors by providing an idea of where to focus their efforts.
    • A contributor who has improved an area of support, can then raise an issue or PR to have the support state of that system changed; which can notify both users and contributors of an improvement in the level of support.

$VER tag

A version tag should be added.

Build fails using pushd/popd

Some makefiles use pushd and popd. But on Ubuntu 20.04 /bin/sh is used by the make tool which seems to be not bash but some other shell which does not know pushd/popd.

/home/jochen/projects/amiga/amiga-build-env/bin/m68k-amigaos-ar -crs _brt.a cstartup.o astr.o amath.o autil.o dyna.o data.o dprintf.o
pushd .. && rm -f startup.o _brt.a && ln -s _brt/startup.o && ln -s _brt/_brt.a && popd
/bin/sh: 1: pushd: not found
make[3]: *** [Makefile:22: _brt.a] Fehler 127
make[3]: Verzeichnis „/home/jochen/projects/amiga/aqb/src/lib/_brt“ wird verlassen

CLS on true color screen

I tried a AQB program in true color (WinUAE with uaegfx):

The CLS in a window did nothing.

If I do open a old school SCREEN first it works.
With hicolor screenmode or 8bit (uaegfx) it works too.
Only true color seems not to work
And it was all on WB 3.9

STRING compares in BOOLEAN assignments are broken

REM PRINT "1" = "2" REM runtime error!
REM PRINT ("1" = "2") REM dito
DIM B AS BOOLEAN
B = ("23" = "24") REM wrong result!
TRACE B
B = ("42" = "42")
TRACE B
B = (42 = 42)
TRACE B
B = (23 = 42)
TRACE B
B = ("23" <> "24")
TRACE B
B = ("42" <> "42") REM wrong result!
TRACE B
B = (42 <> 42)
TRACE B
B = (23 <> 42)
TRACE B

' bonus lines!
' here it works correct!
IF ("42" <> "42") THEN
    TRACE "'42' <> '42' gives wrong result!"
ELSE
    TRACE "'42' <> '42' gives right result!"
END IF
IF ("23" = "42") THEN
    TRACE "'23' = '42' gives wrong result!"
ELSE
    TRACE "'23' = '42' gives right result!"
END IF

File examples/dev/foo.bas is missing

The Makefile in examples/dev is expecting a file foo.bas which is not found. Should this file be generated somehow or is it just missing in the repository?

Another strange crash

The following lines let the IDE crash
I tested in 0.8.2 and 0.9.0

OPTION EXPLICIT

DIM SHARED colr AS Integer

SUB test (split AS Integer)
    colr = split + 4 REM this works
    colr = 16 - split REM this leads to crash
END SUB

EQV, IMP, XOR

these operators are all implemented (no compile or link error)
but all results are FALSE (no pun intended ;)
version 0.8.2 and 0.8.3 show the same

the behaviour seems to be different for constant expressions and expressions depending on variables

GadTools support broken

You make big progress with the OOP things! Good work!
I think the GadTools support is broken in the oop branch.

console in IDE

some little problems ...

If the IDE window is wider then 80 characters (I often use SuperHires mode 1280x512), the messages wraps unneeded.

If the compiler message wraps, then one character is missed.
In 640x512 are missed more characters - "missing uments" as an example

The produced tab characters in "TRACE a, b, c" should be used like in PRINT - maybe replaced by one SPACE as a simple solution first

The console has only one size. If I write in an extern editor, often I have to fix a lot of small mistakes afterwards - typos, missed THEN after IF, and some more infamous things ;)
It would be easier with a little bigger window size, or without unneeded wraps. Sometimes the first (and most important) message scrolls to far up and I have to fiddle with the mouse to get it. Maybe the ESC key could switch between NO window, 1/4 screen height, 1/2, 3/4
It would be helpful also while using the debugger with lot of variables

BTW: we could "filter the noise": if the actual file is compiled - the path and file name is only noise - nice to have!
BTW: the console should be usable by keyboard - maybe after implementing mouse clicks in the editor - nice to have!

Compiler crash with "string" + int_var

I discovered a way to crash the compiler with the following message:

assertion "0" failed: file "frontend.c", line 726, function: coercion
Program aborted

Attempting to concatenate an integer type to a string will do this every time. For example:
DIM n AS INTEGER
PRINT "HELLO " + n

If I use the type correct "HELLO " + STR$(n), the program seems to work as expected.

The expected result would be either a compiler error (since you can't concatenate strings and numeric types) or an automatic widening conversion (ie: an implicit STR$(n)).

new crash in the oop branch

all programs compile, but some crash on start.
All GadToolsTutorials have this problem:

assertion " last_hunk_slot < MAX_NUM_HUNKS"
function: load_hunk_header

strange behaviour

or am I wrong?
With TRUE and FALSE in bPSET the lines are looking different
this lines with negativ y are drawn correct only when I PSET a point to the start before.

' try TRUE and FALSE 
DIM AS BOOLEAN bPSET = FALSE

IF bPSET THEN
    PSET (10, -10), 1
END IF
LINE (10, -10) - (50, 100), 1
IF bPSET THEN
    PSET (60, -10), 1
END IF
LINE (60, -10) - (80, 150), 2

WHILE inkey$ = ""
    sleep
WEND

Build problem: AQB: env var not set

Sorry for reporting that many build problems. I really love the idea of this project and would like to contribute so I try to get this building on my machine.

Here is another build problem, I do not know (yet) where this is coming from:

cp startup.o /home/jochen/snap/fsuae/common/FS-UAE/hdd/Exchange/aqb/lib
../../..//target/x86_64-linux/bin/aqb -d none -s _brt.sym _brt.bas
AQB: env var not set.

make[3]: *** [Makefile:11: _brt.sym] Fehler 1
make[3]: Verzeichnis „/home/jochen/projects/amiga/aqb/src/lib/_brt“ wird verlassen

negative values in HEX$, OCT$, BIN$

for positive values the functions HEX$, OCT$, BIN$ are working fine,
but for negative values of BYTE and INTEGER the results are looking strange:

-1 => "FFFFFFFF"

because the parameter is converted to LONG in between.

no big problem, you can use a workaround: first convert to UBYTE or UINTEGER

but anytime it should be fixed

[GUI] ASL path

If I open source code two times the path is lost in between.
"The contents of an ASL requester data structure are preserved across calls to AslRequest(). So, until the requester is freed, tag settings and user selections will remain in the data structure unless they are altered by tags in subsequent calls to AslRequest(). This is very useful because it allows the requester to remember and redisplay the user's previous selections. However, this also means that the programmer must assure that any addresses passed in ASL tags remain valid, or are refreshed on each call to AslRequest()."

F1:help

F1 isn't working in 0.8.2
I think, the file README.guide isn't in place

READ / DATA reading wrong text

I am writing a program that uses READ/DATA statements to populate several arrays with code table information, and I keep getting weird results.

I finally wrote a simple test program and came up with a fairly consistent behavior: instead of correctly reading DATA statements, there first element in each DATA statement is replaced by the last statement of the program (usually WEND, in this case.)

Here is an example:

FOR I=1 TO 2
    READ A$
    PRINT A$
NEXT

DATA "HELLO", "WORLD"

WHILE INKEY$=""
  SLEEP
WEND

Output is:
WEND
WORLD

After playing with it more, it seems like the first item on a DATA line will be replaced with the last program statement. So programs with multiple lines of DATA statements will return WEND for the first data item per line, followed by the correct items on that line.

DATA a,b,c,d
DATA e,f,g,h

Would return something like
WEND
b
c
d
WEND
f
g
h

I'm currently using AQB on WinUAE with OS 3.1.4, a 68030 CPU selected, 8MB RAM, 1.5MB Slow RAM, 256MB Z3 Fast 256MB Chip RAM. I am also using the UAE Zorro III RTG module.

I'll try different CPU and memory combinations to see if there's any difference.

accessing memory

I am trying to understand how to change the memory contents of a bitmap_t variable without using the graphic commands.

is the bitmap_t variable something i can use with memset/peek/poke ?

Invite

Not really an issue... I just want to extend an invite for you to join us over on the https://gotBASIC.com discord server; I realized that I setup an AQB room (ages ago) and thought to myself this morning after watching @RetroNick2020 most recent video, "self, why don't you invite the author?". I also had to poke him as to why there was no mention of AQB in the video. 🤔 So if you are so inclined, would love to see you over on this discord server sharing tidbits, updates, thoughts, etc. regarding AQB.

https://discord.gg/V9U5dMRs

Hope to see you there!

mark block in the IDE

I tried, but can't find out, how marking a block works in 0.8.2.
Ctrl-M inserts a line break
Ctrl-B works like Ctrl-DOWN - cursor jumps to the last line

One more crash

Another situation leads to a crash of the IDE in 0.8.2 and 0.9.0

OPTION EXPLICIT

TYPE GameGrid
    player AS Integer
    nTake AS Integer
    cx AS Integer
    cy AS Integer
END TYPE

DIM SHARED GG(8, 8) AS GameGrid
DIM SHARED HUMAN AS Integer

SUB InitGame
    HUMAN = 4
    GG(5, 5).player = HUMAN
END SUB

"if booleanVar then" leads to crash

the compiler in the IDE crashs
just uncomment!

OPTION EXPLICIT

TYPE TypeTest
    inn AS Integer
    boo AS Boolean
END TYPE

DIM SHARED tt AS TypeTest

tt.boo = True

' IF tt.boo THEN
'     TRACE "Crash!"
' END IF

IF tt.boo = True THEN
    TRACE "Okay!"
END IF    

ILBM LOAD BITMAP broken?

since 0.8.3 the tutorial ILBMShow.bas has a problem - some wrong colors in the image

I dived a little into it:

ILBM LOAD BITMAP picFileName,,, @meta, @cmap
meta.viewModes = 135296: REM this is my workaround - value &H21080 from 0.8.2 - &H80 works too
TRACE SIZEOF(ILBM_META_T): REM in 0.8.2 it is 24 - now 30
TRACE meta.nPlanes: REM 6
TRACE meta.viewModes
FOR i AS integer = 0 TO cmap.numEntries
TRACE i, cmap.colors(i).r, cmap.colors(i).g, cmap.colors(i).B
NEXT i

two strange things:

  1. In 0.8.2 viewModes shows the value 135296,
    since 0.8.3 it is zero after LOAD - I think, at least the halfbrite bit is missed
    If you set viewModes to 135296 or &H80 the image shows correct.

  2. The TRACE of colors shows values in wrong place
    Every second entry is skipped
    I think in 0.8.2 it was shown right

SPC() is not the same as SPACE$()

in the current version SPC() and SPACE$() are equal

SPC() should only be used in PRINT statements and there it should only move the text cursor

the power of equality

looks equal, but not the same results!
often it's -8
but sometimes +8

DIM AS SINGLE s1, s2
s1 = -2
s2 = 3
TRACE "-2 ^ 3", -2 ^ 3, -s1 ^ 3, -2 ^ s2, s1 ^ s2
TRACE "-2 * -2 * -2", s1 * s1 * s1

Conversion SINGLE to STRING and backwards

If the values are very tiny and the "E" is used in STRING, the conversion back leads to a loss of the exponent.

DIM AS single v = -24
PRINT v
v = exp(v)
PRINT v
DIM AS string s = STR$(v)
PRINT s
v = val(s)
PRINT v
v = log(v)
PRINT "log: ", v
s = STR$(v)
PRINT s
v = val(s)
PRINT v

how to use FREE()

in the help file RefCore.md is the function FREE() mentioned.
When I try to use it, I get "undeclared identifier FREE"
I did not found anything about FREE() anywhere else than in the help file

Indentation with remarks

If you use ' for remarks folding is still working, but indentation is broken in some cases
I think, it should look like this:

SUB test ' test remark
    PRINT "test"    
END SUB    

Sofware failure after closing the "Help" window

This happens only if AutoUpdateWB is preloaded (tipically in WBStartup).

My config

A1200 + Blizzard 1230 MKIV + 64MB.
Amiga OS 3.2.1 (the same failure confirmed with 3.2).
Some OS tweaks were applied (MuMove4k (exec in fast), fblit & ftext, ReqAttack), but disabling this tweaks does not solve the problem (It also crashes starting the OS in failsafe mode).
Same problem in AQB 0.8.0 as in 0.8.1.

How to reproduce it

  • Ensure that AutoUpdateWB is running (http://aminet.net/package/util/wb/AutoUpdateWB).
  • Open the AQB editor and press F1 to open the Help guide.
  • Close Help by pressing the "Esc" key or the "close" window gadget.
  • Software failure requester appears (error #800000008).

SnoopDos log

Just when Help window closes

169 [1] AmigaGuide® (amigaguide ChangeDir Work:Desarrollo/aqb
170 aqb OpenLib intuition.library Ver 0 OK
171 ReqAttack Open Sistema:Prefs/ReqAttac Read Fail
172 aqb OpenFont xen.font Size 8 OK
173 aqb FindRes MorphOS Fail
174 aqb FindRes MorphOS Fail

BYTE or UBYTE?

PRINT and TRACE show different "text"

DIM BB AS BYTE = -10
DIM UB AS UBYTE = -10

TRACE BB; STR$(BB) REM -10 -10
PRINT BB; STR$(BB) REM 246-10
TRACE UB; STR$(UB) REM 246 246
PRINT UB; STR$(UB) REM 246 246

WHILE inkey$ = ""
    sleep
WEND

Hunk support

Does AQB support external hunk (object) files that can be linked. if so does AQB also support auto allocating memory (chip/fast) for the hunk data if the correct flags are set?

FOR ... NEXT

FOR id [ AS type ] "=" expr TO expr [ STEP stepExpr ]
    <code>
NEXT [ id1 [ "," id2 [ "," ...] ] ]

I think stepExpr shouldn't be a constant.
It can be useful to calculate it or change it in nested loops.

I can work around it, but I think other BASICs can handle it

Specific CPU support?

My concern

Certain 68k CPUs do not have features other 68k CPUs have; for example, the 68030 does not have floating-point. While this was typically provided through a 68881 or 68882 add-in floating-point chip, this is not guaranteed.

Thoughts on fixing

Some indicator of how this may be handled, such as:

  • Only supporting CPUs such as the 68030 if they come with a floating-point unit.
  • Noting that software floating-point support may be required on some CPUs.
  • A setting or option that returns a compiler error on floating-point, thus allowing a program to be compiled without it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.