Git Product home page Git Product logo

Comments (4)

agn453 avatar agn453 commented on June 7, 2024

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.

tsupplis avatar tsupplis commented on June 7, 2024

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.

agn453 avatar agn453 commented on June 7, 2024

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.

agn453 avatar agn453 commented on June 7, 2024

I've reverted back to using -Dz80

from hi-tech-z80-c.

Related Issues (20)

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.