Comments (4)
The definition testing is case-insensitive
10E>type t.c
#include <stdio.h>
main()
{
#if z80
printf("z80 defined\n");
#endif
#if Z80
printf("Z80 defined\n");
#endif
}
10E>c -o t.c
A:C COM (User 0)
Hi-Tech C Compiler (CP/M-80) V3.09-8
Copyright (C) 1984-87 HI-TECH SOFTWARE
Updated from https://github.com/agn453/HI-TECH-Z80-C
10E>t
E:T COM
z80 defined
Z80 defined
10E>
The Z280 define is only tested in the front-end source. The current OPTIMH.COM is a Z280 binary. I suppose it could be compiled as a Z80 executable.
from hi-tech-z80-c.
Intriguing, I don't think it is actually the case.
J>type t.c
#include <stdio.h>
int main() {
#if z80
printf("hello z80\n");
#endif
#if Z80
printf("hello Z80\n");
#endif
return 0;
}
J>c -v t.c
Hi-Tech C Compiler (CP/M-80) V3.09-P011
Copyright (C) 1984-87 HI-TECH SOFTWARE
Updated from https://github.com/agn453/HI-TECH-Z80-C
0:CPP -DCPM -DHI_TECH_C -Dz80 -I T.C $CTMP1.$$$
0:P1 $CTMP1.$$$ $CTMP2.$$$ $CTMP3.$$$
0:CGEN $CTMP2.$$$ $CTMP1.$$$
0:ZAS -N -OT.OBJ $CTMP1.$$$
ERA $CTMP1.$$$
ERA $CTMP2.$$$
ERA $CTMP3.$$$
ERA $CTMP5.$$$
0:LINK -Z -Ptext=0,data,bss -C100H -OT.COM CRTCPM.OBJ T.OBJ LIBC.LIB
ERA T.OBJ
ERA $$EXEC.$$$
J>t
hello z80
J>c -v -DZ80 t.c
Hi-Tech C Compiler (CP/M-80) V3.09-P011
Copyright (C) 1984-87 HI-TECH SOFTWARE
Updated from https://github.com/agn453/HI-TECH-Z80-C
0:CPP -DCPM -DHI_TECH_C -Dz80 -DZ80 -I T.C $CTMP1.$$$
0:P1 $CTMP1.$$$ $CTMP2.$$$ $CTMP3.$$$
0:CGEN $CTMP2.$$$ $CTMP1.$$$
0:ZAS -N -OT.OBJ $CTMP1.$$$
ERA $CTMP1.$$$
ERA $CTMP2.$$$
ERA $CTMP3.$$$
ERA $CTMP5.$$$
0:LINK -Z -Ptext=0,data,bss -C100H -OT.COM CRTCPM.OBJ T.OBJ LIBC.LIB
ERA T.OBJ
ERA $$EXEC.$$$
J>t
hello z80
hello Z80
J>
A couple of other points. if you where to execute:
CPP -DCPM -DHI_TECH_C -I T.C CTMP1.SSS
P1 CTMP1.SSS CTMP2.SSS CTMP3.SSS
CGEN CTMP2.SSS CTMP1.SSS
ZAS -N -OT.OBJ CTMP1.SSS
ERA CTMP1.SSS
ERA CTMP2.SSS
ERA CTMP3.SSS
ERA CTMP5.SSS
LINK -Z -C100H -OT.COM CRTCPM.OBJ T.OBJ LIBC.LIB
T
you would get only z80 which is in any case predefined
J>t.sub
J>CPP -DCPM -DHI_TECH_C -I T.C CTMP1.SSS
J>P1 CTMP1.SSS CTMP2.SSS CTMP3.SSS
J>CGEN CTMP2.SSS CTMP1.SSS
J>ZAS -N -OT.OBJ CTMP1.SSS
J>ERA CTMP1.SSS
J>ERA CTMP2.SSS
J>ERA CTMP3.SSS
J>ERA CTMP5.SSS
No File
J>LINK -Z -C100H -OT.COM CRTCPM.OBJ T.OBJ LIBC.LIB
J>T
z80
Furthermore, the Exec processor is case sensitive, this is why it keep lower cases.
So when you add -DZ80, in C.C, you get both Z80 and z80 defined, one explicit and one implicit.
from hi-tech-z80-c.
I'll go back to using the lowercase form in the front-end (for both z80 and z280). Obviously there are inconsistencies lurking in the code that we shouldn't upset!
from hi-tech-z80-c.
I've reverted back to using -Dz80
from hi-tech-z80-c.
Related Issues (20)
- new C.C frontend not running on ZXCC HOT 9
- Extraction aborting - overlay.h isn't working HOT 4
- bios() calls to invoke XMOVE and MOVE fail under DRI banked BDOS HOT 2
- Wrong prototypes for ctime, gmtime and localtime HOT 1
- Work related to Hi-tech C HOT 1
- Hi-Tech C MSDOS v7.80 HOT 5
- LIBC library object modules need re-ordering HOT 1
- Undefined symbols with build 13 ( _open, _fseek, _creat, __filbuf) HOT 5
- Can't execute $EXEC HOT 4
- Cannot sseem to include libraries on different drive HOT 1
- It doesn't run on the Agon Light yet and it's not 24 bit to suit the eZ80 CPUs HOT 1
- Cannot find user library on D0: HOT 11
- Resulting com files bigger than original compiler HOT 7
- Linking question HOT 2
- I'm getting a "can't create testprg.obj" HOT 3
- Passing struct as argument to function pointer inside struct HOT 1
- Can you detect if include defined? HOT 3
- Running out of memory HOT 2
- Better way to pass args from C to ASM HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hi-tech-z80-c.