Porting assembler code from Keil to SDCC

Hi there,

I am trying to port some 8051 assembler code from Keil A51 to SDCC asx8051 and got some problems:

1) EQU ABC EQU 8000h FLAG_RS0 EQU PSW.3 ... mov dptr, #ABC ... jb FLAG_RS0, somewhere

How to convert the EQU to asx8051 syntax?

2) Macro DELAY MACRO nop nop nop ENDM

Does asx8051 support macros?

3) Any other gotchas I have to aware of? :-)

Thanks

Joe

Reply to
Joe
Loading thread data ...

Joe,

I don't know the asx8051 assembler but what error messages to you get on this? Anyhow, try putting 0D3h instead of PSW.3 and then see what error messages you get.

Dave Bardon, Avocet.

Reply to
Avocet Systems, Inc

Hi Dave,

asx8051 is the 8051 assembler comes with the SDCC package. Currently I am trying to write a simple perl script to convert my old assembler files for Keil a51 to the asx8051, but I am completely stuck at this moment. I havn't get to the stage of debuggin the above code yet, even the following simple code give me problem:

.area CODE (ABS)

.org 0h000 jmp start

.org 0h100 start: nop nop nop jmp start

end

$> asx8051 simple.asm

?ASxxxx-Error- in line 4 of simple.asm machine specific addressing or addressing mode error ?ASxxxx-Error- in line 12 of simple.asm machine specific addressing or addressing mode error removing $>

Both line that get the errors are the jmp instructions. Anyone know what I am doing wrong?

Thanks for your help in advance. Joe

Reply to
Joe

Problem solved (partially): ================================== It seems the jmp instruction in keil a51 need to be replaced with ljmp/sjmp instructions. ==================================

This becomes:

ABC = 0h8000 ; note the value syntax changed (Doop!) FLAG_RS0 = PSW.3 ; this works ... mov dptr, #ABC ; this works mov dptr, #0h8000 ; or if I put the value, ; the value syntax changed in asx8051

... jb FLAG_RS0, somewhere

================================== The "end" at the end of assembly file need to be removed. ================================== Still couldn't find any way to replace MACRO :-(

So my script will need to convert all the values from Keil A51 syntax to asx8051 syntax.

Joe

Reply to
Joe

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.