Only in z80-asm-2.4.1-cp: .git diff -ur z80-asm-2.4.1/INSTALL z80-asm-2.4.1-cp/INSTALL --- z80-asm-2.4.1/INSTALL 2018-04-23 11:32:27.000000000 +0100 +++ z80-asm-2.4.1-cp/INSTALL 2021-01-25 21:59:12.000000000 +0000 @@ -25,3 +25,12 @@ If you wanna use this program under DO$ you may convert all sources including makefile to CR/LF end of line. If you don't know how, it's your problem. Don't use DO$! + +ON THE MAC +---------- + + * Install gcc (e.g. brew install gcc) + * Adjust the Makefile to use it - set CC + * You need to adjust hardware/Makefile too + * Xcode clang will not build this + Only in z80-asm-2.4.1-cp: LICENSE diff -ur z80-asm-2.4.1/Makefile z80-asm-2.4.1-cp/Makefile --- z80-asm-2.4.1/Makefile 2006-10-04 16:26:50.000000000 +0100 +++ z80-asm-2.4.1-cp/Makefile 2021-01-25 21:55:30.000000000 +0000 @@ -12,7 +12,7 @@ # set the appropriate install directories in your system -MAN_DIR=/usr/local/man +MAN_DIR=/usr/local/share/man BIN_DIR=/usr/local/bin #--------- You shouldn't need to change anything under this line --------------- @@ -30,16 +30,19 @@ MONI=z80-mon.exe endif -CC= gcc +CC= /usr/local/Cellar/gcc/10.2.0_3/bin/gcc-10 +AR= /usr/local/Cellar/gcc/10.2.0_3/bin/gcc-ar-10 + CFLAGS=-O2 -Wall -D$(ZZ) -D$(SYSTEM) $(DEFINES) -W -Wstrict-prototypes \ -Wno-parentheses -fomit-frame-pointer -falign-functions=0 LDFLAGS= -all: - cd hardware; $(MAKE) SYSTEM=$(SYSTEM) DEFINES="-D$(ZZZ) -D$(SYSTEM) $(DEFINES)" hard.a +all: + cd hardware; $(MAKE) SYSTEM=$(SYSTEM) DEFINES="-D$(ZZZ) -D$(SYSTEM) $(DEFINES)" CC=$(CC) hard.a make $(ASM) make $(MONI) - cd hardware; $(MAKE) SYSTEM=$(SYSTEM) DEFINES="-D$(ZZZ) -D$(SYSTEM) $(DEFINES)" + cd hardware; $(MAKE) SYSTEM=$(SYSTEM) DEFINES="-D$(ZZZ) -D$(SYSTEM) $(DEFINES)" CC=$(CC) + clean: $(RM) *.o @@ -50,7 +53,7 @@ $(RM) .bus_proto cd hardware; make SYSTEM=$(SYSTEM) clean -install: +install: all chmod a+rx $(ASM) $(MONI); cp -p $(ASM) $(MONI) $(BIN_DIR) chmod a+r doc/man/z80-*.1; cp -p doc/man/z80-*.1 $(MAN_DIR)/man1 chmod a+r doc/man/z80-*.3; cp -p doc/man/z80-*.3 $(MAN_DIR)/man3 @@ -109,15 +112,15 @@ asm.a: z80-cpu.o asm.o hash.o compile.o regs.o instr.o interrupt.o file.o \ expression.o mini-display.o keyboard.o $(RM) asm.a - ar rcs asm.a z80-cpu.o asm.o hash.o compile.o regs.o instr.o interrupt.o \ + $(AR) rcs asm.a z80-cpu.o asm.o hash.o compile.o regs.o instr.o interrupt.o \ expression.o mini-display.o keyboard.o file.o cpu.a: execute.o decode-table.o decode.o memory.o ports.o $(RM) cpu.a - ar rcs cpu.a execute.o decode-table.o decode.o memory.o ports.o + $(AR) rcs cpu.a execute.o decode-table.o decode.o memory.o ports.o $(ASM): z80-asm.o dummy.o asm.a $(HW) - gcc -lc -o $(ASM) z80-asm.o dummy.o asm.a $(HW) + $(CC) -lc -o $(ASM) z80-asm.o dummy.o asm.a $(HW) $(MONI): z80-mon.o cpu.a console.o asm.a $(HW) - gcc -lc -o $(MONI) z80-mon.o cpu.a console.o asm.a $(HW) + $(CC) -lc -o $(MONI) z80-mon.o cpu.a console.o asm.a $(HW) diff -ur z80-asm-2.4.1/README z80-asm-2.4.1-cp/README --- z80-asm-2.4.1/README 2000-04-26 13:36:38.000000000 +0100 +++ z80-asm-2.4.1-cp/README 2021-01-25 22:07:18.000000000 +0000 @@ -1 +1,11 @@ -See the doc directory + +This is the Z80 Assembler from + http://wwwhomes.uni-bielefeld.de/achim/z80-asm.html + +I've forked it here to get it to build on Mac OS X Big Sur +with GCC. I cannot get it to compile with Xcode clang at the +moment. + +Changes: +* One of the cpu pins had to be renamed to avoid a conflict +* An error function needed to be added to lcd_display diff -ur z80-asm-2.4.1/hardware/Makefile z80-asm-2.4.1-cp/hardware/Makefile --- z80-asm-2.4.1/hardware/Makefile 2006-10-02 11:36:00.000000000 +0100 +++ z80-asm-2.4.1-cp/hardware/Makefile 2021-01-25 21:55:15.000000000 +0000 @@ -16,7 +16,7 @@ MON=monitor_cpu.exe endif -CC= gcc +CC= /usr/local/Cellar/gcc/10.2.0_3/bin/gcc-10 CFLAGS=-O2 -Wall -D$(SYSTEM) $(DEFINES) -W -Wstrict-prototypes \ -Wno-parentheses -fomit-frame-pointer -falign-functions=0 LDFLAGS= @@ -59,12 +59,12 @@ ssl_zds.o: ssl_zds.c ../z80-cpu.h ../z80-global zds_token $(LCD): lcd_display.o ../dummy.o ../cpu.a ../console.o ../asm.a hard.a - gcc -lc -o $(LCD) lcd_display.o ../dummy.o ../cpu.a ../console.o ../asm.a hard.a + $(CC) -lc -o $(LCD) lcd_display.o ../dummy.o ../cpu.a ../console.o ../asm.a hard.a $(CLK): hardware_clock.o - gcc -lc -o $(CLK) hardware_clock.o + $(CC) -lc -o $(CLK) hardware_clock.o $(MKP): make_ports.o - gcc -lc -o $(MKP) make_ports.o + $(CC) -lc -o $(MKP) make_ports.o $(IOP): port_io.o - gcc -lc -o $(IOP) port_io.o + $(CC) -lc -o $(IOP) port_io.o $(MON): monitor_cpu.o ../cpu.a ../console.o ../asm.a - gcc -lc -o $(MON) monitor_cpu.o ../cpu.a ../console.o ../asm.a + $(CC) -lc -o $(MON) monitor_cpu.o ../cpu.a ../console.o ../asm.a diff -ur z80-asm-2.4.1/hardware/analyzer.c z80-asm-2.4.1-cp/hardware/analyzer.c --- z80-asm-2.4.1/hardware/analyzer.c 2005-06-06 10:02:29.000000000 +0100 +++ z80-asm-2.4.1-cp/hardware/analyzer.c 2021-01-25 21:56:41.000000000 +0000 @@ -30,7 +30,7 @@ '0'+cpu_pin[rd], '0'+cpu_pin[wr], '0'+cpu_pin[mreq], '0'+cpu_pin[iorq], '0'+cpu_pin[m1] ); fprintf(fp," %c%c %c%c%c %c%c %c ", - '0'+cpu_pin[busrq],'0'+cpu_pin[busack],'0'+cpu_pin[wait],'0'+cpu_pin[halt], + '0'+cpu_pin[busrq],'0'+cpu_pin[busack],'0'+cpu_pin[pinwait],'0'+cpu_pin[halt], '0'+cpu_pin[reset],'0'+IFF3,'0'+cpu_pin[inter],'0'+cpu_pin[rfsh]); if (cpu_pin[m1] && !last_m1) m1_counter++; diff -ur z80-asm-2.4.1/hardware/lcd_display.c z80-asm-2.4.1-cp/hardware/lcd_display.c --- z80-asm-2.4.1/hardware/lcd_display.c 2004-02-21 18:08:30.000000000 +0000 +++ z80-asm-2.4.1-cp/hardware/lcd_display.c 2021-01-25 21:56:20.000000000 +0000 @@ -143,3 +143,10 @@ end: c_shutdown(); return 0; } + +/* Hack from hell */ +void +error(int l,char *line,char *txt) +{ + fprintf(stderr,"%s\nline %d: %s\n",line,l,txt); +} diff -ur z80-asm-2.4.1/interrupt.c z80-asm-2.4.1-cp/interrupt.c --- z80-asm-2.4.1/interrupt.c 2018-04-22 17:47:19.000000000 +0100 +++ z80-asm-2.4.1-cp/interrupt.c 2021-01-25 21:57:36.000000000 +0000 @@ -66,7 +66,7 @@ IFF2= a>>2&1; set_cpu_pin(halt,a>>3&1); IM= a>>4 &3; - /* set_cpu_pin(wait,a>>6&1); */ + /* set_cpu_pin(pinwait,a>>6&1); */ set_cpu_pin(inter,a>>7&1); t = buffer[i++]; t |= buffer[i++]<<8; @@ -129,7 +129,7 @@ a= (IFF0&1) | (IFF1&1)<<1 | (IFF2&1)<<2; a|= (cpu_pin[halt]&1) << 3; a|= (IM&3) << 4; - a|= (cpu_pin[wait]&1) << 6; + a|= (cpu_pin[pinwait]&1) << 6; a|= (cpu_pin[inter]&1) << 7; i=0; buffer[i++]= I; diff -ur z80-asm-2.4.1/ports.c z80-asm-2.4.1-cp/ports.c --- z80-asm-2.4.1/ports.c 2018-04-18 11:04:15.000000000 +0100 +++ z80-asm-2.4.1-cp/ports.c 2021-01-25 21:57:00.000000000 +0000 @@ -63,9 +63,9 @@ #endif if (!cpu_is_in_disassemble) { wait_tics(TICS_MEMO); - set_cpu_pin(wait,1); + set_cpu_pin(pinwait,1); wait_tics(TICS_WAIT); - set_cpu_pin(wait,0); + set_cpu_pin(pinwait,0); } set_cpu_pin(iorq,0); set_cpu_pin(wr,0); @@ -89,9 +89,9 @@ #endif if (!cpu_is_in_disassemble) { wait_tics(TICS_MEMO); - set_cpu_pin(wait,1); + set_cpu_pin(pinwait,1); wait_tics(TICS_WAIT); - set_cpu_pin(wait,0); + set_cpu_pin(pinwait,0); } if (id == fd_in) { keystrobe(data); Only in z80-asm-2.4.1-cp/programs: out diff -ur z80-asm-2.4.1/z80-cpu.h z80-asm-2.4.1-cp/z80-cpu.h --- z80-asm-2.4.1/z80-cpu.h 2018-04-16 15:22:59.000000000 +0100 +++ z80-asm-2.4.1-cp/z80-cpu.h 2021-01-25 21:56:03.000000000 +0000 @@ -22,13 +22,13 @@ m1 machine cycle one (together with iorq acknowledges interrupt) inter maskable interrupt pending halt cpu in halt instruction - wait cpu in wait state + pinwait cpu in wait state reset cpu reset requested rfsh cpu signals memory refresh (if mreq is set) busrq external hardware requests bus control busack cpu acknowledges bus control *********************/ -enum cpu_control_pin { rd, wr, iorq, mreq, m1, inter, halt, wait, reset, rfsh, +enum cpu_control_pin { rd, wr, iorq, mreq, m1, inter, halt, pinwait, reset, rfsh, busrq, busack }; extern const bit cpu_pin[NO_CPU_CONTROL_PINS];