How do you determine whether the ZBasic compiler should generate ZVM or C code? I couldn't find this in the documentation.
It seems like the target code could also be specified in the BAS source using a new Option called TargetCode or outside using a command line option to the compiler such as
The native mode code generator (compiler) could be a different backend or a totally different compiler executable.
If you wanted to have your source code generate both ZVM and native code, how do you specify that to the IDE? Are there 2 additional menu commands or some other method?
mikep wrote:How do you determine whether the ZBasic compiler should generate ZVM or C code?
It is automatic based on the target device. If you specify ZX24a as the target device, you'll get VM code and the download file will have a .zxb extension by default. If you specify the ZX24n as the target device, you'll get native code and the download file will have a .zxc extension by default.
The updated downloaders (both in the IDE and zload) handle either type of file correctly irrespective of the extension. The download files contain information about the target device and the downloaders query the attached device for its identity before downloading to confirm that it matches the target for which the code was compiled.