Menu

#172 Add REL1ADR internal relocation type

open
nobody
None
7
2010-05-06
2010-05-05
Anonymous
No

Dumb example, but it explains it best (I hope).

; DUMB_DB.ASM
; doesn't work: NASM 0.98.39 or 2.08.01
; works: YASM 1.0.0

org 100h

begin:
mov cl,10
mov al,[table]
add ax,80h
div cl
push ax
aam
or ax,'00'
xchg ah,al
int 29h
xchg ah,al
int 29h
pop ax
xchg ah,al
or al,'0'
int 29h
ret

;table: db 321-80h ; yet this works in NASM, dunno why
table: db begin-80h ; doesn't work in NASM, dunno why

Discussion

  • Victor van den Elzen

    See also the NASM manual section 12.1.4 ( http://nasm.us/doc/nasmdo12.html#section-12.1#section-12.1.4 ). Using (begin-$$) kind of solves this problem, but is maybe not ideal.

     
  • H. Peter Anvin

    H. Peter Anvin - 2010-05-06

    This is a feature request, not a bug, per se.

    What this means is adding internal support for 8-bit wide relocatable data types i.e. REL1ADR.

    We also really could use better documentation explaining to user than -f bin really is nothing but a linker built into the nasm binary. Not that anyone will actually understand and/or read that documentation...

     
  • H. Peter Anvin

    H. Peter Anvin - 2010-05-06
    • labels: 1022311 -->
    • priority: 5 --> 7
    • summary: mishandling of data db of 16-bit offset w/ simple arithmetic --> Add REL1ADR internal relocation type
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.