how can i assemble .asm file in linux for my 8051? - Page 1
Forum section: electronics / general

author: rookie of mcu
author_rank: Newbie
timestamp: August 25, 2023, 02:48:14 am
content: hello everyone , I am a newbee of the mcu. I am learning assemble not C , because I think the former is Intuitive and clean .I used to compile my program with Keil under Windows , recently I try SDCC and ASXXXX under Linux , but the SFR address of SDCC isn't same with my 8051!!! :'(When I checked list of AS8051 , I found it's same with mine.But when I saw the makefile , I felt asxxxx can't compile .asm but .c !? Am I right ??

author: PCB.Wiz
author_rank: Super Contributor
timestamp: August 25, 2023, 03:28:42 am
content: Quote from: rookie of mcu on August 25, 2023, 02:48:14 amSFR file info normally comes form an include file for your variant.Whilst some assembler have a bare-bone 8051 default SFR set inbuilt, but it is rare to not use the include files.Quote from: rookie of mcu on August 25, 2023, 02:48:14 amThe AS8051 page says this ? Perhaps you are getting confused with thesource codefor the assembler itself, called as8051.c ?Quote

author: rookie of mcu
author_rank: Newbie
timestamp: August 25, 2023, 03:47:17 am
content: I really need to make ASXXXX's makefile clear! Maybe I will reply tomorrowAnd it's my first time to insert code!Code:.PHONY:all clean prepall:as1802\as2650\as430\as6100\as61860\as6500\as6800\as6801\as6804\as6805\as6808\as6809\as6811\as6812\as6816\as740\as78k0\as78k0s\as8008\as8008s\as8048\as8051\as8085\as89lp\as8x300\as8xcxxx\asavr\asez80\asf2mc8\asf8\asgb\ash8\asm8c\aspic\asrab\asscmp\ascheck\asst6\asst7\asst8\asz8\asz80\asz280\aslink\asxscn\asxcnv\s19os9clean:rm -f $(SRCASX)*.orm -f $(SRCLNK)*.orm -f $(SRCMISC)*.orm -f $(SRCS19OS9)*.orm -f $(S19OS9)*.orm -f $(SRC1802)*.orm -f $(SRC2650)*.orm -f $(SRC430)*.orm -f $(SRC6100)*.orm -f $(SRC61860)*.orm -f $(SRC6500)*.orm -f $(SRC6800)*.orm -f $(SRC6801)*.orm -f $(SRC6804)*.orm -f $(SRC6805)*.orm -f $(SRC6808)*.orm -f $(SRC6809)*.orm -f $(SRC6811)*.orm -f $(SRC6812)*.orm -f $(SRC6816)*.orm -f $(SRC740)*.orm -f $(SRC78K0)*.orm -f $(SRC78K0S)*.orm -f $(SRC8008)*.orm -f $(SRC8008S)*.orm -f $(SRC8048)*.orm -f $(SRC8051)*.orm -f $(SRC8085)*.orm -f $(SRC89LP)*.orm -f $(SRC8X300)*.orm -f $(SRC8XCXXX)*.orm -f $(SRCAVR)*.orm -f $(SRCCHECK)*.orm -f $(SRCEZ80)*.orm -f $(SRCF2MC8)*.orm -f $(SRCF8)*.orm -f $(SRCGB)*.orm -f $(SRCH8)*.orm -f $(SRCM8C)*.orm -f $(SRCPIC)*.orm -f $(SRCRAB)*.orm -f $(SRCSCMP)*.orm -f $(SRCST6)*.orm -f $(SRCST7)*.orm -f $(SRCST8)*.orm -f $(SRCZ8)*.orm -f $(SRCZ80)*.orm -f $(SRCZ280)*.orm -f as1802rm -f as2650rm -f as430rm -f as6100rm -f as61860rm -f as6500rm -f as6800rm -f as6801rm -f as6804rm -f as6805rm -f as6808rm -f as6809rm -f as6811rm -f as6812rm -f as6816rm -f as740rm -f as78k0rm -f as78k0srm -f as8008rm -f as8008srm -f as8048rm -f as8051rm -f as8085rm -f as89lprm -f as8x300rm -f as8xcxxxrm -f asavrrm -f asez80rm -f asf2mc8rm -f asf8rm -f asgbrm -f ash8rm -f asm8crm -f aspicrm -f asrabrm -f asscmprm -f ascheckrm -f asst6rm -f asst7rm -f asst8rm -f asz8rm -f asz80rm -f asz280rm -f aslinkrm -f asxscnrm -f asxcnvrm -f s19os9rm -f $(DSTEXE)*prep:rm -f $(SRCASX)*.orm -f $(SRCLNK)*.orm -f $(SRCMISC)*.orm -f $(SRCS19OS9)*.orm -f $(SRC1802)*.orm -f $(SRC2650)*.orm -f $(SRC430)*.orm -f $(SRC6100)*.orm -f $(SRC61860)*.orm -f $(SRC6500)*.orm -f $(SRC6800)*.orm -f $(SRC6801)*.orm -f $(SRC6804)*.orm -f $(SRC6805)*.orm -f $(SRC6808)*.orm -f $(SRC6809)*.orm -f $(SRC6811)*.orm -f $(SRC6812)*.orm -f $(SRC6816)*.orm -f $(SRC740)*.orm -f $(SRC78K0)*.orm -f $(SRC78K0S)*.orm -f $(SRC8008)*.orm -f $(SRC8008S)*.orm -f $(SRC8048)*.orm -f $(SRC8051)*.orm -f $(SRC8085)*.orm -f $(SRC89LP)*.orm -f $(SRC8X300)*.orm -f $(SRC8XCXXX)*.orm -f $(SRCAVR)*.orm -f $(SRCCHECK)*.orm -f $(SRCEZ80)*.orm -f $(SRCF2MC8)*.orm -f $(SRCF8)*.orm -f $(SRCGB)*.orm -f $(SRCH8)*.orm -f $(SRCM8C)*.orm -f $(SRCPIC)*.orm -f $(SRCRAB)*.orm -f $(SRCSCMP)*.orm -f $(SRCST6)*.orm -f $(SRCST7)*.orm -f $(SRCST8)*.orm -f $(SRCZ8)*.orm -f $(SRCZ80)*.orm -f $(SRCZ280)*.orm -f as1802rm -f as2650rm -f as430rm -f as6100rm -f as61860rm -f as6500rm -f as6800rm -f as6801rm -f as6804rm -f as6805rm -f as6808rm -f as6809rm -f as6811rm -f as6812rm -f as6816rm -f as740rm -f as78k0rm -f as78k0srm -f as8008rm -f as8008srm -f as8048rm -f as8051rm -f as8085rm -f as89lprm -f as8x300rm -f as8xcxxxrm -f asavrrm -f asez80rm -f asf2mc8rm -f asf8rm -f asgbrm -f ash8rm -f asm8crm -f aspicrm -f asrabrm -f asscmprm -f ascheckrm -f asst6rm -f asst7rm -f asst8rm -f asz8rm -f asz80rm -f asz280rm -f aslinkrm -f asxscnrm -f asxcnvrm -f s19os9CC=gccCCOPT=-O3CCFLAGS=-Wall -funsigned-char $(CCOPT)LD=gccLDOPT=LDFLAGS=-Wall $(LDOPT)# Set ASXBAS relative to this make file.ASXBAS:=../../../ASXEXE:=../SRCASX:=$(ASXBAS)asxxsrc/SRCLNK:=$(ASXBAS)linksrc/SRCMISC:=$(ASXBAS)asxxmisc/SRCS19OS9:=$(ASXBAS)s19os9/DSTEXE:=$(ASXBAS)asxmak/linux/exe/SRC1802=$(ASXBAS)as1802/SRC2650=$(ASXBAS)as2650/SRC430=$(ASXBAS)as430/SRC6100=$(ASXBAS)as6100/SRC61860=$(ASXBAS)as61860/SRC6500=$(ASXBAS)as6500/SRC6800=$(ASXBAS)as6800/SRC6801=$(ASXBAS)as6801/SRC6804=$(ASXBAS)as6804/SRC6805=$(ASXBAS)as6805/SRC6808=$(ASXBAS)as6808/SRC6809=$(ASXBAS)as6809/SRC6811=$(ASXBAS)as6811/SRC6812=$(ASXBAS)as6812/SRC6816=$(ASXBAS)as6816/SRC740=$(ASXBAS)as740/SRC78K0=$(ASXBAS)as78k0/SRC78K0S=$(ASXBAS)as78k0s/SRC8008=$(ASXBAS)as8008/SRC8008S=$(ASXBAS)as8008s/SRC8048=$(ASXBAS)as8048/SRC8051=$(ASXBAS)as8051/SRC8085=$(ASXBAS)as8085/SRC89LP=$(ASXBAS)as89lp/SRC8X300=$(ASXBAS)as8x300/SRC8XCXXX=$(ASXBAS)as8xcxxx/SRCAVR=$(ASXBAS)asavr/SRCCHECK=$(ASXBAS)ascheck/SRCEZ80=$(ASXBAS)asez80/SRCF2MC8=$(ASXBAS)asf2mc8/SRCF8=$(ASXBAS)asf8/SRCGB=$(ASXBAS)asgb/SRCH8=$(ASXBAS)ash8/SRCM8C=$(ASXBAS)asm8c/SRCPIC=$(ASXBAS)aspic/SRCRAB=$(ASXBAS)asrab/SRCSCMP=$(ASXBAS)asscmp/SRCST6=$(ASXBAS)asst6/SRCST7=$(ASXBAS)asst7/SRCST8=$(ASXBAS)asst8/SRCZ8=$(ASXBAS)asz8/SRCZ80=$(ASXBAS)asz80/SRCZ280=$(ASXBAS)asz280/.SUFFIXES:.c .o%.o: %.c$(CC) $(CCFLAGS) -I$(SRCMISC) -I$(SRCASX) -c $< -o $@ASXX =asdata.o asexpr.o aslex.o aslist.o\asmain.o asmcro.o asout.o assubr.o\assym.oasdbg.oASXXSRC =$(addprefix $(SRCASX),$(ASXX))$(ASXXSRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h##################################################################### AS1802####################################################################AS1802 =1802mch.o 1802pst.oAS1802SRC =$(addprefix $(SRC1802),$(AS1802))$(AS1802SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC1802)1802.has1802:$(ASXXSRC) $(AS1802SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS1802SRC) -o as1802cp as1802 $(DSTEXE)as1802strip $(DSTEXE)as1802chmod 755 $(DSTEXE)as1802##################################################################### AS2650####################################################################AS2650 =s26adr.o s26mch.o s26pst.oAS2650SRC =$(addprefix $(SRC2650),$(AS2650))$(AS2650SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC2650)s2650.has2650:$(ASXXSRC) $(AS2650SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS2650SRC) -o as2650cp as2650 $(DSTEXE)as2650strip $(DSTEXE)as2650chmod 755 $(DSTEXE)as2650##################################################################### AS430####################################################################AS430 =m430adr.o m430mch.o m430pst.oAS430SRC =$(addprefix $(SRC430),$(AS430))$(AS430SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC430)m430.has430:$(ASXXSRC) $(AS430SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS430SRC) -o as430cp as430 $(DSTEXE)as430strip $(DSTEXE)as430chmod 755 $(DSTEXE)as430##################################################################### AS6100####################################################################AS6100 =i61adr.o i61mch.o i61pst.oAS6100SRC =$(addprefix $(SRC6100),$(AS6100))$(AS6100SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC6100)i6100.has6100:$(ASXXSRC) $(AS6100SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS6100SRC) -o as6100cp as6100 $(DSTEXE)as6100strip $(DSTEXE)as6100chmod 755 $(DSTEXE)as6100##################################################################### AS61860####################################################################AS61860 =s6186adr.o s6186mch.o s6186pst.oAS61860SRC =$(addprefix $(SRC61860),$(AS61860))$(AS61860SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC61860)s61860.has61860:$(ASXXSRC) $(AS61860SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS61860SRC) -o as61860cp as61860 $(DSTEXE)as61860strip $(DSTEXE)as61860chmod 755 $(DSTEXE)as61860##################################################################### AS6500####################################################################AS6500 =r65adr.o r65mch.o r65pst.oAS6500SRC =$(addprefix $(SRC6500),$(AS6500))$(AS6500SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC6500)r6500.has6500:$(ASXXSRC) $(AS6500SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS6500SRC) -o as6500cp as6500 $(DSTEXE)as6500strip $(DSTEXE)as6500chmod 755 $(DSTEXE)as6500##################################################################### AS6800####################################################################AS6800 =m00adr.o m00mch.o m00pst.oAS6800SRC =$(addprefix $(SRC6800),$(AS6800))$(AS6800SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC6800)m6800.has6800:$(ASXXSRC) $(AS6800SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS6800SRC) -o as6800cp as6800 $(DSTEXE)as6800strip $(DSTEXE)as6800chmod 755 $(DSTEXE)as6800##################################################################### AS6801####################################################################AS6801 =m01adr.o m01mch.o m01pst.oAS6801SRC =$(addprefix $(SRC6801),$(AS6801))$(AS6801SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC6801)m6801.has6801:$(ASXXSRC) $(AS6801SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS6801SRC) -o as6801cp as6801 $(DSTEXE)as6801strip $(DSTEXE)as6801chmod 755 $(DSTEXE)as6801##################################################################### AS6804####################################################################AS6804 =m04adr.o m04mch.o m04pst.oAS6804SRC =$(addprefix $(SRC6804),$(AS6804))$(AS6804SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC6804)m6804.has6804:$(ASXXSRC) $(AS6804SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS6804SRC) -o as6804cp as6804 $(DSTEXE)as6804strip $(DSTEXE)as6804chmod 755 $(DSTEXE)as6804##################################################################### AS6805####################################################################AS6805 =m05adr.o m05mch.o m05pst.oAS6805SRC =$(addprefix $(SRC6805),$(AS6805))$(AS6805SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC6805)m6805.has6805:$(ASXXSRC) $(AS6805SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS6805SRC) -o as6805cp as6805 $(DSTEXE)as6805strip $(DSTEXE)as6805chmod 755 $(DSTEXE)as6805##################################################################### AS6808####################################################################AS6808 =m08adr.o m08mch.o m08pst.oAS6808SRC =$(addprefix $(SRC6808),$(AS6808))$(AS6808SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC6808)m6808.has6808:$(ASXXSRC) $(AS6808SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS6808SRC) -o as6808cp as6808 $(DSTEXE)as6808strip $(DSTEXE)as6808chmod 755 $(DSTEXE)as6808##################################################################### AS6809####################################################################AS6809 =m09adr.o m09mch.o m09pst.oAS6809SRC =$(addprefix $(SRC6809),$(AS6809))$(AS6809SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC6809)m6809.has6809:$(ASXXSRC) $(AS6809SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS6809SRC) -o as6809cp as6809 $(DSTEXE)as6809strip $(DSTEXE)as6809chmod 755 $(DSTEXE)as6809##################################################################### AS6811####################################################################AS6811 =m11adr.o m11mch.o m11pst.oAS6811SRC =$(addprefix $(SRC6811),$(AS6811))$(AS6811SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC6811)m6811.has6811:$(ASXXSRC) $(AS6811SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS6811SRC) -o as6811cp as6811 $(DSTEXE)as6811strip $(DSTEXE)as6811chmod 755 $(DSTEXE)as6811##################################################################### AS6812####################################################################AS6812 =m12adr.o m12mch.o m12pst.oAS6812SRC =$(addprefix $(SRC6812),$(AS6812))$(AS6812SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC6812)m6812.has6812:$(ASXXSRC) $(AS6812SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS6812SRC) -o as6812cp as6812 $(DSTEXE)as6812strip $(DSTEXE)as6812chmod 755 $(DSTEXE)as6812##################################################################### AS6816####################################################################AS6816 =m16adr.o m16mch.o m16pst.oAS6816SRC =$(addprefix $(SRC6816),$(AS6816))$(AS6816SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC6816)m6816.has6816:$(ASXXSRC) $(AS6816SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS6816SRC) -o as6816cp as6816 $(DSTEXE)as6816strip $(DSTEXE)as6816chmod 755 $(DSTEXE)as6816##################################################################### AS740####################################################################AS740 =m74adr.o m74mch.o m74pst.oAS740SRC =$(addprefix $(SRC740),$(AS740))$(AS740SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC740)m740.has740:$(ASXXSRC) $(AS740SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS740SRC) -o as740cp as740 $(DSTEXE)as740strip $(DSTEXE)as740chmod 755 $(DSTEXE)as740##################################################################### AS78K0####################################################################AS78K0 =r78k0adr.o r78k0mch.o r78k0pst.oAS78K0SRC =$(addprefix $(SRC78K0),$(AS78K0))$(AS78K0SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC78K0)r78k0.has78k0:$(ASXXSRC) $(AS78K0SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS78K0SRC) -o as78k0cp as78k0 $(DSTEXE)as78k0strip $(DSTEXE)as78k0chmod 755 $(DSTEXE)as78k0##################################################################### AS78K0S####################################################################AS78K0S =r78kadr.o r78kmch.o r78kpst.oAS78KSRC =$(addprefix $(SRC78K0S),$(AS78K0S))$(AS78KSRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC78K0S)r78k0s.has78k0s:$(ASXXSRC) $(AS78KSRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS78KSRC) -o as78k0scp as78k0s $(DSTEXE)as78k0sstrip $(DSTEXE)as78k0schmod 755 $(DSTEXE)as78k0s##################################################################### AS8008####################################################################AS8008 =i08adr.o i08mch.o i08pst.oAS8008SRC =$(addprefix $(SRC8008),$(AS8008))$(AS8008SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC8008)i08.has8008:$(ASXXSRC) $(AS8008SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS8008SRC) -o as8008cp as8008 $(DSTEXE)as8008strip $(DSTEXE)as8008chmod 755 $(DSTEXE)as8008##################################################################### AS8008S####################################################################AS8008S =i08sadr.o i08smch.o i08spst.oAS8008SSRC =$(addprefix $(SRC8008S),$(AS8008S))$(AS8008SSRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC8008S)i08s.has8008s:$(ASXXSRC) $(AS8008SSRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS8008SSRC) -o as8008scp as8008s $(DSTEXE)as8008sstrip $(DSTEXE)as8008schmod 755 $(DSTEXE)as8008s##################################################################### AS8048####################################################################AS8048 =i48adr.o i48mch.o i48pst.oAS8048SRC =$(addprefix $(SRC8048),$(AS8048))$(AS8048SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC8048)i8048.has8048:$(ASXXSRC) $(AS8048SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS8048SRC) -o as8048cp as8048 $(DSTEXE)as8048strip $(DSTEXE)as8048chmod 755 $(DSTEXE)as8048##################################################################### AS8051####################################################################AS8051 =i51adr.o i51mch.o i51pst.oAS8051SRC =$(addprefix $(SRC8051),$(AS8051))$(AS8051SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC8051)i8051.has8051:$(ASXXSRC) $(AS8051SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS8051SRC) -o as8051cp as8051 $(DSTEXE)as8051strip $(DSTEXE)as8051chmod 755 $(DSTEXE)as8051##################################################################### AS8085####################################################################AS8085 =i85mch.o i85pst.oAS8085SRC =$(addprefix $(SRC8085),$(AS8085))$(AS8085SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC8085)i8085.has8085:$(ASXXSRC) $(AS8085SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS8085SRC) -o as8085cp as8085 $(DSTEXE)as8085strip $(DSTEXE)as8085chmod 755 $(DSTEXE)as8085##################################################################### AS89LP####################################################################AS89LP =at89adr.o at89mch.o at89pst.oAS89LPSRC =$(addprefix $(SRC89LP),$(AS89LP))$(AS89LPSRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC89LP)at89.has89lp:$(ASXXSRC) $(AS89LPSRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS89LPSRC) -o as89lpcp as89lp $(DSTEXE)as89lpstrip $(DSTEXE)as89lpchmod 755 $(DSTEXE)as89lp##################################################################### AS8X300####################################################################AS8X300 =s8xadr.o s8xmch.o s8xpst.oAS8X300SRC =$(addprefix $(SRC8X300),$(AS8X300))$(AS8X300SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC8X300)s8x.has8x300:$(ASXXSRC) $(AS8X300SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS8X300SRC) -o as8x300cp as8x300 $(DSTEXE)as8x300strip $(DSTEXE)as8x300chmod 755 $(DSTEXE)as8x300##################################################################### AS8xcxxx####################################################################AS8XCXXX =ds8adr.o ds8mch.o ds8pst.oAS8XCXXXSRC =$(addprefix $(SRC8XCXXX),$(AS8XCXXX))$(AS8XCXXXSRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRC8XCXXX)ds8.has8xcxxx:$(ASXXSRC) $(AS8XCXXXSRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(AS8XCXXXSRC) -o as8xcxxxcp as8xcxxx $(DSTEXE)as8xcxxxstrip $(DSTEXE)as8xcxxxchmod 755 $(DSTEXE)as8xcxxx##################################################################### ASAVR####################################################################ASAVR =avradr.o avrmch.o avrpst.oASAVRSRC =$(addprefix $(SRCAVR),$(ASAVR))$(ASAVRSRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRCAVR)avr.hasavr:$(ASXXSRC) $(ASAVRSRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(ASAVRSRC) -o asavrcp asavr $(DSTEXE)asavrstrip $(DSTEXE)asavrchmod 755 $(DSTEXE)asavr##################################################################### ASCHECK####################################################################ASCHECK =chkadr.o chkmch.o chkpst.oASCHECKSRC =$(addprefix $(SRCCHECK),$(ASCHECK))$(ASCHECKSRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRCCHECK)chk.hascheck:$(ASXXSRC) $(ASCHECKSRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(ASCHECKSRC) -o ascheckcp ascheck $(DSTEXE)ascheckstrip $(DSTEXE)ascheckchmod 755 $(DSTEXE)ascheck##################################################################### ASEZ80####################################################################ASEZ80 =ez80adr.o ez80mch.o ez80pst.oASEZ80SRC =$(addprefix $(SRCEZ80),$(ASEZ80))$(ASEZ80SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRCEZ80)ez80.hasez80:$(ASXXSRC) $(ASEZ80SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(ASEZ80SRC) -o asez80cp asez80 $(DSTEXE)asez80strip $(DSTEXE)asez80chmod 755 $(DSTEXE)asez80##################################################################### ASF2MC8####################################################################ASF2MC8 =f2mc8adr.o f2mc8mch.o f2mc8pst.oASF2MC8SRC =$(addprefix $(SRCF2MC8),$(ASF2MC8))$(ASF2MC8SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRCF2MC8)f2mc8.hasf2mc8:$(ASXXSRC) $(ASF2MC8SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(ASF2MC8SRC) -o asf2mc8cp asf2mc8 $(DSTEXE)asf2mc8strip $(DSTEXE)asf2mc8chmod 755 $(DSTEXE)asf2mc8##################################################################### ASF8####################################################################ASF8 =f8adr.o f8mch.o f8pst.oASF8SRC =$(addprefix $(SRCF8),$(ASF8))$(ASF8SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRCF8)f8.hasf8:$(ASXXSRC) $(ASF8SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(ASF8SRC) -o asf8cp asf8 $(DSTEXE)asf8strip $(DSTEXE)asf8chmod 755 $(DSTEXE)asf8##################################################################### ASGB####################################################################ASGB =gbadr.o gbmch.o gbpst.oASGBSRC =$(addprefix $(SRCGB),$(ASGB))$(ASGBSRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRCGB)gb.hasgb:$(ASXXSRC) $(ASGBSRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(ASGBSRC) -o asgbcp asgb $(DSTEXE)asgbstrip $(DSTEXE)asgbchmod 755 $(DSTEXE)asgb##################################################################### ASH8####################################################################ASH8 =h8adr.o h8mch.o h8pst.oASH8SRC =$(addprefix $(SRCH8),$(ASH8))$(ASH8SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRCH8)h8.hash8:$(ASXXSRC) $(ASH8SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(ASH8SRC) -o ash8cp ash8 $(DSTEXE)ash8strip $(DSTEXE)ash8chmod 755 $(DSTEXE)ash8##################################################################### ASM8C####################################################################ASM8C =m8cadr.o m8cmch.o m8cpst.oASM8CSRC =$(addprefix $(SRCM8C),$(ASM8C))$(ASM8CSRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRCM8C)m8c.hasm8c:$(ASXXSRC) $(ASM8CSRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(ASM8CSRC) -o asm8ccp asm8c $(DSTEXE)asm8cstrip $(DSTEXE)asm8cchmod 755 $(DSTEXE)asm8c##################################################################### ASPIC####################################################################ASPIC =picadr.o picmch.o picpst.oASPICSRC =$(addprefix $(SRCPIC),$(ASPIC))$(ASPICSRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRCPIC)pic.haspic:$(ASXXSRC) $(ASPICSRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(ASPICSRC) -o aspiccp aspic $(DSTEXE)aspicstrip $(DSTEXE)aspicchmod 755 $(DSTEXE)aspic##################################################################### ASRAB####################################################################ASRAB =rabadr.o rabmch.o rabpst.oASRABSRC =$(addprefix $(SRCRAB),$(ASRAB))$(ASRABSRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRCRAB)rab.hasrab:$(ASXXSRC) $(ASRABSRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(ASRABSRC) -o asrabcp asrab $(DSTEXE)asrabstrip $(DSTEXE)asrabchmod 755 $(DSTEXE)asrab##################################################################### ASSCMP####################################################################ASSCMP =scmpadr.o scmpmch.o scmppst.oASSCMPSRC =$(addprefix $(SRCSCMP),$(ASSCMP))$(ASSCMPSRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRCSCMP)scmp.hasscmp:$(ASXXSRC) $(ASSCMPSRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(ASSCMPSRC) -o asscmpcp asscmp $(DSTEXE)asscmpstrip $(DSTEXE)asscmpchmod 755 $(DSTEXE)asscmp##################################################################### ASST6####################################################################ASST6 =st6adr.o st6mch.o st6pst.oASST6SRC =$(addprefix $(SRCST6),$(ASST6))$(ASST6SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRCST6)st6.hasst6:$(ASXXSRC) $(ASST6SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(ASST6SRC) -o asst6cp asst6 $(DSTEXE)asst6strip $(DSTEXE)asst6chmod 755 $(DSTEXE)asst6##################################################################### ASST7####################################################################ASST7 =st7adr.o st7mch.o st7pst.oASST7SRC =$(addprefix $(SRCST7),$(ASST7))$(ASST7SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRCST7)st7.hasst7:$(ASXXSRC) $(ASST7SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(ASST7SRC) -o asst7cp asst7 $(DSTEXE)asst7strip $(DSTEXE)asst7chmod 755 $(DSTEXE)asst7##################################################################### ASST8####################################################################ASST8 =st8adr.o st8mch.o st8pst.oASST8SRC =$(addprefix $(SRCST8),$(ASST8))$(ASST8SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRCST8)st8.hasst8:$(ASXXSRC) $(ASST8SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(ASST8SRC) -o asst8cp asst8 $(DSTEXE)asst8strip $(DSTEXE)asst8chmod 755 $(DSTEXE)asst8##################################################################### ASZ8####################################################################ASZ8 =z8adr.o z8mch.o z8pst.oASZ8SRC =$(addprefix $(SRCZ8),$(ASZ8))$(ASZ8SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRCZ8)z8.hasz8:$(ASXXSRC) $(ASZ8SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(ASZ8SRC) -o asz8cp asz8 $(DSTEXE)asz8strip $(DSTEXE)asz8chmod 755 $(DSTEXE)asz8##################################################################### ASZ80####################################################################ASZ80 =z80adr.o z80mch.o z80pst.oASZ80SRC =$(addprefix $(SRCZ80),$(ASZ80))$(ASZ80SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h $(SRCZ80)z80.hasz80:$(ASXXSRC) $(ASZ80SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(ASZ80SRC) -o asz80cp asz80 $(DSTEXE)asz80strip $(DSTEXE)asz80chmod 755 $(DSTEXE)asz80##################################################################### ASZ280####################################################################ASZ280 =z280adr.o z280mch.o z280pst.oASZ280SRC =$(addprefix $(SRCZ280),$(ASZ280))$(ASZ280SRC):$(SRCMISC)alloc.h $(SRCASX)asxxxx.h\$(SRCZ280)z280def.h\$(SRCZ280)z280ops.h\$(SRCZ280)z280opcy.hasz280:$(ASXXSRC) $(ASZ280SRC)$(LD) $(LDFLAGS) $(ASXXSRC) $(ASZ280SRC) -o asz280cp asz280 $(DSTEXE)asz280strip $(DSTEXE)asz280chmod 755 $(DSTEXE)asz280##################################################################### ASLINK####################################################################ASLINK =lkmain.o lkhead.o lkarea.o lkbank.o\lkdata.o lkeval.o lklex.o lklibr.o\lklist.o lkrloc.o lkrloc3.o lkrloc4.o\lksym.o lkout.o lknoice.o lksdcdb.oASLINKSRC =$(addprefix $(SRCLNK),$(ASLINK))$(ASLINK):$(SRCMISC)alloc.h $(SRCLNK)aslink.haslink:$(ASLINKSRC)$(LD) $(LDFLAGS) $(ASLINKSRC) -o aslinkcp aslink $(DSTEXE)aslinkstrip $(DSTEXE)aslinkchmod 755 $(DSTEXE)aslink##################################################################### ASXCNV####################################################################$(SRCMISC)asxxconv.o:$(SRCASX)asxxxx.hasxcnv:$(SRCMISC)asxxconv.o$(LD) $(LDFLAGS) $(SRCMISC)asxxconv.o -o asxcnvcp asxcnv $(DSTEXE)asxcnvstrip $(DSTEXE)asxcnvchmod 755 $(DSTEXE)asxcnv##################################################################### ASXSCN####################################################################$(SRCMISC)asxxscan.o:$(SRCASX)asxxxx.hasxscn:$(SRCMISC)asxxscan.o$(LD) $(LDFLAGS) $(SRCMISC)asxxscan.o -o asxscncp asxscn $(DSTEXE)asxscnstrip $(DSTEXE)asxscnchmod 755 $(DSTEXE)asxscn##################################################################### S19OS9####################################################################$(SRCS19OS9)s19os9.o:$(SRCASX)asxxxx.hs19os9:$(SRCS19OS9)s19os9.o$(LD) $(LDFLAGS) $(SRCS19OS9)s19os9.o -o s19os9cp s19os9 $(DSTEXE)s19os9strip $(DSTEXE)s19os9chmod 755 $(DSTEXE)s19os9### end ############################################################

author: rookie of mcu
author_rank: Newbie
timestamp: August 25, 2023, 08:31:50 am
content: New process:I try SDCC again and it indeed can compile my .asm file , now I am trying to modify include file of 8051Anyone knows the PATH?

author: djnz
author_rank: Regular Contributor
timestamp: August 28, 2023, 02:31:09 am
content: May be also take a look at ASEM-51 -http://plit.de/asem-51/home.htm

author: retiredfeline
author_rank: Frequent Contributor
timestamp: August 28, 2023, 03:04:05 am
content: SDCC's 8051 assembler is derived from asxxxx so if you have SDCC then you can use its assembler. You can invoke it direct as sdas8051 and runningCode:sdas8051 -hwill get you some help for the options. Otherwise look at the asxxxx documention for detailed documentation:https://shop-pdp.net/ashtml/asmblr.htmNot sure why you want the include files, those are for compiling C. For assembler you would set up some EQUs to define the port addresses. Remember that peripherals outside of the standard set in 8051 will be at addresses specific to that variant.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: August 28, 2023, 05:01:06 am
content: Quote from: rookie of mcu on August 25, 2023, 02:48:14 amWhat target MCU do you use ?As well as ASEM-51, there is also a windows simulator, useful for learning. Windows only, but it can use SDCC too. v6.3.3 - 2022-10-21https://www.rathlev-home.de/mc/mctools-e.html

author: rookie of mcu
author_rank: Newbie
timestamp: August 29, 2023, 01:04:01 am
content: As an intern , I help to test mcu's function with simple instruction

author: Doctorandus_P
author_rank: Super Contributor
timestamp: August 29, 2023, 06:09:09 am
content: Maybe mcu8051ide is worth looking into.

author: tridac
author_rank: Regular Contributor
timestamp: August 31, 2023, 02:50:07 pm
content: There should be a facility in Keil C to get an assember source listing as part of the build. Done a fair amount of work with Keil C and 8051 variants, but it's not an architecture I would choose to learn asembler. Typical output from the compiler, asm listing, is pages of impenetrable asm for even the simplest operations. Kudos to Keil for even building a complier for that, producing working code most of the time, but you would do better with a more modern architectiure such as ST Arm STM32 variant, for which there are dozens of cheap boards on Ebay. Then use the linux arm tool chain package and Gnu make. Any 8051 is nightmare to program big projects and best avoided. If you really want 8051, then buy one of the Si Labs evaluation kits, which come with a complete free Keil based toolchain for small or non commercial projects. They redesigned using a risc core hardware emulation of the 8051 and for an 8 bit micro, are really fast as well...

author: westfw
author_rank: Super Contributor
timestamp: September 03, 2023, 11:18:49 pm
content: QuoteI'm going to somewhat disagree.The 8051 dates from an older time, when architectures were DESIGNED to be programmed in assembler. The C compiler is large and impenetrable BECAUSE of this - most modern architectures were designed to support modern (HLL) language compilers, but the 8051 was not.But if you'renottrying to duplicate the behaviors of a HLL, these older architectures let an assembly language programmer do a lot of clever and rather fun things. By comparison, programming an ARM in assembly language is rather tedious, boring, and not very rewarding - it's really hard to do better than a compiler.Now, it's not clear that learning "clever" assembly language is particularly worthwhile any more. Your employability might be better served by learning one of more "basically similar" RISC architectures. Load, operate, store, blah. But it won't be as much fun, IMO. And there are a LOT of surviving 8051-architecture devices deeply embedded in special purpose SoCs. Career-wise, being familiar with "legacy" devices can be valuable, but it can also leave you "stuck."(The other surviving architecture(s) aimed at assembly users is the 8bit PIC architecture, and I guess the ST-8. AVR and the Motorola/Freescale/NXP xxxx08 chips are somewhat in-between.)

author: tridac
author_rank: Regular Contributor
timestamp: September 06, 2023, 12:11:30 am
content: I was a diehard asm programmer for many years. 6502 bought lunch here and loved it at the time, good mnemonic instruction set and powerful addressing modes, including pre and post indexed indirect. Great for bare metal work, but any 8 bit micro is hard work for larger projects, imho, of course. One 8051 project here split address space into 2 x 32 k segments, 32k for common code and the top, bankswitched across 6 overlays. Like working with hands tied behind the back, too many compromises, like counting machine cycles in interrupt handlers, and increases development costs. End up thinking in asm, not data structures. Now, would do just first stage init, stack, perhaps memtest in asm, then jump to main() for the rest of the setup in C. What modern micros have given us is the freedom to design projects where cpu throughput can be safelly ignored, whereas in the past, that could be a serious limiting factor. Compilers are better as well, sometimes producing just a single line of asm per C statement.Having said all that, 8051 is ok for learning, and the Si Labs evaluation kits were great value, around $100 when I last used them. You get a cpu board, ready to go, wall wart, full Keil tools, usb / jtag debug adapter, blinky light and other examples and all the docs. The tools are limited, but still enough code space for small projects. Seriously fast as well, up to 50mips from the risc core based 8051 emulation. However, world has moved on, probably far more cheap hardware, online support, free tool chains etc, using something more modern like Cortex M3, or even M0. A far better architecture to learn on...

author: PCB.Wiz
author_rank: Super Contributor
timestamp: September 06, 2023, 01:14:57 am
content: Quote from: tridac on September 06, 2023, 12:11:30 amThe 8051 is far from dead, and Silabs have released their 5V EFM8BB5x series, which have good analog and 50MHz (as you say).QuoteYes, the days ofneedingto code 100% in ASM are behind us, the earlier Silabs parts started at 2k Flash, but I've not seen anyone release a 2K 8051 for years now.Most new releases start at 8kF and 1KR, with Nuvoton and STC releasing new partsThe smallest EFM8BB5x are 8 kB flash 1.28 kB RAM, and the 32 kB flash 2.304 kB parts are still well under $1Companies like Fortior Tech, release 8051 cores with motor control/gate driver/LDO in one package.Lumissil have new 8051 parts with ECC Flash and RAM for automotive and parts coming with LIN/LDO included.WCH and STC have released new parts with FS-USB support.

author: westfw
author_rank: Super Contributor
timestamp: September 06, 2023, 06:53:17 am
content: QuoteI don't disagree. By the time you start having to deal with special bank-switching schemes, even if they've been added by a vendor, it's time to move to a processor with a native address size of more than the 16bits you see on most 8bit CPUs. (normally 32bit CPUs. But a 68000 was only considered a 16bit CPU and handled 24bit addresses, right?)I don't even like the AVRs with more than 128k (64k words) of memory; they get "messy."OTOH, what you're calling a "larger project" is VERY large by most 8bit microcontroller project standards. The 8052 that was probably the most popular version of the 8051 architecture usually had 8k or less of program.

author: DiTBho
author_rank: Super Contributor
timestamp: September 06, 2023, 08:34:37 am
content: every single CISC-ish design made by intelismessyandpellmellintel i960 is/was pure RISC, and I found out that the design was not done internally by intel but by an external group working with intelThis explains why the i960 user and programming manuals seem written by simple people instead of those technicians behind { i48, i51, i85, i80, x86, ... } who don't even know what the public could understand from their pellmell designs.Seriously, comparing books from IDT, Motorola, Hitachi and MIPS to everything made internally by Intel… oh my gosh I really need to clean my eyes with bleach every twelve pages to avoid becoming short-sighted like them.Comparing (x) vs (y):i51 vs hc11 = x86 vs 68k{ confused, chaotic, pell-mell } vs { clean, tidy, straightforward }

author: DiTBho
author_rank: Super Contributor
timestamp: September 06, 2023, 08:43:22 am
content: Quote from: PCB.Wiz on September 06, 2023, 01:14:57 am+ Dalsemi, with their 390 and 400 serie @ 40Mhz

author: PCB.Wiz
author_rank: Super Contributor
timestamp: September 06, 2023, 09:06:40 am
content: Quote from: DiTBho on September 06, 2023, 08:43:22 amYou can even still buy those !For a new design however, something more modern and at a better place on the price curve is likely to be chosen.eg STC Micro STC8H8K64U-45I-TSSOP20 has 8K RAM 64K Flash FS-USB, sub 30c 500+ at lcsc

author: DiTBho
author_rank: Super Contributor
timestamp: September 06, 2023, 11:57:30 am
content: Quote from: westfw on September 06, 2023, 06:53:17 amYup, although I was not at all satisfied with the development system based on a modified version of Codewarrior (please, don't ask how I got my hands on it), at least, since the Playstation1 is a system where CPU, BUS and CPU are all 32bit, I had less confusion in my head, 32bit? 16bit? 24bit? what is what? unlike 68k-based consoles made by SEGA and NEOGEOThe SEGA Genesis, commercially knon as "MegaDrive", was centered on a Motorola 68000 processor as the CPU (16bit bus), a Zilog Z80 as a sound controller, and a video system supporting hardware sprites, tiles, and scrolling, but it was advertized as "16-bit fourth generation home video game console"The NeoGeo M1 was marketed as "the first 24-bit system", while its CPU was actually a 32-bit 68000 (16bit bus) with an 8-bit Z80 coprocessor, and the GPU chipset has a 24-bit (dedicated) graphics data bus.