Document for avrasm and avr-as differences?

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is there such a thing as a docment that details the differences between avrasm as it ships in AVR Studio and Gnu avr-as?

TIA -dave

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well each has a user manual so it's just a case of comparing the two. But all you are really looking at are a bunch of changed directives

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK. I've never used the Atmel assembler, and I've used the Gnu assembler only sparingly. Just thought if somebody had already "diff'ed" the manuals I could save myself the effort of doing the same.

If the only differences are in directives and not in code statement syntax, then it sounds like differences are pretty minimal.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well the AVRASM(2) ones are:

Directive			Description 

BYTE				Reserve byte to a variable 
CSEG				Code Segment 
CSEGSIZE			Program memory size 
DB					Define constant byte(s) 
DEF					Define a symbolic name on a register 
DEVICE				Define which device to assemble for 
DSEG				Data Segment 
DW					Define Constant word(s) 
ENDM, ENDMACRO		EndMacro
EQU					Set a symbol equal to an expression 
ESEG				EEPROM Segment
EXIT				Exit from file 
INCLUDE				Read source from another file
LIST				Turn listfile generation on 
LISTMAC				Turn Macro expansion in list file on 
MACRO				Begin Macro
NOLIST				Turn listfile generation off
ORG					Set program origin 
SET					Set a symbol to an expression 
ELSE,ELIF			Conditional assembly
ENDIF				Conditional assembly
ERROR				Outputs an error message
IF,IFDEF,IFNDEF		Conditional assembly
MESSAGE				Outputs a message string
DD					Define Doubleword
DQ					Define Quadword
UNDEF				Undefine register symbol
WARNING				Outputs a warning message
OVERLAP/NOOVERLAP	Set up overlapping section

For avr-as just look at the installed manual and specifically this part of the index:

7.1 .abort 
7.2 .ABORT (COFF) 
7.3 .align abs-expr, abs-expr, abs-expr 
7.4 .ascii "string"... 
7.5 .asciz "string"... 
7.6 .balign[wl] abs-expr, abs-expr, abs-expr 
7.7 .byte expressions 
7.8 .comm symbol , length 
7.9 .cfi_startproc [simple] 
7.10 .cfi_endproc 
7.11 .cfi_personality encoding [, exp] 
7.12 .cfi_lsda encoding [, exp] 
7.13 .cfi_def_cfa register, offset 
7.14 .cfi_def_cfa_register register 
7.15 .cfi_def_cfa_offset offset 
7.16 .cfi_adjust_cfa_offset offset 
7.17 .cfi_offset register, offset 
7.18 .cfi_rel_offset register, offset 
7.19 .cfi_register register1, register2 
7.20 .cfi_restore register 
7.21 .cfi_undefined register 
7.22 .cfi_same_value register 
7.23 .cfi_remember_state, 
7.24 .cfi_return_column register 
7.25 .cfi_signal_frame 
7.26 .cfi_window_save 
7.27 .cfi_escape expression[, ...] 
7.28 .file fileno filename 
7.29 .loc fileno lineno [column] [options] 
7.30 .loc_mark_blocks enable 
7.31 .data subsection 
7.32 .def name 
7.33 .desc symbol, abs-expression 
7.34 .dim 
7.35 .double flonums 
7.36 .eject 
7.37 .else 
7.38 .elseif 
7.39 .end 
7.40 .endef 
7.41 .endfunc 
7.42 .endif 
7.43 .equ symbol, expression 
7.44 .equiv symbol, expression 
7.45 .eqv symbol, expression 
7.46 .err 
7.47 .error "string" 
7.48 .exitm 
7.49 .extern 
7.50 .fail expression 
7.51 .file string 
7.52 .fill repeat , size , value 
7.53 .float flonums 
7.54 .func name[,label] 
7.55 .global symbol, .globl symbol 
7.56 .hidden names 
7.57 .hword expressions 
7.58 .ident 
7.59 .if absolute expression 
7.60 .incbin "file"[,skip[,count]] 
7.61 .include "file" 
7.62 .int expressions 
7.63 .internal names 
7.64 .irp symbol,values... 
7.65 .irpc symbol,values... 
7.66 .lcomm symbol , length 
7.67 .lflags 
7.68 .line line-number 
7.69 .linkonce [type] 
7.70 .ln line-number 
7.71 .mri val 
7.72 .list 
7.73 .long expressions 
7.74 .macro 
7.75 .altmacro 
7.76 .noaltmacro 
7.77 .nolist 
7.78 .octa bignums 
7.79 .org new-lc , fill 
7.80 .p2align[wl] abs-expr, abs-expr, abs-expr 
7.81 .previous 
7.82 .popsection 
7.83 .print string 
7.84 .protected names 
7.85 .psize lines , columns 
7.86 .purgem name 
7.87 .pushsection name , subsection 
7.88 .quad bignums 
7.89 .reloc offset, reloc_name[, expression] 
7.90 .rept count 
7.91 .sbttl "subheading" 
7.92 .scl class 
7.93 .section name 
7.94 .set symbol, expression 
7.95 .short expressions 
7.96 .single flonums 
7.97 .size 
7.98 .sleb128 expressions 
7.99 .skip size , fill 
7.100 .space size , fill 
7.101 .stabd, .stabn, .stabs 
7.102 .string "str" 
7.103 .struct expression 
7.104 .subsection name 
7.105 .symver 
7.106 .tag structname 
7.107 .text subsection 
7.108 .title "heading" 
7.109 .type 
7.110 .uleb128 expressions 
7.111 .val addr 
7.112 .version "string" 
7.113 .vtable_entry table, offset 
7.114 .vtable_inherit child, parent 
7.115 .warning "string" 
7.116 .weak names 
7.117 .weakref alias, target 
7.118 .word expressions 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Besides differences in directives, there's also differences in operators and in addressing locations in program memory (avrasm counts by words and gas counts by bytes).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
there's also differences in operators and in addressing locations in program memory

Those would count as non-trivial differences...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One of those serious is ORG does not work as expected on avr-as!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
One of those serious is ORG does not work as expected on avr-as!

Well, that depends on what you expect :) Since I'm coming from the gnu world, I think you just told me that ORG in avrasm doesn't work the way I expect :)