mirror of
https://github.com/yasm/yasm
synced 2026-08-26 22:26:05 -04:00
This allows for arbitrary load (LMA) and execution (VMA) addresses. The following new section attributes are supported: - start (LMA start address) - follows (follow another section's last LMA) - align (LMA alignment) - vstart (VMA start address) - vfollows (follow another section's last VMA) - valign (VMA alignment) In addition, sections can be designed progbits or nobits. The following special symbols are generated for program use: - section.<sectname>.start (LMA start address) - section.<sectname>.vstart (VMA start address) - section.<sectname>.length (section length) The ORG directive adjusts the file offset relative to LMA, so that if ORG=0x100, a section with LMA=0x100 will be at file offset 0. VMA addresses are the same as LMA addresses unless otherwise specified. Full map file support is supported via the [MAP] directive. The map output filename can be set either as a parameter to the [MAP] directive or on the command line with --mapfile=<filename>. MAP options are BRIEF, SECTIONS, SEGMENTS, SYMBOLS, and ALL (all of the above). If no filename is specified either on the command line or in the source file, the map is output to standard output. Full documentation will be added to the Yasm manual in the near future. This implementation supports several configurations NASM does not, for instance http://osdir.com/ml/lang.nasm.devel/2004-12/msg00032.html . It is also fully 64-bit aware. Fixes: #71, #99. svn path=/trunk/yasm/; revision=2010
42 lines
808 B
NASM
42 lines
808 B
NASM
org 100h
|
|
[map all]
|
|
|
|
section .bss ; follows=.data
|
|
buffer resb 123h
|
|
section .data
|
|
msg db "this is a message", 0
|
|
section .text
|
|
mov ax, msg
|
|
call showax
|
|
mov ax, buffer
|
|
call showax
|
|
ret
|
|
|
|
;-----------------
|
|
showax:
|
|
push cx
|
|
push dx
|
|
|
|
mov cx, 4 ; four digits to show
|
|
|
|
.top
|
|
rol ax, 4 ; rotate one digit into position
|
|
mov dl, al ; make a copy to process
|
|
and dl, 0Fh ; mask off a single (hex) digit
|
|
cmp dl, 9 ; is it in the "A" to "F" range?
|
|
jbe .dec_dig ; no, skip it
|
|
add dl, 7 ; adjust
|
|
.dec_dig:
|
|
add dl, 30h ; convert to character
|
|
|
|
push ax
|
|
mov ah, 2
|
|
int 21h
|
|
pop ax
|
|
|
|
loop .top
|
|
|
|
pop dx
|
|
pop cx
|
|
ret
|
|
;--------------------------
|